-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
109 lines (104 loc) · 3.49 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
language: python
sudo: false
os: linux
virtualenv:
system_site_packages: false
cache:
directories:
- $HOME/.cache/pip
- $HOME/nfft-3.2.3
- $HOME/libspimage
- $HOME/spsim
- $HOME/local
- $HOME/localpy
- $HOME/virutalenv
matrix:
include:
- python: '2.7'
dist: bionic
- python: '3.4'
dist: xenial
- python: '3.5'
dist: bionic
- python: '3.6'
dist: bionic
- python: '3.7'
dist: bionic
- python: '3.8'
dist: bionic
addons:
apt:
packages:
- libpng-dev
- libtiff5-dev
- libfftw3-dev
- libhdf5-serial-dev
- cmake
- gsl-bin
- libgsl0-dev
- swig
before_install:
- echo $HOME
- export PY_SITE=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/local/lib:${HOME}/local/lib64:${PY27_PREFIX}/lib
- export PYTHONPATH=${HOME}/localpy:${PYTHONPATH}
# Install hdf5
- cd $HOME
- ls ${HOME}/
# Install numpy and scipy
- pip install numpy
- pip install scipy
# Install configparser with pip (this is to make condor compatible with Python 3, which no longer has the ConfigParser module)
- pip install configparser
- pip install h5py
- pip install pytest
# Testing imports
- python -c "import numpy; print(numpy.__file__)"
- python -c "import scipy; print(scipy.__file__)"
- python -c "import h5py; print(h5py.__file__)"
- python -c "import pytest; print(pytest.__file__)"
# Install libspimage
- cd $HOME
- if [ ! -d "$HOME/libspimage/.git" ]; then git clone https://github.com/FilipeMaia/libspimage; else echo 'Using libspimage from cached directory'; fi
- mkdir -p libspimage/build && cd libspimage/build
- git pull
- cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_CUDA=OFF -DPYTHON_WRAPPERS=ON -DCMAKE_INSTALL_PREFIX=${HOME}/virtualenv/python${TRAVIS_PYTHON_VERSION} -DPYTHON_INSTDIR=${PY_SITE} ..
- make
#; -j 2 VERBOSE=1
- make install
# Install NFFT
- cd $HOME
- if [ ! -d "$HOME/nfft-3.2.3/include" ]; then wget https://www-user.tu-chemnitz.de/~potts/nfft/download/nfft-3.2.3.tar.gz && tar xvzf nfft-3.2.3.tar.gz; cd nfft-3.2.3 && ./configure --prefix=${HOME}/local && make && make install; else echo 'Using NFFT from cached directory'; fi
# Install spsim
- cd $HOME
- if [ ! -d "$HOME/spsim/.git" ]; then git clone https://github.com/FilipeMaia/spsim; else echo 'Using spsim from cached directory'; fi
- mkdir -p spsim/build && cd spsim/build
- git pull
- cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_LIBRARY=ON -DUSE_CUDA=OFF -DUSE_NFFT=OFF -DPYTHON_WRAPPERS=ON -DCMAKE_INSTALL_PREFIX=${HOME}/virtualenv/python${TRAVIS_PYTHON_VERSION} -DPYTHON_INSTDIR=${PY_SITE} ..
- make VERBOSE=1
- make install
- ls -alh $HOME/local/lib
# Command to install dependencies
install:
# Install condor
- cd $HOME/build/FXIhub/condor
- export NFFT_INCLUDE_DIR=$HOME/local/include
- export NFFT_LIBRARY_DIR=$HOME/local/lib
- pip install -e .
# command to run tests
script:
- echo $LD_LIBRARY_PATH
- echo $PYTHONPATH
# TESTING IMPORTS
- cd $HOME
- python -c "import spimage; print(spimage.__file__)"
- python -c "import spsim; print(spsim.__file__)"
- python -c "import spimage_pybackend; print(spimage_pybackend.__file__)"
- python -c "import spsim_pybackend; print(spsim_pybackend.__file__)"
- python -c "import condor; print(condor.__file__)"
# PYTEST
- cd $HOME/build/FXIhub/condor
- pytest -v tests
# EXAMPLES
- cd $HOME/build/FXIhub/condor
- python .travis_examples.py