forked from clab/dynet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
97 lines (91 loc) · 3 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
language: cpp
os:
- linux
- osx
compiler:
- gcc
- clang
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- boost-latest
packages:
- gcc-4.8
- g++-4.8
- libboost-filesystem1.55-dev
- libboost-program-options1.55-dev
- libboost-serialization1.55-dev
- libboost-test1.55-dev
- libboost-regex1.55-dev
env:
global:
- PYTHON=python CONDA_PACKAGES="numpy cython"
matrix:
- PYVER=3.4 PYNUM=3 PYTHON_INSTALL=manual
- PYVER=3.4 PYNUM=3 PYTHON_INSTALL=pip
- PYVER=2.7 PYNUM=2 PYTHON_INSTALL=manual
- PYVER=2.7 PYNUM=2 PYTHON_INSTALL=pip
matrix:
exclude:
- os: linux
compiler: clang
- os: osx
compiler: gcc
before_install:
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export MINICONDA_OS_NAME=Linux CXX=g++-4.8 CC=gcc-4.8;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export MINICONDA_OS_NAME=MacOSX;
fi
- wget https://repo.continuum.io/miniconda/Miniconda$PYNUM-latest-$MINICONDA_OS_NAME-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
install:
- 'if [[ "$PYTHON_INSTALL" == "manual" ]]; then
hg clone https://bitbucket.org/eigen/eigen/ -r 346ecdb || travis_terminate 1;
cd eigen;
mkdir build && cd build;
cmake .. || travis_terminate 1;
sudo make install || travis_terminate 1;
cd ../..;
export EIGEN3_INCLUDE_DIR=/usr/local/include/eigen3;
fi'
before_script:
- cd $TRAVIS_BUILD_DIR
- conda create -q -n dynet-environment python=$PYVER $CONDA_PACKAGES
- source activate dynet-environment
- 'if [[ "$PYTHON_INSTALL" == "manual" ]]; then
mkdir build;
cd build;
cmake .. -DEIGEN3_INCLUDE_DIR=$EIGEN3_INCLUDE_DIR -DENABLE_BOOST=ON -DENABLE_CPP_EXAMPLES=ON -DPYTHON=$(which python) -DCMAKE_INSTALL_PREFIX=$(dirname $(which python))/.. || travis_terminate 1;
else
pip install -v . || travis_terminate 1;
fi'
after_failure:
- cat $TRAVIS_BUILD_DIR/build/CMakeFiles/CMakeError.log
script:
- 'if [[ "$PYTHON_INSTALL" == "manual" ]]; then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
make -j$(nproc) || travis_terminate 1;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
make -j$(sysctl -n hw.ncpu) || travis_terminate 1;
export DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/build/dynet;
fi;
make install || travis_terminate 1;
make test || travis_terminate 1;
cd python;
python ../../setup.py build --build-dir=.. --skip-build install --user || travis_terminate 1;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export DYLD_LIBRARY_PATH=$(dirname $(which python))/../lib:$DYLD_LIBRARY_PATH;
fi'
- cd $TRAVIS_BUILD_DIR/tests/python
- python test.py