Skip to content

Commit 8fad466

Browse files
Merge pull request #269 from ax3l/topic-modernCMake3
Modern CMake3 Scripts
2 parents fe926d1 + d6d5592 commit 8fad466

13 files changed

Lines changed: 850 additions & 689 deletions

.travis.yml

Lines changed: 107 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,116 @@
11
language: cpp
22
sudo: required
3+
dist: trusty
34

4-
services:
5-
- docker
5+
cache:
6+
apt: true
7+
directories:
8+
- $HOME/.cache/spack
9+
pip: true
610

7-
compiler:
8-
- gcc
9-
- clang
11+
addons:
12+
apt:
13+
sources:
14+
- ubuntu-toolchain-r-test
15+
packages: &common_deps
16+
- gfortran
17+
- libcppunit-dev
1018

1119
env:
1220
global:
13-
- BUILD=~/buildTmp
14-
- SRC=$TRAVIS_BUILD_DIR
15-
matrix:
16-
- SPLASHPARALLEL=ON SPLASHMPI=ON
17-
- SPLASHPARALLEL=OFF SPLASHMPI=ON
18-
- SPLASHPARALLEL=OFF SPLASHMPI=OFF
21+
- BUILD: ~/buildTmp
22+
- CXXFLAGS: "-Wall -Wextra -Woverloaded-virtual -Wshadow"
23+
- SPACK_ROOT: $HOME/.cache/spack
24+
- PATH: $PATH:$HOME/.cache/spack/bin
25+
26+
matrix:
27+
include:
28+
# GCC 4.8.5
29+
- env:
30+
- SPLASHPARALLEL=ON SPLASHMPI=ON
31+
compiler: gcc
32+
addons: &mpi_deps
33+
apt:
34+
packages:
35+
- *common_deps
36+
- libopenmpi-dev
37+
- openmpi-bin
38+
- env:
39+
- SPLASHPARALLEL=OFF SPLASHMPI=ON
40+
compiler: gcc
41+
addons: *mpi_deps
42+
- env:
43+
- SPLASHPARALLEL=OFF SPLASHMPI=OFF
44+
compiler: gcc
45+
# Clang 5.0.0
46+
- env:
47+
- SPLASHPARALLEL=ON SPLASHMPI=ON
48+
compiler: clang
49+
addons: *mpi_deps
50+
- env:
51+
- SPLASHPARALLEL=OFF SPLASHMPI=ON
52+
compiler: clang
53+
addons: *mpi_deps
54+
55+
- env:
56+
- SPLASHPARALLEL=OFF SPLASHMPI=OFF
57+
compiler: clang
58+
59+
install:
60+
- SPACK_FOUND=$(which spack >/dev/null && { echo 0; } || { echo 1; })
61+
- if [ $SPACK_FOUND -ne 0 ]; then
62+
mkdir -p $SPACK_ROOT &&
63+
git clone --depth 50 https://github.com/spack/spack.git $SPACK_ROOT &&
64+
cp $TRAVIS_BUILD_DIR/.travis/spack/*.yaml
65+
$SPACK_ROOT/etc/spack/ &&
66+
spack bootstrap;
67+
fi
68+
- source /etc/profile &&
69+
source $SPACK_ROOT/share/spack/setup-env.sh
70+
- COMPILERSPEC="%$CC"
71+
- travis_wait spack install
72+
cmake@3.10.0~openssl~ncurses
73+
$COMPILERSPEC
74+
- spack load cmake@3.10.0 $COMPILERSPEC
75+
- if [ $SPLASHMPI == "ON" ]; then
76+
travis_wait spack install
77+
openmpi@1.6.5
78+
$COMPILERSPEC &&
79+
spack load openmpi@1.6.5 $COMPILERSPEC;
80+
fi
81+
- if [ $SPLASHPARALLEL == "ON" ]; then
82+
travis_wait spack install
83+
hdf5@1.8.12+mpi ^openmpi@1.6.5
84+
$COMPILERSPEC &&
85+
spack load hdf5@1.8.12+mpi ^openmpi@1.6.5 $COMPILERSPEC &&
86+
spack load zlib $COMPILERSPEC &&
87+
pip install urllib3[secure] --user &&
88+
pip install h5py --user;
89+
else
90+
travis_wait spack install
91+
hdf5@1.8.12~mpi
92+
$COMPILERSPEC &&
93+
spack load hdf5@1.8.12~mpi $COMPILERSPEC &&
94+
spack load zlib $COMPILERSPEC &&
95+
pip install urllib3[secure] --user &&
96+
pip install h5py --user;
97+
fi
98+
- spack clean -a
1999

20100
script:
21-
# compile libSplash and install
22-
- docker exec build /bin/bash -c "cd $BUILD && CXXFLAGS='-Werror' CXX=$CXX CC=$CC cmake -DCMAKE_BUILD_TYPE=Debug -DTOOLS_MPI=$SPLASHMPI $SRC"
23-
- docker exec build /bin/bash -c "cd $BUILD && make package"
24-
- docker exec build /bin/bash -c "cd $BUILD && dpkg -i libsplash*.deb"
25-
- docker exec build ls -hal /usr/share/pyshared/
26-
# compile examples/
27-
- docker exec build /bin/bash -c "cd $BUILD && rm -rf * && CXXFLAGS='-Werror' CXX=$CXX CC=$CC cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_MPI=$SPLASHMPI $SRC/examples"
28-
- docker exec build /bin/bash -c "cd $BUILD && make"
29-
# compile and run tests/
30-
- docker exec build /bin/bash -c "cd $BUILD && rm -rf * && CXXFLAGS='-Werror' CXX=$CXX CC=$CC cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_MPI=$SPLASHMPI $SRC/tests"
31-
- docker exec build /bin/bash -c "cd $BUILD && make"
32-
# run tests
33-
- docker exec build $SRC/tests/run_tests $BUILD
34-
- docker exec build $SRC/tests/run_parallel_tests $BUILD
35-
36-
before_script:
37-
- docker pull ubuntu:16.04
38-
- docker run -it -d --name build ubuntu bash
39-
- if [ "$SPLASHMPI" == "ON" ]; then export APTMPI="libopenmpi-dev openmpi-bin"; fi
40-
- if [ "$SPLASHPARALLEL" == "ON" ]; then export APTHDF5="libhdf5-openmpi-10 libhdf5-openmpi-dev"; else export APTHDF5="libhdf5-serial-dev"; fi
41-
- docker exec build apt-get update
42-
- docker exec build apt-get remove -qq libhdf5*
43-
- docker exec build apt-get remove -qq libopenmpi* openmpi-bin || { echo "OpenMPI not installed"; }
44-
- docker exec build apt-get install -qq -f libcppunit-dev clang cmake
45-
- docker exec build apt-get install -qq -f $APTMPI
46-
- docker exec build apt-get install -qq -f $APTHDF5
47-
- docker exec build apt-get install -qq -f python-numpy cython python-pip
48-
- docker exec build /bin/bash -c "HDF5_DIR=/usr C_INCLUDE_PATH=/usr/lib/openmpi/include pip install --user h5py"
49-
- docker exec build mkdir -p $BUILD $SRC
50-
- docker exec build python -c "import numpy; print(numpy.version.version)"
51-
- docker exec build python -c "import h5py; print(h5py.version.version)"
52-
- docker cp $SRC build:$SRC/..
53-
- docker exec build ls -al $SRC
101+
- mkdir -p $HOME/build
102+
- cd $HOME/build
103+
- CXXFLAGS=$CXXFLAGS CXX=$CXX CC=$CC
104+
cmake
105+
-DCMAKE_BUILD_TYPE=Debug
106+
-DSplash_USE_MPI=$SPLASHMPI
107+
-DSplash_USE_PARALLEL=$SPLASHPARALLEL
108+
-DSplash_HAVE_TESTS=ON
109+
-DCMAKE_INSTALL_PREFIX=$HOME/splash-test-install
110+
$TRAVIS_BUILD_DIR
111+
- make -j 2
112+
- CTEST_OUTPUT_ON_FAILURE=1 make test
113+
- make install
114+
- make package
115+
# - dpkg -i libsplash*.deb
116+

.travis/spack/compilers.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
compilers:
2+
- compiler:
3+
environment: {}
4+
extra_rpaths: []
5+
flags: {}
6+
modules: []
7+
operating_system: ubuntu14.04
8+
paths:
9+
cc: /usr/local/clang-5.0.0/bin/clang
10+
cxx: /usr/local/clang-5.0.0/bin/clang++
11+
f77: /usr/bin/gfortran-4.8
12+
fc: /usr/bin/gfortran-4.8
13+
spec: clang@5.0.0
14+
target: x86_64
15+
- compiler:
16+
environment: {}
17+
extra_rpaths: []
18+
flags: {}
19+
modules: []
20+
operating_system: ubuntu14.04
21+
paths:
22+
cc: /usr/bin/gcc-4.8
23+
cxx: /usr/bin/g++-4.8
24+
f77: /usr/bin/gfortran-4.8
25+
fc: /usr/bin/gfortran-4.8
26+
spec: gcc@4.8.5
27+
target: x86_64

.travis/spack/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
config:
2+
build_jobs: 2

.travis/spack/packages.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
packages:
2+
cmake:
3+
version: [3.10.0]
4+
openmpi:
5+
version: [1.6.5]
6+
paths:
7+
openmpi@1.6.5%gcc@4.8.5 arch=linux-ubuntu14-x86_64: /usr
8+
openmpi@1.6.5%clang@5.0.0 arch=linux-ubuntu14-x86_64: /usr
9+
buildable: False
10+
all:
11+
providers:
12+
mpi: [openmpi]

0 commit comments

Comments
 (0)