forked from ComputationalRadiationPhysics/liFFT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
167 lines (153 loc) · 6.47 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#####################################################################
# 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.60.0
matrix:
- LIFFT_BUILD_TYPE=Debug LIFFT_CUDA=OFF LIFFT_CLANG_VER=3.8 LIFT_OPENCL=OFF
- LIFFT_BUILD_TYPE=Release LIFFT_CUDA=OFF LIFFT_CLANG_VER=3.8 LIFT_OPENCL=OFF
matrix:
include:
- os: linux
compiler: gcc
env: LIFFT_BUILD_TYPE=Release LIFFT_CUDA=OFF LIFT_OPENCL=OFF LIFFT_BOOST=1.60.0
- os: linux
compiler: clang
env: LIFFT_BUILD_TYPE=Release LIFFT_CUDA=OFF LIFT_OPENCL=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=8.0.61-1 LIFT_OPENCL=OFF
sudo: required
- os: linux
compiler: gcc
env: LIFFT_BUILD_TYPE=Release LIFFT_CUDA=ON LIFFT_CUDA_VER=8.0.61-1 LIFT_OPENCL=OFF
sudo: required
- os: linux
compiler: gcc
env: LIFFT_BUILD_TYPE=RelWithDebInfo LIFFT_CUDA=OFF LIFFT_CUDA_VER=8.0.61-1 LIFFT_OPENCL=ON LIFFT_CLFFT_VER=2.12.2
sudo: required
before_install:
- |
if [ "${LIFFT_CUDA}" == "ON" ]; then
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-ubuntu1404-8-0-local-ga2_${LIFFT_CUDA_VER}_amd64-deb
sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_${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" ] || [ "${LIFFT_OPENCL}" == "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
# clfft
- |
if [ "${LIFFT_OPENCL}" == "ON" ]; then
export OPENCL_INC=$CUDA_HOME/include
export CLFFT_ROOT=$HOME/dependencies/clfft-${LIFFT_CLFFT_VER}
git clone https://github.com/clMathLibraries/clFFT.git
(cd clFFT; git checkout ${LIFFT_CLFFT_VER})
(cd clFFT/src; cmake -DBUILD64=ON -DBUILD_CALLBACK_CLIENT=OFF -DBUILD_CLIENT=OFF -DBUILD_EXAMPLES=OFF -DBUILD_LOADLIBRARIES=ON -DBUILD_RUNTIME=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TEST=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CLFFT_ROOT -DSUFFIX_LIB=64 -DOPENCL_INCLUDE_DIRS=$OPENCL_INC; make; make install)
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
- |
if [ "${LIFFT_OPENCL}" == "ON" ]; then
cmake ../ -DCMAKE_BUILD_TYPE=${LIFFT_BUILD_TYPE} -DLiFFT_ENABLE_CUDA=OFF -DLiFFT_ENABLE_OPENCL=${LIFFT_OPENCL} -DOpenCL_INCLUDE_DIR=$OPENCL_INC -DCLFFT_ROOT=$CLFFT_ROOT -DCMAKE_VERBOSE_MAKEFILE=ON ${LiFFT_COVERAGE}
else
cmake ../ -DCMAKE_BUILD_TYPE=${LIFFT_BUILD_TYPE} -DLiFFT_ENABLE_CUDA=${LIFFT_CUDA} -DLiFFT_ENABLE_OPENCL=OFF -DCMAKE_VERBOSE_MAKEFILE=ON ${LiFFT_COVERAGE}
fi
- 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