Skip to content

Commit 80cfbcd

Browse files
committed
Attempt to fix Travis-CI GCC9 + Clang + OMPI build
1 parent e903e6b commit 80cfbcd

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ script:
126126
- pwd
127127
- export SOURCE_DATE_EPOCH=$(git show -s --format=%ct $TRAVIS_COMMIT)
128128
- echo "SOURCE_DATE_EPOCH = ${SOURCE_DATE_EPOCH}"
129-
- ./developer-scripts/travis/test-script.${BUILD_TYPE:-cmake}.sh
129+
- travis_wait ./developer-scripts/travis/test-script.${BUILD_TYPE:-cmake}.sh
130130

131131
after_script:
132132
- find . -name '*.gcno' -print

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,9 @@ function(add_caf_test name num_caf_img test_target)
697697
endif()
698698
endif()
699699
if( openmpi)
700-
set (test_parameters ${test_parameters} --allow-run-as-root)
701-
message( STATUS "Open-MPI back end detected, passing --allow-run-as-root to allow tests to pass when run with sudo or as root." )
700+
if(NOT DEFINED ENV{TRAVIS})
701+
set (test_parameters ${test_parameters} --allow-run-as-root)
702+
endif()
702703
endif()
703704
set(test_parameters -np ${num_caf_img} ${test_parameters})
704705
if(DEFINED ARGN)

developer-scripts/travis/test-script.cmake.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ for version in ${GCC}; do
2727
export FC=gfortran-${version}
2828

2929
${FC} --version
30-
${CC:-} --version || true
30+
${CC:-cc} --version || true
3131
mpif90 --version && mpif90 -show
3232
mpicc --version && mpicc -show
3333

@@ -41,12 +41,13 @@ for version in ${GCC}; do
4141
-DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" \
4242
-DCMAKE_BUILD_TYPE:STRING="${BUILD_TYPE}" \
4343
..
44-
make -j 4
44+
${TRAVIS:+ travis_wait} make -j 4
45+
printf '\nDone compiling OpenCoarrays and tests!\n\n'
4546
CTEST_FLAGS=(--output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}" --timeout "${TEST_TIMEOUT:-200}")
4647
if [[ "${BUILD_TYPE}" =~ Deb ]]; then
47-
ctest "${CTEST_FLAGS[@]}" > "${BUILD_TYPE}.log" || cat "${BUILD_TYPE}.log"
48+
${TRAVIS:+ travis_wait} ctest "${CTEST_FLAGS[@]}" > "${BUILD_TYPE}.log" || cat "${BUILD_TYPE}.log"
4849
else
49-
ctest "${CTEST_FLAGS[@]}"
50+
${TRAVIS:+ travis_wait} ctest "${CTEST_FLAGS[@]}"
5051
fi
5152
make install
5253
make uninstall

src/mpi/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
116116
set ( openmpi true PARENT_SCOPE)
117117
# Write out a host file because OMPI's mpiexec is dumb
118118
file(WRITE ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
119+
message( STATUS "hostfile written to: ${CMAKE_BINARY_DIR}/hostfile")
120+
if(NOT DEFINED ENV{TRAVIS})
121+
message( STATUS "Open-MPI back end detected, passing --allow-run-as-root to allow tests to pass when run with sudo or as root." )
122+
endif()
119123
endif ()
120124

121125
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")

0 commit comments

Comments
 (0)