-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
149 lines (135 loc) · 5.16 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#####################################################################
# This file is part of libLiFFT.
#
# libLiFFT is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# libLiFFT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with libLiFFT. If not, see <www.gnu.org/licenses/>.
#####################################################################
language: cpp
os: linux
sudo: false
compiler:
- gcc
- clang
branches:
only:
- master
- dev
cache:
directories:
- $HOME/dependencies
- $HOME/.cache/pip
- $HOME/virtualenv/python2.7/lib/python2.7/site-packages
- $HOME/.local/lib/python2.7/site-packages
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- g++-4.8
- clang-3.8
- cmake
- libfftw3-dev
env:
global:
- LIFFT_BOOST=1.55.0
matrix:
- LIFFT_BUILD_TYPE=Debug LIFFT_CUDA=OFF LIFFT_CLANG_VER=3.8
- LIFFT_BUILD_TYPE=Release LIFFT_CUDA=OFF LIFFT_CLANG_VER=3.8
matrix:
include:
- os: linux
compiler: gcc
env: LIFFT_BUILD_TYPE=Release LIFFT_CUDA=OFF LIFFT_BOOST=1.60.0
- os: linux
compiler: clang
env: LIFFT_BUILD_TYPE=Release LIFFT_CUDA=OFF LIFFT_CLANG_VER=3.5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
packages:
- g++-4.8
- clang-3.5
- cmake
- libfftw3-dev
- os: linux
compiler: gcc
env: LIFFT_BUILD_TYPE=Debug LIFFT_CUDA=ON LIFFT_CUDA_VER=7.0-28
sudo: required
- os: linux
compiler: gcc
env: LIFFT_BUILD_TYPE=Release LIFFT_CUDA=ON LIFFT_CUDA_VER=7.0-28
sudo: required
before_install:
- |
if [ "${LIFFT_CUDA}" == "ON" ]; then
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_${LIFFT_CUDA_VER}_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1204_${LIFFT_CUDA_VER}_amd64.deb
sudo apt-get update -qq
fi
install:
- if [ "${CXX}" == "g++" ]; then export CXX=g++-4.8; export CC=${CXX/g++/gcc}; export GCOV=${CXX/g++/gcov}; fi
- if [ "${CXX}" == "clang++" ]; then export CXX=clang++-${LIFFT_CLANG_VER}; export CC=clang-${LIFFT_CLANG_VER}; export GCOV="gcov"; fi
# CUDA
- |
if [ "${LIFFT_CUDA}" == "ON" ]; then
CUDA_APT_VER=${LIFFT_CUDA_VER%-*}
CUDA_APT_VER=${CUDA_APT_VER/./-}
CUDA_PACKAGES="cuda-drivers cuda-core-${CUDA_APT_VER} cuda-cudart-dev-${CUDA_APT_VER} cuda-cufft-dev-${CUDA_APT_VER}"
echo "Installing ${CUDA_PACKAGES}"
sudo apt-get install -y ${CUDA_PACKAGES}
export CUDA_HOME=/usr/local/cuda-${LIFFT_CUDA_VER%%-*}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
export PATH=${CUDA_HOME}/bin:${PATH}
fi
# Boost
- export LIFFT_BOOST_FOLDER="boost_${LIFFT_BOOST//./_}"
- export BOOST_ROOT="$HOME/dependencies/${LIFFT_BOOST_FOLDER}"
- |
if [ ! -d "$BOOST_ROOT" ]; then
wget http://sourceforge.net/projects/boost/files/boost/${LIFFT_BOOST}/${LIFFT_BOOST_FOLDER}.tar.bz2 --output-document=boost.tar.bz2
mkdir -p $BOOST_ROOT
tar jxf boost.tar.bz2 --strip-components=1 -C $BOOST_ROOT
(cd $BOOST_ROOT; ./bootstrap.sh --with-libraries=program_options,filesystem,system,test)
(cd $BOOST_ROOT; ./b2 --prefix=$BOOST_ROOT -d0 install)
else echo "Using cached boost version at $BOOST_ROOT"
fi
- |
export LiFFT_COVERAGE=""
if [ "${LIFFT_CUDA}" == "OFF" ]; then
pip install --user numpy matplotlib
# GCov for clang does not work for this folder structure
if [ "${LIFFT_BUILD_TYPE}" == "Debug" ] && [[ "$CXX" == "g++"* ]]; then
export LiFFT_COVERAGE="-DLiFFT_ENABLE_COVERAGE=ON"
fi
fi
# Versions
- $CXX --version
- if [ "${LIFFT_CUDA}" == "ON" ]; then nvcc --version; fi
- cmake --version
- $GCOV --version
script:
- mkdir build && cd build
- set -e
- cmake ../ -DCMAKE_BUILD_TYPE=${LIFFT_BUILD_TYPE} -DLiFFT_ENABLE_CUDA=${LIFFT_CUDA} -DCMAKE_VERBOSE_MAKEFILE=ON ${LiFFT_COVERAGE}
- make
- |
if [ "${LIFFT_CUDA}" == "OFF" ]; then
export CTEST_OUTPUT_ON_FAILURE=1
make test
fi
- set +e
after_success:
- if [ "${LIFFT_BUILD_TYPE}" == "Debug" ]; then bash <(curl -s https://codecov.io/bash) -x "${GCOV}"; fi