Skip to content

Commit 3c7a741

Browse files
committed
Merge branch 'update-travis' of github.com:sourceryinstitute/OpenCoarrays
2 parents cf84092 + 3743ceb commit 3c7a741

File tree

10 files changed

+90
-132
lines changed

10 files changed

+90
-132
lines changed

.travis.yml

Lines changed: 48 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,67 @@
11
---
2-
language: c
2+
language: minimal
33

44
os: osx
55

66
env:
77
global:
8-
# - ZERO_AR_DATE=1
8+
- ZERO_AR_DATE=1
99
- TZ=UTC
1010
- CACHE="${HOME}/.local"
11-
- MPICH_VER="3.2.1"
11+
- MPICH_VER="3.3"
1212
- MPICH_URL_HEAD="https://www.mpich.org/static/downloads/${MPICH_VER}"
1313
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
14-
- MPICH_GCC6_BOT_URL_HEAD="https://github.com/sourceryinstitute/OpenCoarrays/files/1956499/"
15-
- MPICH_GCC7_BOT_URL_HEAD="https://github.com/sourceryinstitute/OpenCoarrays/files/1956441/"
16-
- MPICH_BOT_URL_TAIL="mpich-3.2.1_1.high_sierra.bottle.1.tar.gz"
1714
- BUILD_TYPES="Debug RelWithDebInfo Release CodeCoverage"
1815
- PATH="${HOME}/.local/bin:$PATH"
19-
# matrix:
20-
# - GCC="6 7" OSX_PACKAGES="gcc@7 gcc@6 cmake shellcheck" BUILD_TYPE="cmake"
2116

2217
matrix:
2318
fast_finish: true
2419
include:
2520
- &macOS
2621
os: osx
22+
osx_image: xcode10.2
2723
env:
2824
- BUILD_TYPE="InstallScript"
2925
GCC=9
30-
OSX_PACKAGES="gcc shellcheck cmake mpich"
31-
# cmake should be removed, but we should be installing binaries
32-
# because building from source takes forever
33-
# -
34-
# <<: *macOS
35-
# env:
36-
# - GCC=8
37-
# BUILD_TYPES="debug RelWithDebInfo Release"
38-
# OSX_PACKAGES="gcc openmpi shellcheck cmake"
26+
CC=gcc-9
27+
CXX=g++-9
28+
FC=gfortran-9
29+
addons:
30+
homebrew:
31+
packages:
32+
- gcc
33+
- mpich
34+
- shellcheck
35+
update: true
36+
- &macOS_allowed_failure
37+
<<: *macOS
38+
env:
39+
- GCC=9
40+
FC=gfortran-${GCC}
41+
BUILD_TYPES="Release CodeCoverage"
42+
addons:
43+
homebrew:
44+
packages:
45+
- cmake
46+
- gcc
47+
- openmpi
48+
- shellcheck
49+
update: true
50+
-
51+
<<: *macOS
52+
env:
53+
- GCC=9
54+
FC=gcc-${GCC}
55+
CC=gcc-${GCC}
56+
CXX=g++-${GCC}
57+
addons:
58+
homebrew:
59+
brewfile: true
60+
update: true
3961
- &ubuntu
4062
os: linux
4163
sudo: false
42-
dist: trusty
64+
dist: xenial
4365
env:
4466
- GCC=8
4567
cache:
@@ -50,7 +72,8 @@ matrix:
5072
apt:
5173
sources: &linuxsrcs
5274
- ubuntu-toolchain-r-test
53-
- george-edison55-precise-backports
75+
- sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main'
76+
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
5477
packages: &gcc8pkgs
5578
- gcc-8
5679
- gfortran-8
@@ -92,11 +115,12 @@ matrix:
92115

93116
allow_failures:
94117
- *linux_allowed_failure
95-
- osx
118+
- *macOS_allowed_failure
119+
120+
# macOS allowed failure due to random test timeouts w/ clang & OpenMPI
96121

97122
before_install:
98123
- source developer-scripts/travis/before_install.all.sh
99-
- developer-scripts/travis/before_install.${TRAVIS_OS_NAME}.sh
100124

101125
install:
102126
- pwd
@@ -105,6 +129,9 @@ install:
105129
script:
106130
- pwd
107131
- export SOURCE_DATE_EPOCH=$(git show -s --format=%ct $TRAVIS_COMMIT)
132+
- export LC_ALL=C
133+
- export TZ=UTC
134+
- export ZERO_AR_DATE=1
108135
- echo "SOURCE_DATE_EPOCH = ${SOURCE_DATE_EPOCH}"
109136
- ./developer-scripts/travis/test-script.${BUILD_TYPE:-cmake}.sh
110137

@@ -113,56 +140,6 @@ after_script:
113140
- for version in ${GCC}; do bash <(curl -s https://codecov.io/bash) -x $(type -P gcov-${GCC}) >> coverage.log 2>> coverage.err || true ; done
114141
- tail coverage.log || true
115142
- tail coverage.err || true
116-
- |
117-
if [[ "${TRAVIS_TAG}" ]]; then
118-
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
119-
echo "ERROR: You are trying to tag a new release but have a version missmatch in \`.VERSION\`"
120-
false # throw an error
121-
fi
122-
fi
123-
124-
# before_deploy:
125-
# - git archive -v --prefix "OpenCoarrays-${TRAVIS_TAG}/" -o "OpenCoarrays-${TRAVIS_TAG}.tar.gz" ${TRAVIS_TAG}
126-
# - |
127-
# echo '# To verify cryptographic checksums `shasum -c opencoarrays-'"${TRAVIS_TAG}"'-SHA256.txt` on Mac OS X,' > "opencoarrays-${TRAVIS_TAG}-SHA256.txt
128-
# echo '# `sha256sum -c opencoarrays-'"${TRAVIS_TAG}"'-SHA256.txt` on Linux.' >> "opencoarrays-${TRAVIS_TAG}-SHA256.txt
129-
# if [[ $(uname -s) == Darwin ]]; then
130-
# shasum -a 256 "OpenCoarrays-${TRAVIS_TAG}.tar.gz" >> "opencoarrays-${TRAVIS_TAG}-SHA256.txt
131-
# else
132-
# sha256sum "OpenCoarrays-${TRAVIS_TAG}.tar.gz" >> "opencoarrays-${TRAVIS_TAG}-SHA256.txt
133-
# fi
134-
# - |
135-
# openssl aes-256-cbc -K ${encrypted_ef4535c39461_key} -iv ${encrypted_ef4535c39461_iv} -in subkey-328B3A0E-secret.asc.enc -out ./subkey-328B3A0E-secret.asc -d
136-
# gpg --allow-secret-key-import --import ./subkey-328B3A0E-secret.asc && rm subkey-328B3A0E-secret.asc
137-
# rm subkey-328B3A0E-secret.* || true
138-
# unset encrypted_ef4535c39461_key || true
139-
# unset encrypted_ef4535c39461_iv || true
140-
# gpg --armor --detach-sign -u 328B3A0E --comment 'Mac users can use GPGTools - https://gpgtools.org' \
141-
# --comment "Download Izaak Beekman's GPG public key from your" \
142-
# --comment 'trusted key server or from' \
143-
# --comment 'https://izaakbeekman.com/izaak.pubkey.txt' \
144-
# --comment 'Next add it to your GPG keyring, e.g.,' \
145-
# --comment '`curl https://izaakbeekman.com/izaak.pubkey.txt | gpg --import`' \
146-
# --comment "Make sure you have verified that the release archive's" \
147-
# --comment 'SHA256 checksum matches the provided' \
148-
# --comment "opencoarrays-${TRAVIS_TAG}-SHA256.txt and ensure that this file" \
149-
# --comment "and it's signature are in the same directory. Then" \
150-
# --comment 'verify with:' \
151-
# --comment '`gpg --verify opencoarrays-'"${TRAVIS_TAG}"'-SHA256.txt.asc`' \
152-
# "opencoarrays-${TRAVIS_TAG}-SHA256.txt"
153-
154-
# deploy:
155-
# provider: releases
156-
# api_key:
157-
# secure: lBj4VgKhU74xfzPc0CDIji6cFrN/xEQIHLHjMcnDPWEF5JQe79aunMS5qiYu5ttve6khGI1WMFEe7clUO3TXiDUPyRMS4M8B2q3fuvUIsIbYgWcKq7ut+x6+dEQDj4DE3yWpPb8IDugWFp4vno1eQ2Rid1yr6Vn+rjnbE2i6z5SkXPnIv1ziQ9G+TF4ChUA8IOd1T78gJmML86P0rbt6nW8eVuJbza2y1ggHAY//q/b6rrbOFw5PqiOBqZ/BRrKJ5d2U2mvsoZtNn4OYyXw4eKEvNDIydwaIZROXfPRmN9zJ5G7+01QA5jlXpq17KfPBr7MXkn7nrQ5q9Z2ji4hRHk/AFzM/etfl1k4WCshYs13NlORpnU0vZtCMmmmsXWxj2kpsOHLWZQKdUAPs3olMPIG6aVnO5Abk1vrVSNy/ZeknbBTKCGScET1qRSaj6d43ynBwGkqHgaJdLBAwGe0Dpap6SsLGsAg56ZqHTngGlXB1KsbJKMkUsSC5RAgEuh9m55nsMaRlTYTrv+YADAQts7lV8yMCciMeJlrd3EYryyn4ZY1O82eOofhZZ5vQUktbXHtg6YnzguFwQyn+9yY/CQfi/vu2Aoq79NJEO/9UJ82ogn6gOoIebzb0xgIONjw4M68luR2U1CXtibzSYKWLGTeOj43khqZdbOpp6xncIv0=
158-
# file:
159-
# - "OpenCoarrays-${TRAVIS_TAG}.tar.gz"
160-
# - "opencoarrays-${TRAVIS_TAG}-SHA256.txt"
161-
# - "opencoarrays-${TRAVIS_TAG}-SHA256.txt.asc"
162-
# skip_cleanup: true
163-
# on:
164-
# tags: true
165-
# repo: sourceryinstitute/opencoarrays
166143

167144
notifications:
168145
webhooks:

Brewfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
# Brewfile to install OpenCoarrays prerequisites with [Homebrew] or [Linuxbrew].
1+
# Brewfile to install OpenCoarrays prerequisites with [Homebrew].
22
#
33
# TL;DR: `brew tap homebrew/bundle && brew bundle` to install prerequisites
44
#
55
# Homebrew for Mac OS X can be installed via:
66
# `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
7-
# Linux brew (lives in userland, no sudo required) can be installed with:
8-
# `ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"`
7+
# Homebrew for Linux (lives in userland, no sudo required) can be installed with:
8+
# `sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"`
99
#
1010
# Once Homebrew/Linuxbrew is installed, execute the following commands to install the required prerequisites:
1111
# `brew tap homebrew/bundle && brew bundle`
1212
#
1313

1414
brew 'cmake'
1515
brew 'gcc'
16-
brew 'mpich', args: ['cc=gcc-8', 'build-from-source']
17-
brew 'opencoarrays', args: ['cc=gcc-8', 'build-from-source']
16+
brew 'mpich' #, args: ['cc=gcc-9', 'build-from-source', 'verbose']
17+
# brew 'opencoarrays', args: ['cc=gcc-9', 'build-from-source', 'verbose']
1818

1919
# [Homebrew]: http://brew.sh
20-
# [Linuxbrew]: http://linuxbrew.sh

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)

cmake/InstallFileManifest.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# This script will create and install an install manifest, including SHA256 hashes of each installed file
23
# Variables passed from CMake must be set with `install(CODE "set(...)")`
34

@@ -6,7 +7,7 @@ message(STATUS "Generating SHA256 checksumed receipt for all installed assets")
67
# Set receipt install destination
78
set(RECEIPT_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}")
89

9-
# Mimic cmake_install.cmake's handlin of components
10+
# Mimic cmake_install.cmake's handling of components
1011
if(CMAKE_INSTALL_COMPONENT)
1112
set(HASHED_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.SHA256.txt")
1213
else()
@@ -16,10 +17,15 @@ endif()
1617
# Clean out any old install manifest on re-installation, if it exists
1718
file(REMOVE "${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}")
1819

20+
if(DEFINED ENV{DESTDIR})
21+
get_filename_component(ABS_DESTDIR "$ENV{DESTDIR}" ABSOLUTE)
22+
else()
23+
set(ABS_DESTDIR "")
24+
endif()
1925
# Loop over files computing hashes
2026
foreach(file IN LISTS CMAKE_INSTALL_MANIFEST_FILES)
21-
file(SHA256 "${file}" _file_sha256)
22-
file(RELATIVE_PATH FILE_REL_PATH "${RECEIPT_INSTALL_DIR}" "${file}")
27+
file(SHA256 "$ENV{DESTDIR}${file}" _file_sha256)
28+
file(RELATIVE_PATH FILE_REL_PATH "${ABS_DESTDIR}${RECEIPT_INSTALL_DIR}" "${ABS_DESTDIR}${file}")
2329
file(APPEND "${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}" "${_file_sha256} ${FILE_REL_PATH}\n")
2430
endforeach()
2531
file(APPEND "${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}"

developer-scripts/travis/install.osx.sh

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,7 @@ echo "Performing Travis-CI installation phase on macOS..."
2424
# Update and install via Homebrew on macOS
2525
brew update > /dev/null
2626

27-
brew install gcc || true
28-
brew link --overwrite gcc || true
29-
30-
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}"
33-
done
34-
35-
# Uninstall mpich and openmpi so that we can install our own version
36-
#brew uninstall --force --ignore-dependencies openmpi || true
37-
#brew uninstall --force --ignore-dependencies mpich || true
38-
39-
# Building CMake from source is very slow. We should be using binaries instead
40-
# if [[ "${BUILD_TYPE:-}" == InstallScript ]]; then # uninstall some stuff if present
41-
# brew uninstall --force --ignore-dependencies cmake || true
42-
# fi
27+
brew outdated
4328

4429
{
4530
mpif90 --version && mpif90 -show
@@ -51,4 +36,12 @@ done
5136
type -a cmake || echo "CMake not installed"
5237
cmake --version || true
5338

39+
echo "CC: ${CC:-none defined}"
40+
echo "\$CC --version:"
41+
${CC:-} --version || true
42+
43+
echo "FC: ${FC:-none-defined}"
44+
echo "\$FC --version:"
45+
${FC:-} --version || true
46+
5447
echo "Done."

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

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,9 @@ for version in ${GCC}; do
2525
mkdir "cmake-build-gcc${GCC}"
2626
export BLD_DIR="cmake-build-gcc${GCC}"
2727
export FC=gfortran-${version}
28-
export CC=gcc-${version}
29-
if [[ ${OSTYPE} == [Dd]arwin* ]]; then
30-
# We should use clang on macOS because that's what homebrew and everyone else does
31-
brew unlink openmpi || true
32-
brew unlink mpich || true
33-
for mpi in "mpich" "open-mpi"; do
34-
brew unlink "${mpi}" || true
35-
brew ls --versions "${mpi}" >/dev/null || brew install "${mpi}"
36-
brew outdated "${mpi}" || brew upgrade "${mpi}"
37-
brew unlink "${mpi}" || true
38-
done
39-
brew link --overwrite open-mpi
40-
otool -L "$(brew --prefix open-mpi)/lib/libmpi.dylib"
41-
otool -L "$(brew --prefix libevent)/lib/libevent.dylib"
42-
OMPI_CC="$(brew --prefix gcc)/bin/gcc-${version}"
43-
export OMPI_CC
44-
fi
28+
4529
${FC} --version
46-
${CC} --version
30+
${CC:-cc} --version || true
4731
mpif90 --version && mpif90 -show
4832
mpicc --version && mpicc -show
4933

@@ -56,19 +40,18 @@ for version in ${GCC}; do
5640
cmake -Wdev \
5741
-DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" \
5842
-DCMAKE_BUILD_TYPE:STRING="${BUILD_TYPE}" \
59-
-DMPI_CXX_SKIP_MPICXX:BOOL=ON \
60-
-DMPI_ASSUME_NO_BUILTIN_MPI:BOOL=ON \
61-
-DMPI_SKIP_GUESSING:BOOL=ON\
6243
..
6344
make -j 4
45+
printf '\nDone compiling OpenCoarrays and tests!\n'
6446
CTEST_FLAGS=(--output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}" --timeout "${TEST_TIMEOUT:-200}")
47+
printf "\nctest flags: %s\n" "${CTEST_FLAGS[*]}"
6548
if [[ "${BUILD_TYPE}" =~ Deb ]]; then
66-
ctest "${CTEST_FLAGS[@]}" > "${BUILD_TYPE}.log" || cat "${BUILD_TYPE}.log"
49+
printf "\nRunning ctest for a debug build...\n\n"
50+
export NREPEAT=1
6751
else
68-
ctest "${CTEST_FLAGS[@]}"
52+
printf "\nRunning ctest for a non-debug build...\n\n"
6953
fi
70-
make install
71-
make hash_installed
54+
ctest "${CTEST_FLAGS[@]}"
7255
make install
7356
make uninstall
7457
)

src/iso-fortran-binding/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,10 @@ set_target_properties( ISO_Fortran_binding_static
2828

2929
install(DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" FILES_MATCHING PATTERN "*.h")
3030

31-
install( TARGETS ISO_Fortran_binding
31+
install( TARGETS ISO_Fortran_binding ISO_Fortran_binding_static
3232
EXPORT OpenCoarraysTargets
33-
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
34-
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
35-
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
36-
)
37-
install( TARGETS ISO_Fortran_binding_static
38-
EXPORT OpenCoarraysTargets
39-
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
33+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
34+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
4035
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
4136
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
4237
)

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")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
add_executable( ISO_Fortran_binding_tests ISO_Fortran_binding_tests.c )
2-
target_link_libraries( ISO_Fortran_binding_tests ISO_Fortran_binding )
2+
target_link_libraries( ISO_Fortran_binding_tests ISO_Fortran_binding_static )

subkey-328B3A0E-secret.asc.enc

-6.56 KB
Binary file not shown.

0 commit comments

Comments
 (0)