forked from opensim-org/opensim-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
84 lines (75 loc) · 3.37 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
# To learn about this file, go to http://docs.travis-ci.com/user/languages/c/
language: cpp
compiler:
- clang
- gcc
env:
# The python tests look for this environment variable.
- OPENSIM_HOME=$TRAVIS_BUILD_DIR/opensim-install
before_install:
## Get Simbody and its dependencies.
- sudo apt-get update -qq
- sudo apt-get install -qq liblapack-dev
# Must get a newer gcc so we can compile with C++11,
# when using gcc OR Clang.
# from https://github.com/travis-ci/travis-ci/issues/979.
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- sudo apt-get install -qq g++-4.8
# Only if compiling with gcc, update environment variables
# to use the new gcc.
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
# Clone Simbody into the Simbody directory. Don't need its history, and
# only need the master branch.
- git clone https://github.com/simbody/simbody.git simbody-source --depth 1 --branch master
- cd simbody-source
# Configure Simbody.
- cmake . -DBUILD_VISUALIZER=off -DBUILD_EXAMPLES=off -DSIMBODY_STANDARD_11=on -DCMAKE_INSTALL_PREFIX=../simbody-install
# Build Simbody.
- make -j8
# Test Simbody.
- ctest -j8 --output-on-failure
# Install Simbody.
- make -j8 install
# Go back to the directory containing OpenSim.
- cd ../
## Install SWIG to build Java/python wrapping.
- wget http://sourceforge.net/projects/swig/files/swig/swig-2.0.10/swig-2.0.10.tar.gz/download
- mv download swig-2.0.10.tar.gz
- tar xzf swig-2.0.10.tar.gz
- cd swig-2.0.10
- ./configure && make && sudo make -j8 install
# Go back to the directory containing OpenSim.
- cd ../
## Detect if we should check memory leaks with valgrind.
- git log --format=%B --no-merges -n 1 | grep '\[ci valgrind\]'; export RUN_VALGRIND=$?; true
- if [ $RUN_VALGRIND = "0" ]; then sudo apt-get install -qq valgrind; fi
- if [ $RUN_VALGRIND = "0" ]; then export CTEST_FLAGS="-D ExperimentalMemCheck"; fi
install:
# Configure OpenSim.
- cmake . -DBUILD_JAVA_WRAPPING=on -DBUILD_PYTHON_WRAPPING=on -DSIMBODY_HOME=simbody-install -DCMAKE_CXX_FLAGS=-Werror -DCMAKE_INSTALL_PREFIX=$OPENSIM_HOME
# Build OpenSim.
# gcc is crashing when building osimJavaJNI with other targets (_opensim?).
# gcc does not crash if we build _opensim separately.
- if [ "$CXX" = "g++-4.8" ]; then make -j8 osimJavaJNI; fi
- make -j8 # This'll build _opensim and the tests.
script:
# Test OpenSim.
- ctest -j8 --output-on-failure $CTEST_FLAGS
## Print out valgrind output.
- if [ $RUN_VALGRIND ]; then find Testing/Temporary -name "MemoryCheck*" -print | xargs cat; fi
## Test python wrapping.
# Install OpenSim. Suppress output.
- make -j8 install > /dev/null
# For python tests, we need to copy over some model files.
# This is temporary; in the future, we will use the opensim-models repo.
- mkdir -p $OPENSIM_HOME/Models/Arm26 && cp OpenSim/Tools/Test/arm26.osim "$_"
- mkdir -p $OPENSIM_HOME/Models/Gait10dof18musc && cp Applications/CMC/test/gait10dof18musc_subject01.osim "$_/gait10dof18musc.osim"
# Go to the python wrapping package directory.
- cd opensim-install/sdk/python
- echo "$TRAVIS_BUILD_DIR/opensim-install/lib" | sudo tee /etc/ld.so.conf.d/opensim.conf
- sudo ldconfig
# Get a python package with which to run the tests.
- sudo apt-get install python-nose
# Run the python tests, verbosely.
- nosetests -v