Skip to content

Commit 540dd3c

Browse files
committed
Test CMake script on macOS with clang & Open-MPI
1 parent ef12c37 commit 540dd3c

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ matrix:
2424
env:
2525
- BUILD_TYPE="InstallScript"
2626
GCC=6
27-
OSX_PACKAGES="gcc@6 shellcheck"
27+
OSX_PACKAGES="gcc@6 shellcheck cmake"
28+
# cmake should be removed, but we should be installing binaries
29+
# because building from source takes forever
30+
-
31+
<<: *macOS
32+
env:
33+
- BUILD_TYPE="cmake"
34+
GCC=6
35+
OSX_PACKAGES="gcc@6 shellcheck cmake"
36+
2837
- &ubuntu
2938
os: linux
3039
sudo: false

developer-scripts/travis/install.osx.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ done
3333
brew uninstall --force --ignore-dependencies openmpi || true
3434
brew uninstall --force --ignore-dependencies mpich || true
3535

36-
if [[ "${BUILD_TYPE:-}" == InstallScript ]]; then # uninstall some stuff if present
37-
brew uninstall --force --ignore-dependencies cmake || true
38-
fi
36+
# Building CMake from source is very slow. We should be using binaries instead
37+
# if [[ "${BUILD_TYPE:-}" == InstallScript ]]; then # uninstall some stuff if present
38+
# brew uninstall --force --ignore-dependencies cmake || true
39+
# fi
3940

4041
{
4142
mpif90 --version && mpif90 -show

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,33 @@ trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
2121

2222
echo "Performing Travis-CI script phase for the OpenCoarrays direct cmake build..."
2323

24-
mkdir cmake-build
25-
2624
for version in ${GCC}; do
25+
mkdir "cmake-build-gcc${GCC}"
26+
export BLD_DIR="cmake-build-gcc${GCC}"
2727
export FC=gfortran-${version}
2828
export CC=gcc-${version}
29-
${FC} --version
30-
${CC} --version
3129
if [[ ${OSTYPE} == [Dd]arwin* ]]; then
32-
# Ideally this stuff would be in the `install:` section
33-
# but puting it here simplifies the Travis code a lot
34-
MPICH_BOT_URL_HEAD=MPICH_GCC${version}_BOT_URL_HEAD
35-
brew uninstall --force --ignore-dependencies mpich || true
36-
echo "Downloading Custom MPICH bottle ${!MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL} ..."
37-
wget "${!MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}" > wget_mpichbottle.log 2>&1 || cat wget_mpichbottle.log
38-
brew install --force-bottle "${MPICH_BOT_URL_TAIL}"
39-
brew ls --versions mpich >/dev/null || brew install --force-bottle mpich
40-
rm "${MPICH_BOT_URL_TAIL}"
30+
# Use clang on macOS because that's what homebrew and everyone else does
31+
export CC=clang
32+
for mpi in "mpich" "open-mpi"; do
33+
brew unlink "${mpi}" || true
34+
brew ls --versions "${mpi}" >/dev/null || brew install "${mpi}"
35+
brew outdated "${mpi}" || brew upgrade "${mpi}"
36+
brew unlink "${mpi}"
37+
done
38+
brew link open-mpi
4139
fi
40+
${FC} --version
41+
${CC} --version
4242
mpif90 --version && mpif90 -show
4343
mpicc --version && mpicc -show
4444

4545
# shellcheck disable=SC2153
4646
for BUILD_TYPE in ${BUILD_TYPES}; do
47-
rm -rf cmake-build/* || true
47+
# shellcheck disable=SC2015
48+
[[ -d "${BLD_DIR}" ]] && rm -rf "${BLD_DIR:?}"/* || true
4849
(
49-
cd cmake-build
50+
cd "${BLD_DIR}"
5051
cmake -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ..
5152
make -j 4
5253
ctest --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}" --timeout "${TEST_TIMEOUT:-200}"

0 commit comments

Comments
 (0)