Skip to content

Commit d8d38e4

Browse files
committed
Merge branch 'Travis-and-install-fixes'
Fixes #101
2 parents 74a53b7 + 95746fd commit d8d38e4

File tree

12 files changed

+182
-105
lines changed

12 files changed

+182
-105
lines changed

.travis.yml

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,13 @@ env:
1313
- MPICH_GCC7_BOT_URL_HEAD="https://github.com/sourceryinstitute/OpenCoarrays/files/976779/"
1414
- MPICH_BOT_URL_TAIL="mpich-3.2_3.yosemite.bottle.1.tar.gz"
1515
- BUILD_TYPES="Release Debug RelWithDebInfo CodeCoverage"
16-
matrix: # shellcheck installed manually below for macOS
17-
- GCC=6 OSX_PACKAGES="gcc@6 cmake"
18-
- GCC=7 OSX_PACKAGES="gcc cmake"
16+
matrix:
17+
- GCC=6 OSX_PACKAGES="gcc@6 shellcheck" BUILD_TYPE="InstallScript"
18+
- GCC="6 7" OSX_PACKAGES="gcc gcc@6 cmake shellcheck" BUILD_TYPE="cmake"
1919

2020
matrix:
2121
fast_finish: true
2222
include:
23-
- os: osx
24-
env:
25-
- BUILD_TYPE="InstallScript"
26-
OSX_PACKAGES="gcc@6"
27-
GCC=6
2823
- &ubuntu
2924
os: linux
3025
sudo: false
@@ -44,8 +39,6 @@ matrix:
4439
- gcc-6
4540
- gfortran-6
4641
- g++-6
47-
- binutils
48-
- cmake-data
4942
- cmake
5043
-
5144
<<: *ubuntu
@@ -58,8 +51,6 @@ matrix:
5851
- gcc-7
5952
- gfortran-7
6053
- g++-7
61-
- binutils
62-
- cmake-data
6354
- cmake
6455
-
6556
<<: *ubuntu
@@ -87,37 +78,8 @@ matrix:
8778
- *linux_allowed_failure
8879

8980
before_install:
90-
- export FC=gfortran-${GCC}
91-
- export CC=gcc-${GCC}
92-
- export CXX=g++-${GCC}
93-
- export MPICH_BOT_URL_HEAD=MPICH_GCC${GCC}_BOT_URL_HEAD
94-
- |
95-
if [[ (-n ${TRAVIS_TAG}) && (${TRAVIS_OS_NAME} == osx) ]] && ${TRAVIS_SECURE_ENV_VARS} ; then
96-
brew update > /dev/null
97-
brew ls --versions gpg2 >/dev/null || brew install gpg2
98-
brew outdated gpg2 || brew upgrade gpg2
99-
type -P openssl || brew install openssl
100-
fi
101-
if ! [[ "${TRAVIS_TAG}" ]] || ! ${TRAVIS_SECURE_ENV_VARS} ; then
102-
unset encrypted_ef4535c39461_key || true
103-
unset encrypted_ef4535c39461_iv || true
104-
rm subkey-328B3A0E-secret.asc{,.enc} || true
105-
106-
fi
107-
if [[ "${TRAVIS_TAG}" ]] ; then
108-
curl https://izaakbeekman.com/izaak.pubkey.txt | gpg --import
109-
git tag -v ${TRAVIS_TAG}
110-
fi
111-
- |
112-
if [[ (-n ${TRAVIS}) && (${TRAVIS_OS_NAME} == osx) ]]; then
113-
export PATH="${PATH}:${HOME}/Library/Python/2.7/bin"
114-
else
115-
[[ -d "${CACHE}/bin" ]] || mkdir -p "${CACHE}/bin"
116-
export PATH="${CACHE}/bin:${PATH}"
117-
${FC} --version
118-
${CC} --version
119-
${CXX} --version
120-
fi
81+
- source developer-scripts/travis/before_install.all.sh
82+
- developer-scripts/travis/before_install.${TRAVIS_OS_NAME}.sh
12183

12284
install:
12385
- pwd
@@ -129,8 +91,7 @@ script:
12991

13092
after_script:
13193
- find . -name '*.gcno' -print
132-
- gcov-${GCC} --version
133-
- bash <(curl -s https://codecov.io/bash) -x $(type -P gcov-${GCC})
94+
- for version in ${GCC}; do bash <(curl -s https://codecov.io/bash) -x $(type -P gcov-${GCC}) ; done
13495
- |
13596
if [[ "${TRAVIS_TAG}" ]]; then
13697
if [[ "v${TRAVIS_TAG}" != "v$(sed -n '/[0-9]\{1,\}\(\.[0-9]\{1,\}\)\{1,\}/{s/^\([^.]*\)\([0-9]\{1,\}\(\.[0-9]\{1,\}\)\{1,\}\)\(.*\)/\2/p;q;}' .VERSION)" ]]; then

CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,16 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
584584
#---------------------------------------------------------------------------------------
585585

586586
# Determine if we're using Open MPI
587+
cmake_host_system_information(RESULT N_CPU QUERY NUMBER_OF_LOGICAL_CORES)
588+
cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME)
587589
execute_process(COMMAND ${MPIEXEC} --version
588590
OUTPUT_VARIABLE mpi_version_out)
589591
if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
590592
message( STATUS "OpenMPI detected")
591593
set ( openmpi true )
594+
# Write out a host file because OMPI's mpiexec is dumb
595+
file(APPEND ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
592596
endif ()
593-
594-
include( ProcessorCount )
595-
ProcessorCount(N_CPU)
596597
function(add_caf_test name num_caf_img test_target)
597598
# Function to add MPI tests.
598599
if(TARGET ${test_target})
@@ -605,6 +606,10 @@ function(add_caf_test name num_caf_img test_target)
605606
message( FATAL_ERROR "Test ${name} requires ${min_test_imgs} but was only given ${num_caf_images}" )
606607
endif()
607608
endif()
609+
# Add a host file for OMPI
610+
if ( openmpi )
611+
set(test_parameters --hostfile ${CMAKE_BINARY_DIR}/hostfile)
612+
endif()
608613
if ( ((N_CPU LESS num_caf_img) OR (N_CPU EQUAL 0)) )
609614
message(STATUS "Test ${name} is oversubscribed: ${num_caf_img} CAF images requested with ${N_CPU} system processor available.")
610615
if ( openmpi )
@@ -613,7 +618,7 @@ function(add_caf_test name num_caf_img test_target)
613618
elseif ( N_CPU LESS 2 )
614619
set( num_caf_img 2 )
615620
endif()
616-
set (test_parameters --oversubscribe)
621+
set (test_parameters ${test_parameters} --oversubscribe)
617622
message( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name}, with ${num_caf_img} ranks/images." )
618623
endif()
619624
endif()
@@ -762,8 +767,8 @@ if(opencoarrays_aware_compiler)
762767

763768
# IMAGE FAIL tests
764769
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
765-
add_caf_test(image_status_test_1 4 image_status_test_1)
766770
if(CAF_ENABLE_FAILED_IMAGES)
771+
add_caf_test(image_status_test_1 4 image_status_test_1)
767772
if ((NOT DEFINED ENV{TRAVIS}) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
768773
add_caf_test(image_fail_test_1 4 image_fail_test_1)
769774
set_property(TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed.")

INSTALL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ file.
489489
[MVAPICH]:http://mvapich.cse.ohio-state.edu
490490
[MacPorts]: https://www.macports.org
491491
[GCC]: http://gcc.gnu.org
492-
[TS18508 Additional Parallel Features in Fortran]: http://isotc.iso.org/livelink/livelink/nfetch/-8919044/8919782/8919787/17001078/ISO%2DIECJTC1%2DSC22%2DWG5_N2056_Draft_TS_18508_Additional_Paralle.pdf?nodeid=17181227&vernum=0
492+
[TS18508 Additional Parallel Features in Fortran]: https://isotc.iso.org/livelink/livelink/nfetch/-8919044/8919782/8919787/17001078/ISO%2DIECJTC1%2DSC22%2DWG5_N2056_Draft_TS_18508_Additional_Paralle.pdf?nodeid=17181227&vernum=0
493493
[GFortran Binaries]: https://gcc.gnu.org/wiki/GFortranBinaries#FromSource
494494
[Installing GCC]: https://gcc.gnu.org/install/
495495
[Arch Linux]: https://www.archlinux.org
@@ -499,10 +499,10 @@ file.
499499
[commit comment 20539810]: https://github.com/sourceryinstitute/OpenCoarrays/commit/26e99919fe732576f7277a0e1b83f43cc7c9d749#commitcomment-20539810
500500
[Homebrew]: https://brew.sh
501501
[dnf]: https://github.com/rpm-software-management/dnf
502-
[port details]: http://www.freshports.org/lang/opencoarrays
502+
[port details]: https://www.freshports.org/lang/opencoarrays
503503
[port search]: https://www.freebsd.org/cgi/ports.cgi?query=opencoarrays
504504
[EasyBuild]: https://github.com/easybuilders/easybuild
505-
[Spack]: https://github.com/LLNL/spack
505+
[Spack]: https://github.com/spack/spack
506506
[add a new compiler to Spack]: http://spack.readthedocs.io/en/latest/tutorial_modules.html#add-a-new-compiler
507507
[loading the environment modules with Spack]: http://spack.readthedocs.io/en/latest/module_file_support.html#cmd-spack-module-loads
508508
[OpenCoarrays Portfile]: https://www.macports.org/ports.php?by=name&substr=opencoarrays
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
if ! [[ "${TRAVIS_TAG}" ]] || ! ${TRAVIS_SECURE_ENV_VARS} ; then
3+
unset encrypted_ef4535c39461_key || true
4+
unset encrypted_ef4535c39461_iv || true
5+
rm subkey-328B3A0E-secret.asc{,.enc} || true
6+
else
7+
echo "Encrypted vars not unset"
8+
fi
9+
if [[ "${OSTYPE}" == [Dd]arwin* ]]; then
10+
export PATH="${PATH}:${HOME}/Library/Python/2.7/bin"
11+
else
12+
export PATH="${CACHE}/bin:${PATH}"
13+
export FC=gfortran-${GCC}
14+
export CC=gcc-${GCC}
15+
export CXX=g++-${GCC}
16+
fi
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o verbose
5+
set -o pipefail
6+
set -o nounset
7+
set -o errtrace
8+
9+
__file=developer-scripts/travis/install.linux.sh
10+
11+
# Error tracing
12+
# requires `set -o errtrace`
13+
__caf_err_report() {
14+
error_code=${?}
15+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
16+
false
17+
return ${error_code}
18+
}
19+
# Always provide an error backtrace
20+
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
21+
22+
[[ -d "${CACHE}/bin" ]] || mkdir -p "${CACHE}/bin"
23+
${FC} --version
24+
${CC} --version
25+
${CXX} --version
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o verbose
5+
set -o pipefail
6+
set -o nounset
7+
set -o errtrace
8+
9+
__file=developer-scripts/travis/install.linux.sh
10+
11+
# Error tracing
12+
# requires `set -o errtrace`
13+
__caf_err_report() {
14+
error_code=${?}
15+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
16+
false
17+
return ${error_code}
18+
}
19+
# Always provide an error backtrace
20+
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
21+
22+
if [[ -n "${TRAVIS_TAG}" ]] && ${TRAVIS_SECURE_ENV_VARS} ; then
23+
brew update > /dev/null
24+
brew ls --versions gpg2 >/dev/null || brew install gpg2
25+
brew outdated gpg2 || brew upgrade gpg2
26+
type -P openssl || brew install openssl
27+
curl https://izaakbeekman.com/izaak.pubkey.txt | gpg --import
28+
git tag -v "${TRAVIS_TAG}"
29+
fi
30+
gfortran --version || true
31+
gcc --version || true
32+
g++ --version || true

developer-scripts/travis/install.linux.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ __file=developer-scripts/travis/install.linux.sh
1111
# Error tracing
1212
# requires `set -o errtrace`
1313
__caf_err_report() {
14-
local error_code
15-
error_code=${?}
16-
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
17-
false
18-
return ${error_code}
14+
error_code=${?}
15+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
16+
false
17+
return ${error_code}
1918
}
2019
# Always provide an error backtrace
2120
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
@@ -28,6 +27,8 @@ if [[ "${BUILD_TYPE:-}" != InstallScript ]]; then # Ubuntu on Travis-CI, NOT tes
2827
# could use prerequisites/build instead...
2928
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
3029
tar -xzvf "${MPICH_URL_TAIL}"
30+
export CC=gcc-${GCC}
31+
export FC=gfortran-${GCC}
3132
(
3233
cd "${MPICH_URL_TAIL%.tar.gz}"
3334
./configure --prefix="${CACHE}"

developer-scripts/travis/install.osx.sh

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ __file=developer-scripts/travis/install.osx.sh
1111
# Error tracing
1212
# requires `set -o errtrace`
1313
__caf_err_report() {
14-
local error_code
15-
error_code=${?}
16-
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
17-
false
18-
return ${error_code}
14+
error_code=${?}
15+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
16+
false
17+
return ${error_code}
1918
}
2019
# Always provide an error backtrace
2120
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
@@ -25,20 +24,17 @@ echo "Performing Travis-CI installation phase on macOS..."
2524
# Update and install via Homebrew on macOS
2625
brew update > /dev/null
2726

28-
brew ls --versions shellcheck >/dev/null || brew install --force-bottle shellcheck
29-
brew outdated shellcheck || brew upgrade --force-bottle shellcheck
3027
for pkg in ${OSX_PACKAGES}; do
31-
brew ls --versions "${pkg}" >/dev/null || brew install "${pkg}" || brew link --overwrite "${pkg}"
32-
brew outdated "${pkg}" || brew upgrade "${pkg}"
28+
brew ls --versions "${pkg}" >/dev/null || brew install --force-bottle "${pkg}" || brew link --overwrite "${pkg}"
29+
brew outdated "${pkg}" || brew upgrade --force-bottle "${pkg}"
3330
done
31+
32+
# Uninstall mpich and openmpi so that we can install our own version
33+
brew uninstall --force --ignore-dependencies openmpi || true
34+
brew uninstall --force --ignore-dependencies mpich || true
35+
3436
if [[ "${BUILD_TYPE:-}" == InstallScript ]]; then # uninstall some stuff if present
3537
brew uninstall --force --ignore-dependencies cmake || true
36-
brew uninstall --force --ignore-dependencies mpich || true
37-
brew uninstall --force --ignore-dependencies openmpi || true
38-
else
39-
wget "${!MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}"
40-
brew install --force-bottle "${MPICH_BOT_URL_TAIL}"
41-
brew ls --versions mpich >/dev/null || brew install --force-bottle mpich
4238
fi
4339

4440
{

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

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,38 @@ __file=developer-scripts/travis/test-script.InstallScript.sh
1111
# Error tracing
1212
# requires `set -o errtrace`
1313
__caf_err_report() {
14-
local error_code
15-
error_code=${?}
16-
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
17-
false
18-
return ${error_code}
14+
error_code=${?}
15+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
16+
false
17+
return ${error_code}
1918
}
2019
# Always provide an error backtrace
2120
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
2221

2322
echo "Performing Travis-CI script phase for the OpenCoarrays installation script..."
24-
23+
export FC=gfortran-${GCC}
24+
export CC=gcc-${GCC}
25+
export CXX=g++-${GCC}
2526
./install.sh --yes-to-all -i "${HOME}/opencoarrays" -j 4 -f "$(type -P "${FC}")" -c "$(type -P "${CC}")" -C "$(type -P "${CXX}")"
26-
CTEST_LOC=(prerequisites/installations/cmake/*/bin/ctest)
27-
INSTALLER_CTEST="${CTEST_LOC[${#CTEST_LOC[@]}-1]}"
28-
if [[ -x "${INSTALLER_CTEST}" ]] ;then
29-
"${INSTALLER_CTEST}" --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
27+
BUILD_LOC=(prerequisites/builds/opencoarrays/*/)
28+
BUILD_LOC_DIR="${BUILD_LOC[${#BUILD_LOC[@]}-1]}"
29+
if [[ -d "${BUILD_LOC_DIR}" ]]; then
30+
echo "Found opencoarrays build directory created by the install script:"
31+
echo " ${BUILD_LOC_DIR}"
32+
(
33+
cd "${BUILD_LOC[${#BUILD_LOC[@]}-1]}"
34+
CTEST_LOC=(../../../installations/cmake/*/bin/ctest)
35+
INSTALLER_CTEST="${CTEST_LOC[${#CTEST_LOC[@]}-1]}"
36+
if [[ -x "${INSTALLER_CTEST}" ]] ;then
37+
"${INSTALLER_CTEST}" --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
38+
else
39+
ctest --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
40+
fi
41+
)
3042
else
31-
ctest --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
43+
echo "Failed to find install.sh build directory. Contents of prerequisites/builds is:"
44+
ls prerequisites/builds/*/
45+
exit 5
3246
fi
3347

3448
echo "Done."

0 commit comments

Comments
 (0)