forked from cadet/CADET-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
127 lines (112 loc) · 3.83 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Exclude GitHub pages and AppVeyor branches
branches:
except:
- gh-pages
- /feature\/.*appveyor.*/
language: cpp
# Use Linux unless specified otherwise
os: linux
dist: bionic
git:
depth: 2
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps
matrix:
include:
# Clang on OSX
# XCode 11.3.1 on OS X 10.14 (clang 8)
- env: COMPILERCPP=clang++ COMPILERC=clang BUILD_TYPE=Release NTHREADS=2
os: osx
osx_image: xcode11.3
compiler: clang
# Clang on Linux
# Clang 7.0
- env: COMPILERCPP=clang++ COMPILERC=clang BUILD_TYPE=Release NTHREADS=2
addons:
apt:
packages:
- cmake
- libblas-dev
- liblapack-dev
- libhdf5-dev
- libsuitesparse-dev
- libsuperlu-dev
# GCC on Linux
# GCC 7.5.0
- env: COMPILERCPP=g++ COMPILERC=gcc BUILD_TYPE=Release NTHREADS=2
addons:
apt:
packages:
- cmake
- libblas-dev
- liblapack-dev
- libhdf5-dev
- libsuitesparse-dev
- libsuperlu-dev
before_install:
# Dependencies required by the CI are installed in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p "${DEPS_DIR}"
- cd "${DEPS_DIR}"
# OSX: Install packages
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew update
brew install cmake --without-docs || brew upgrade cmake
brew install hdf5 || brew upgrade hdf5
brew install tbb || brew upgrade tbb
brew install suite-sparse || brew upgrade suite-sparse
fi
- export CXX=${COMPILERCPP}
- export CC=${COMPILERC}
- ${CC} --version
- ${CXX} --version
# Travis machines have 2 cores
- JOBS=2
# Linux: Install a recent CMake
- CMAKE_VERSION=3.17.0
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
fi
- cmake --version
# Linux: Install TBB
- |
TBB_INSTALL=${DEPS_DIR}/tbb/install
TBB_VERSION="2020_U2"
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ ! -d "${DEPS_DIR}/tbb" || ! -d "${TBB_INSTALL}" ]]; then
TBB_URL="https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz"
mkdir -p tbb
travis_retry wget -O - ${TBB_URL} | tar --strip-components=1 -xz -C tbb
TBB_BUILD=${DEPS_DIR}/tbb/build
if [[ "${CXX%%+*}" == "clang" ]]; then
(cd tbb && make compiler=clang stdver=c++14 tbb_build_dir=${TBB_BUILD} -j${JOBS})
(cd tbb && make tbb_cpf=1 compiler=clang stdver=c++14 tbb_build_dir=${TBB_BUILD} -j${JOBS})
else
(cd tbb && make compiler=gcc stdver=c++14 tbb_build_dir=${TBB_BUILD} -j${JOBS})
(cd tbb && make tbb_cpf=1 compiler=gcc stdver=c++14 tbb_build_dir=${TBB_BUILD} -j${JOBS})
fi
mkdir -p ${TBB_INSTALL}/lib
mkdir -p ${TBB_INSTALL}/include
(cd tbb && cp -r include/tbb ${TBB_INSTALL}/include/)
find ${TBB_BUILD} -iname '*.so*' -exec cp {} ${TBB_INSTALL}/lib/ \;
mkdir -p ${TBB_INSTALL}/lib/intel64
ln -s ${TBB_INSTALL}/lib ${TBB_INSTALL}/lib/intel64/gcc4.4
fi
export TBB_ROOT="${TBB_INSTALL}"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${TBB_INSTALL}/lib"
export LIBRARY_PATH="${LIBRARY_PATH}:${TBB_INSTALL}/lib"
fi
before_script:
# Configure CMake
- cd "${TRAVIS_BUILD_DIR}"
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/install -DENABLE_CADET_MEX=OFF
script:
# Build and run tests
- make install -j${JOBS}
- test/testRunner -d yes --tbbthreads ${NTHREADS} [ci]