Skip to content

Commit da7ee1e

Browse files
committed
Merge pull request #72 from zbeekman/update-1.x
Apply changes from PR #71 via cherry-pick to 1.x branch
2 parents 2e0d2e1 + a5ae6cc commit da7ee1e

File tree

8 files changed

+86
-24
lines changed

8 files changed

+86
-24
lines changed

.travis.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ env:
77
- MPICH_URL_HEAD="http://www.mpich.org/static/downloads/$MPICH_VER"
88
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
99
- MPICH_DIR="$HOME/.local/usr/mpich"
10-
- OSX_PACKAGES="gcc cmake mpich"
11-
# homebrew bug requires MPI to be built from source, for now
10+
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/64308/"
11+
- MPICH_BOT_URL_TAIL="mpich-3.2.yosemite.bottle.1.tar.gz"
12+
- OSX_PACKAGES="gcc cmake"
1213

1314
matrix:
1415
include:
@@ -17,7 +18,8 @@ matrix:
1718
sudo: false
1819
cache:
1920
directories:
20-
"$CACHE"
21+
- "$CACHE"
22+
- "$HOME/.cache/pip"
2123
addons:
2224
apt:
2325
sources:
@@ -26,13 +28,14 @@ matrix:
2628
packages:
2729
- gcc-5
2830
- gfortran-5
31+
- binutils
2932
- cmake-data
3033
- cmake
3134

3235
before_install:
3336
- |
3437
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
35-
brew update 2>brewupdate.err | tee brewupdate.log | head -n 1
38+
export PATH="$PATH:$HOME/Library/Python/2.7/bin"
3639
else
3740
[[ -d "$CACHE/bin" ]] || mkdir -p "$CACHE/bin"
3841
[[ -d "$MPICH_DIR" ]] || mkdir -p "$MPICH_DIR"
@@ -47,10 +50,21 @@ before_install:
4750
install:
4851
- |
4952
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
53+
brew update > /dev/null
54+
5055
for pkg in $OSX_PACKAGES; do
51-
[[ "$(brew ls --versions $pkg)" ]] || brew install $pkg
52-
brew outdated $pkg || brew upgrade $pkg
56+
[[ "$(brew ls --versions $pkg)" ]] || brew install --force-bottle $pkg
57+
brew outdated $pkg || brew upgrade --force-bottle $pkg
5358
done
59+
export FC=gfortran-5
60+
export CC=gcc-5
61+
if ! [[ "$(brew ls --versions mpich)" ]]; then
62+
wget ${MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}
63+
brew install --force-bottle ${MPICH_BOT_URL_TAIL}
64+
if ! [[ "$(brew ls --versions mpich)" ]]; then
65+
brew install --force-bottle mpich
66+
fi
67+
fi
5468
else
5569
if ! ( [[ -x "$HOME/.local/bin/mpif90" ]] && [[ -x "$HOME/.local/bin/mpicc" ]] ); then
5670
# mpich install not cached
@@ -87,6 +101,22 @@ before_script:
87101
script:
88102
- mkdir cmake-build
89103
- cd cmake-build
90-
- cmake ..
104+
- cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_Fortran_FLAGS='-ftest-coverage -fprofile-arcs -O0' -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage -O0' ..
91105
- make -j 4
92106
- ctest --verbose
107+
- make install
108+
- cd ..
109+
110+
after_success:
111+
- find . -name '*.gcno' -print
112+
- find . -name '*.gcda' -print
113+
- gcov-5 --version
114+
- bash <(curl -s https://codecov.io/bash) -x $(which gcov-5)
115+
116+
notifications:
117+
webhooks:
118+
urls:
119+
- $GITTERHOOK_URL
120+
on_success: change # options: [always|never|change]
121+
on_failure: always
122+
on_start: always

CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ else()
3535
)
3636
endif()
3737

38+
3839
if (CMAKE_VERSION VERSION_GREATER 3.2.3)
3940
# Detect Fortran compiler version directly
4041
if(gfortran_compiler AND (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 5.0.0))
@@ -44,6 +45,17 @@ if (CMAKE_VERSION VERSION_GREATER 3.2.3)
4445
set(opencoarrays_aware_compiler false)
4546
add_definitions(-DPREFIX_NAME=_caf_extensions_)
4647
endif()
48+
if(gfortran_compiler AND (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.4))
49+
# GCC patch to fix issue accepted for 5.4 release
50+
# See https://github.com/sourceryinstitute/opencoarrays/issues/28 and
51+
# https://groups.google.com/forum/#!msg/opencoarrays/RZOwwYTqG80/46S9eL696dgJ
52+
message( STATUS "Disabling optimization flags due to GCC < 5.4 bug")
53+
set(CMAKE_Fortran_FLAGS_RELEASE -O0
54+
CACHE STRING "Flags used by the compiler during release builds." FORCE)
55+
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -DNDEBUG -O0"
56+
CACHE STRING "Flags used by the compiler during release builds with debug info" FORCE)
57+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0")
58+
endif()
4759
else()
4860
# Use the C compiler version as a proxy for the Fortran compiler version (won't work with NAG)
4961
if(gfortran_compiler AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER 5.0.0))
@@ -53,6 +65,17 @@ else()
5365
set(opencoarrays_aware_compiler false)
5466
add_definitions(-DPREFIX_NAME=_caf_extensions_)
5567
endif()
68+
if(gfortran_compiler AND (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.4))
69+
# GCC patch to fix issue accepted for the 5.4 release
70+
# See https://github.com/sourceryinstitute/opencoarrays/issues/28 and
71+
# https://groups.google.com/forum/#!msg/opencoarrays/RZOwwYTqG80/46S9eL696dgJ
72+
message( STATUS "Disabling optimization flags due to GCC < 5.4 bug")
73+
set(CMAKE_Fortran_FLAGS_RELEASE -O0
74+
CACHE STRING "Flags used by the compiler during release builds." FORCE)
75+
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -DNDEBUG -O0"
76+
CACHE STRING "Flags used by the compiler during release builds with debug info" FORCE)
77+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0")
78+
endif()
5679
endif()
5780

5881

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ We gratefully acknowledge support from the following institutions:
9494
[Google]: http://google.com
9595
[CINECA]: http://www.cineca.it/en
9696
[NERSC]: http://www.nersc.gov
97-
[NCAR]: http://ncar.ucar.edu
97+
[National Center for Atmospheric Research]: http://ncar.ucar.edu
9898
[INSTALL.md]: ./INSTALL.md
9999
[GASNet]: http://gasnet.lbl.gov
100100
[menu of services]: http://opencoarrays.org/services
101101
[CONTRIBUTING.md]: ./CONTRIBUTING.md
102102
[STATUS.md]: ./STATUS.md
103103
[GETTING_STARTED.md]: ./GETTING_STARTED.md
104104
[Google Groups]: https://groups.google.com
105-
[subscribing]: https://groups.google.com/forum/#!forum/opencoarrays/join
105+
[Google Group]: https://groups.google.com/forum/#!forum/opencoarrays/join
106106
107107
[Google Summer of Code]: https://www.google-melange.com
108108
[OpenCoarrays Google Group]: https://groups.google.com/forum/#!forum/opencoarrays)

STATUS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ The OpenCoarrays team offers contract development and support for making compile
131131
* `co_reduce` only supports arguments of intrinsic type.
132132
* No support for type finalization or allocatable components of derived-type coarrays
133133
passed to the collective subroutines (e.g., `co_sum`, `co_reduce`, etc.).
134+
* Optimization levels other than -O0 introduce correctness errors
135+
in the compiled binaries. A patch has been submitted by @afanfa
136+
to the GFortran team. See #28 for some more context.
134137
<a name="compiler-issues-intel">
135138
* **Intel** (ifort)</a>
136139
* Supported via the [opencoarrays module] only.

src/tests/integration/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
if (opencoarrays_aware_compiler)
22
add_subdirectory(coarrayHelloWorld)
3-
add_subdirectory(dist_transpose )
3+
if (NOT (DEFINED ENV{TRAVIS}))
4+
add_subdirectory(dist_transpose )
5+
endif()
46
add_subdirectory(pde_solvers)
57
endif()
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
set(include_directory ${CMAKE_CURRENT_SOURCE_DIR}/include-files)
22
set(library_directory ${CMAKE_CURRENT_SOURCE_DIR}/library)
3+
set(config_directory ${CMAKE_CURRENT_BINARY_DIR}/library)
34

45
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Cray")
5-
configure_file(${include_directory}/cray_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
6+
configure_file(${include_directory}/cray_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
67
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
7-
configure_file(${include_directory}/intel_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
8+
configure_file(${include_directory}/intel_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
89
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
9-
configure_file(${include_directory}/gfortran_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
10+
configure_file(${include_directory}/gfortran_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1011
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "VisualAge|XL")
11-
configure_file(${include_directory}/ibm_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
12+
configure_file(${include_directory}/ibm_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1213
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI")
13-
configure_file(${include_directory}/portlandgroup_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
14+
configure_file(${include_directory}/portlandgroup_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1415
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "NAG")
15-
configure_file(${include_directory}/nag_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
16+
configure_file(${include_directory}/nag_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1617
else()
1718
message ("Unknown Fortran compiler: ${CMAKE_Fortran_COMPILER_ID}")
1819
endif()
19-
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/compiler_capabilities.txt;${library_directory}/compiler_capabilities.txt")
2020

2121
add_executable(coarray_burgers_pde
2222
main.F90
@@ -27,3 +27,4 @@ add_executable(coarray_burgers_pde
2727
${library_directory}/co_object_interface.F90
2828
)
2929
target_link_libraries(coarray_burgers_pde OpenCoarrays)
30+
target_include_directories(coarray_burgers_pde PRIVATE ${config_directory})

src/tests/integration/pde_solvers/navier-stokes/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
44
# checking whether the machine is of type 64-bit before proceeding further
55
if ("${MACHINE_TYPE}" MATCHES "x86_64")
66
# Default to older SSE-instruction-based FFT library
7+
if (NOT (DEFINED ENV{TRAVIS}))
78
if (LEGACY_ARCHITECTURE OR (NOT DEFINED(LEGACY_ARCHITECTURE)))
89
set(fft_library ${CMAKE_CURRENT_SOURCE_DIR}/libfft_sse.a )
910
else()
@@ -16,6 +17,7 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
1617
)
1718
target_link_libraries(coarray_navier_stokes OpenCoarrays ${fft_library})
1819
endif()
20+
endif()
1921
else()
2022
# Skip Navier-Stokes build until an appropriate FFT has been found.
2123
endif()
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
set(include_directory ${CMAKE_CURRENT_SOURCE_DIR}/../../integration/pde_solvers/include-files)
22
set(library_directory ${CMAKE_CURRENT_SOURCE_DIR}/../../integration/pde_solvers/library)
3+
set(config_directory ${CMAKE_CURRENT_BINARY_DIR}/../../integration/pde_solvers/library)
34

45
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Cray")
5-
configure_file(${include_directory}/cray_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
6+
configure_file(${include_directory}/cray_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
67
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
7-
configure_file(${include_directory}/intel_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
8+
configure_file(${include_directory}/intel_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
89
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
9-
configure_file(${include_directory}/gfortran_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
10+
configure_file(${include_directory}/gfortran_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1011
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "VisualAge|XL")
11-
configure_file(${include_directory}/ibm_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
12+
configure_file(${include_directory}/ibm_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1213
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI")
13-
configure_file(${include_directory}/portlandgroup_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
14+
configure_file(${include_directory}/portlandgroup_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1415
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "NAG")
15-
configure_file(${include_directory}/nag_capabilities.txt ${library_directory}/compiler_capabilities.txt COPYONLY)
16+
configure_file(${include_directory}/nag_capabilities.txt ${config_directory}/compiler_capabilities.txt COPYONLY)
1617
else()
1718
message ("Unknown Fortran compiler: ${CMAKE_Fortran_COMPILER_ID}")
1819
endif()
19-
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${library_directory}/compiler_capabilities.txt")
2020

2121
add_executable( mpi_burgers_pde
2222
main.F90
@@ -30,3 +30,4 @@ add_executable( mpi_burgers_pde
3030
input_file.F90
3131
periodic_2nd_order.F90
3232
)
33+
target_include_directories(mpi_burgers_pde PRIVATE ${config_directory})

0 commit comments

Comments
 (0)