Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 5d42663

Browse files
WeinaJipramodk
authored andcommitted
Add travis CI configuration (#205)
- test multiple cmake options - test ISPC backend - test NMODL backend Fixes #41
1 parent 895b2fe commit 5d42663

File tree

3 files changed

+162
-8
lines changed

3 files changed

+162
-8
lines changed

.travis.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#=============================================================================
2+
# Travis CoreNeuron settings
3+
#=============================================================================
4+
5+
#=============================================================================
6+
# Environment
7+
#=============================================================================
8+
language: cpp
9+
10+
#=============================================================================
11+
# Build matrix
12+
#=============================================================================
13+
matrix:
14+
fast_finish: true
15+
include:
16+
- os: linux
17+
dist: xenial
18+
env:
19+
- cmake_option="-DCORENRN_ENABLE_MPI=ON"
20+
- os: linux
21+
dist: xenial
22+
env:
23+
- cmake_option="-DCORENRN_ENABLE_MPI=OFF"
24+
- os: linux
25+
dist: xenial
26+
env:
27+
- cmake_option="-DCORENRN_ENABLE_SOA=ON"
28+
- os: linux
29+
dist: xenial
30+
env:
31+
- cmake_option="-DCORENRN_ENABLE_SOA=OFF"
32+
- os: linux
33+
dist: xenial
34+
env:
35+
- cmake_option="-DCORENRN_ENABLE_NMODL=ON"
36+
- PYTHON_VERSION=3.6.7 # for nmodl pip3 install
37+
- USE_NMODL=ON
38+
- os: osx
39+
osx_image: xcode10.2
40+
env:
41+
- cmake_option="-DCORENRN_ENABLE_MPI=ON"
42+
- os: osx
43+
osx_image: xcode10.2
44+
env:
45+
- cmake_option="-DCORENRN_ENABLE_MPI=OFF"
46+
- os: osx
47+
osx_image: xcode10.2
48+
env:
49+
- cmake_option="-DCORENRN_ENABLE_SOA=ON"
50+
- os: osx
51+
osx_image: xcode10.2
52+
env:
53+
- cmake_option="-DCORENRN_ENABLE_SOA=OFF"
54+
- os: osx
55+
osx_image: xcode10.2
56+
env:
57+
- cmake_option="-DCORENRN_ENABLE_NMODL=ON"
58+
- USE_NMODL=ON
59+
- os: linux
60+
dist: xenial
61+
addons:
62+
apt:
63+
sources:
64+
- ubuntu-toolchain-r-test
65+
packages:
66+
- bison
67+
- flex
68+
- g++-9
69+
- libboost-all-dev
70+
- libopenmpi-dev
71+
- openmpi-bin
72+
env:
73+
- GCC_VERSION=9
74+
- os: linux
75+
dist: xenial
76+
env:
77+
- USE_ISPC=ON
78+
- PYTHON_VERSION=3.6.7
79+
80+
#=============================================================================
81+
# Common Packages
82+
#=============================================================================
83+
addons:
84+
# for Linux builds, we use APT
85+
apt:
86+
sources:
87+
- ubuntu-toolchain-r-test
88+
packages:
89+
- bison
90+
- flex
91+
- libboost-all-dev
92+
- libopenmpi-dev
93+
- openmpi-bin
94+
95+
# for Mac builds, we use Homebrew
96+
homebrew:
97+
packages:
98+
- bison
99+
- flex
100+
- openmpi
101+
- boost
102+
103+
#=============================================================================
104+
# Set up environments
105+
#=============================================================================
106+
before_install:
107+
# brew installed flex and bison is not in $PATH
108+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
109+
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH;
110+
fi
111+
# when python 3.6.7 is required, ex. NMODL in linux
112+
- if [ -n "$PYTHON_VERSION" ]; then
113+
pyenv global $PYTHON_VERSION;
114+
fi
115+
# install NMODL dependencies
116+
- if [[ "$USE_NMODL" == "ON" || "$USE_ISPC" == "ON" ]]; then
117+
pip3 install jinja2 pyyaml pytest sympy;
118+
fi
119+
- if [ -n "$GCC_VERSION" ]; then
120+
export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}";
121+
$CXX --version;
122+
fi
123+
# install ISPC compiler (only for mac or linux build for now)
124+
- if [[ "$USE_ISPC" == "ON" ]]; then
125+
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
126+
url_os="linux";
127+
else
128+
url_os="macOS";
129+
fi;
130+
url="https://sourceforge.net/projects/ispcmirror/files/v1.12.0/ispc-v1.12.0-${url_os}.tar.gz";
131+
wget -O ispc.tar.gz $url;
132+
mkdir ispc && tar -xvzf ispc.tar.gz -C ispc --strip 1;
133+
fi
134+
#=============================================================================
135+
# Build, test and install
136+
#=============================================================================
137+
script:
138+
- echo "------- Build, Test and Install -------"
139+
- mkdir build && cd build
140+
- if [[ "$USE_ISPC" == "ON" ]]; then
141+
cmake -DCORENRN_ENABLE_ISPC=ON -DCMAKE_ISPC_COMPILER=../ispc/bin/ispc
142+
-DCMAKE_INSTALL_PREFIX=$HOME/CoreNeuron ..;
143+
else
144+
cmake ${cmake_option} -DCMAKE_INSTALL_PREFIX=$HOME/CoreNeuron ..;
145+
fi
146+
- cmake --build .
147+
- ctest --output-on-failure
148+
- make install

coreneuron/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ else()
5656
set(NMODL_CODEGEN_TARGET serial)
5757
endif()
5858

59+
# configure every mod file to configure with mod2c/nmodl
60+
foreach(MOD ${INBUILT_MOD_FILES})
61+
nmodl_to_cpp_target(KEY INBUILT_MOD MODFILE "${INBUILT_MOD_PATH}/${MOD}" TARGET ${NMODL_CODEGEN_TARGET})
62+
endforeach()
63+
64+
set_source_files_properties(${NMODL_INBUILT_MOD_OUTPUTS} PROPERTIES GENERATED TRUE)
65+
5966
# for ispc generated files, we need add extra compilation flags
6067
if(CORENRN_ENABLE_ISPC)
6168
set(NMODL_ISPC_INBUILT_MOD_OUTPUTS ${NMODL_INBUILT_MOD_OUTPUTS})
@@ -64,16 +71,9 @@ if(CORENRN_ENABLE_ISPC)
6471
set_source_files_properties(${NMODL_ISPC_INBUILT_MOD_OUTPUTS}
6572
PROPERTIES
6673
COMPILE_FLAGS
67-
"-I${nmodl_INCLUDE}")
74+
"-I${CORENRN_NMODL_INCLUDE} --pic")
6875
endif()
6976

70-
# configure every mod file to configure with mod2c/nmodl
71-
foreach(MOD ${INBUILT_MOD_FILES})
72-
nmodl_to_cpp_target(KEY INBUILT_MOD MODFILE "${INBUILT_MOD_PATH}/${MOD}" TARGET ${NMODL_CODEGEN_TARGET})
73-
endforeach()
74-
75-
set_source_files_properties(${NMODL_INBUILT_MOD_OUTPUTS} PROPERTIES GENERATED TRUE)
76-
7777
# =============================================================================
7878
# coreneuron GPU library
7979
# =============================================================================

coreneuron/nrnoc/nrnoc_ml.ispc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ struct NrnThreadBAList {
105105

106106
};
107107

108+
struct NrnFastImem {
109+
double* uniform nrn_sav_rhs;
110+
double* uniform nrn_sav_d;
111+
};
112+
108113
struct NrnThread {
109114
uniform double _t;
110115
uniform double _dt;
@@ -143,6 +148,7 @@ struct NrnThread {
143148
double* uniform _actual_diam;
144149
double* uniform _shadow_rhs;
145150
double* uniform _shadow_d;
151+
NrnFastImem* uniform nrn_fast_imem;
146152
int* uniform _v_parent_index;
147153
int* uniform _permute;
148154
int8* uniform _sp13mat;

0 commit comments

Comments
 (0)