forked from BlueBrain/CoreNeuron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
157 lines (152 loc) · 4.77 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#=============================================================================
# Travis CoreNeuron settings
#=============================================================================
#=============================================================================
# Environment
#=============================================================================
language: cpp
#=============================================================================
# Build matrix
#=============================================================================
matrix:
fast_finish: true
include:
- os: linux
dist: xenial
env:
- cmake_option="-DCORENRN_ENABLE_MPI=ON"
- os: linux
dist: xenial
env:
- cmake_option="-DCORENRN_ENABLE_MPI=OFF"
- os: linux
dist: xenial
env:
- cmake_option="-DCORENRN_ENABLE_SOA=ON"
- os: linux
dist: xenial
env:
- cmake_option="-DCORENRN_ENABLE_SOA=OFF"
- os: linux
dist: xenial
env:
- PYTHON_VERSION=3.6.7 # for nmodl pip3 install
- USE_NMODL=ON
- os: osx
osx_image: xcode10.2
env:
- cmake_option="-DCORENRN_ENABLE_MPI=ON"
- os: osx
osx_image: xcode10.2
env:
- cmake_option="-DCORENRN_ENABLE_MPI=OFF"
- os: osx
osx_image: xcode10.2
env:
- cmake_option="-DCORENRN_ENABLE_SOA=ON"
- os: osx
osx_image: xcode10.2
env:
- cmake_option="-DCORENRN_ENABLE_SOA=OFF"
- os: osx
osx_image: xcode10.2
env:
- USE_NMODL=ON
- os: linux
dist: xenial
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- bison
- flex
- g++-9
- libboost-all-dev
- libopenmpi-dev
- openmpi-bin
env:
- GCC_VERSION=9
- os: linux
dist: xenial
env:
- USE_ISPC=ON
- PYTHON_VERSION=3.6.7
#=============================================================================
# Common Packages
#=============================================================================
addons:
# for Linux builds, we use APT
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- bison
- flex
- libboost-all-dev
- libopenmpi-dev
- openmpi-bin
- python3-dev
- python3-pip
# for Mac builds, we use Homebrew
homebrew:
packages:
- bison
- flex
- openmpi
- boost
- python@3
update: true
#=============================================================================
# Set up environments
#=============================================================================
before_install:
# brew installed flex and bison is not in $PATH
# unlink python2 and use python3 as it's required for nmodl
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH;
brew unlink python@2;
brew link --overwrite python;
else
pyenv global $PYTHON_VERSION;
fi
# install NMODL dependencies
- if [[ "$USE_NMODL" == "ON" || "$USE_ISPC" == "ON" ]]; then
pip3 install jinja2 pyyaml pytest "sympy<1.6";
fi
- if [ -n "$GCC_VERSION" ]; then
export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}";
$CXX --version;
fi
# install ISPC compiler (only for mac or linux build for now)
- if [[ "$USE_ISPC" == "ON" ]]; then
ispc_version="v1.12.0";
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
url_os="linux";
ispc_version_suffix="b";
else
url_os="macOS";
ispc_version_suffix="";
fi;
url="https://github.com/ispc/ispc/releases/download/${ispc_version}/ispc-${ispc_version}${ispc_version_suffix}-${url_os}.tar.gz";
wget -O ispc.tar.gz $url;
mkdir ispc && tar -xvzf ispc.tar.gz -C ispc --strip 1;
fi
#=============================================================================
# Build, test and install
#=============================================================================
script:
- echo "------- Build, Test and Install -------"
- mkdir build && cd build
- if [[ "$USE_ISPC" == "ON" ]]; then
cmake -DCORENRN_ENABLE_ISPC=ON -DCMAKE_ISPC_COMPILER=../ispc/bin/ispc
-DCMAKE_INSTALL_PREFIX=$HOME/CoreNeuron -DPYTHON_EXECUTABLE=$(which python3) ..;
elif [[ "$USE_NMODL" == "ON" ]]; then
cmake -DCORENRN_ENABLE_NMODL=ON -DCORENRN_NMODL_FLAGS="sympy --analytic"
-DCMAKE_INSTALL_PREFIX=$HOME/CoreNeuron -DPYTHON_EXECUTABLE=$(which python3) ..;
else
cmake ${cmake_option} -DCMAKE_INSTALL_PREFIX=$HOME/CoreNeuron -DPYTHON_EXECUTABLE=$(which python3) ..;
fi
- cmake --build .
- ctest --output-on-failure
- make install