forked from nest/nestml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (85 loc) · 3.18 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
language: python
sudo: true
python: "3.6"
addons:
apt:
packages:
- build-essential
- cmake
- libltdl7-dev
- libgsl0-dev
- libncurses5-dev
- libreadline6-dev
- pkg-config
- python-all-dev
- python-matplotlib
- python-numpy
- python-scipy
before_install:
# in before_install, we install all the NESTML dependencies
# install antrl4
- sudo apt install openjdk-8-jre
- wget http://www.antlr.org/download/antlr-4.8-complete.jar
- echo \#\!/bin/bash > antlr4
- echo java -cp \"`pwd`/antlr-4.8-complete.jar:$CLASSPATH\" org.antlr.v4.Tool \"\$@\" >> antlr4
- echo >> antlr4
- chmod +x antlr4
- export PATH=$PATH:`pwd`
# install Python module dependencies
- pip install --upgrade pip pytest
- pip install -r requirements.txt
- pip uninstall --yes sympy
- pip install sympy==1.4
# install latest odetoolbox from git master (N.B. GSL/PyGSL installation is skipped as NESTML ignores stiffness test result)
- pip uninstall --yes odetoolbox
- pip install git+https://github.com/nest/ode-toolbox.git@509a1e8b17c0f36d7eb749812a6882ca7f1142b1
install:
# in install, we install NESTML itself
- export PYTHONPATH=$PYTHONPATH:`pwd`
- echo $PYTHONPATH
- python setup.py install
before_script:
# use antlr4 to re-generate lexer+parser
- cd $TRAVIS_BUILD_DIR
- find pynestml/generated -not -name __init__.py -a -not -name generated -delete
- cd pynestml/grammars
- ./generate_lexer_parser
- cd ../..
stages:
- test
- integration
jobs:
include:
- stage: test
script: pytest -s -o norecursedirs='*' tests
- stage: integration
install:
# install nest-simulator
- pip install cython pytest-xdist
- cd
- git clone --depth=1 https://github.com/nest/nest-simulator
- mkdir nest_install
- cd nest_install
- export PYTHON_INCLUDE_DIR=`python3 -c "from sysconfig import get_paths; info = get_paths(); print(info['include'])"`
- echo $PYTHON_INCLUDE_DIR
- export PYTHON_LIB_DIR=`find /usr/lib/x86_64-linux-gnu -name "libpython3*.so"`
- echo $PYTHON_LIB_DIR
- cmake -DCMAKE_INSTALL_PREFIX=~/nest_install -DPYTHON_LIBRARY=$PYTHON_LIB_DIR -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR ~/nest-simulator
- make && make install
# install NESTML itself
- cd $TRAVIS_BUILD_DIR
- export PYTHONPATH=$PYTHONPATH:/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages
- echo $PYTHONPATH
- python setup.py install
script:
- nestml --input_path models --target_path target --suffix _nestml --logging_level INFO --module_name nestmlmodule
- cd target
- cmake -Dwith-nest=/home/travis/nest_install/bin/nest-config .
- make && make install
- cd ..
- export PYNESTKERNEL_LOCATION=`find /home/travis/nest_install/lib -name pynestkernel.so`
- export PYNESTKERNEL_LOCATION=`dirname $PYNESTKERNEL_LOCATION`
- export PYNESTKERNEL_LOCATION=`dirname $PYNESTKERNEL_LOCATION`
- echo $PYNESTKERNEL_LOCATION
- export PYTHONPATH=$PYTHONPATH:$PYNESTKERNEL_LOCATION
- pytest -s --forked $TRAVIS_BUILD_DIR/tests/nest_tests