forked from simongog/sdsl-lite
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
102 lines (93 loc) · 4.05 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
# Travis-CI build script for sdsl-lite
language: cpp
sudo: false
matrix:
include:
- env: MYCC="gcc-4.9" MYCXX="g++-4.9" STDLIB=libstdc++
os: linux
addons: &gcc49
apt:
sources:
- kalakris-cmake
- ubuntu-toolchain-r-test
packages:
- cmake
- g++-4.9
- env: MYCC="gcc-5" MYCXX="g++-5" STDLIB=libstdc++
os: linux
addons: &gcc5
apt:
sources:
- kalakris-cmake
- ubuntu-toolchain-r-test
packages:
- cmake
- g++-5
# - env: MYCC="clang-3.7" MYCXX="clang++-3.7" STDLIB=libc++
# os: linux
# addons: &clang37
# apt:
# sources:
# - kalakris-cmake
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.7
# packages:
# - cmake
# - clang-3.7
- env: MYCC="clang" MYCXX="clang++" STDLIB=libc++
os: osx
install:
############################################################################
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
############################################################################
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
############################################################################
# Install a recent CMake (for LLVM)
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
fi
############################################################################
# Install libc++ and libc++abi (on Linux only; Xcode uses libc++ by default)
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" && "${STDLIB}" != "libstdc++" ]]; then
if [[ "${COMPILER}" == "clang++-3.5" ]]; then LLVM_VERSION="3.5.2"
elif [[ "${COMPILER}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2";
elif [[ "${COMPILER}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.0";
else LLVM_VERSION="trunk"; fi
if [[ "${LLVM_VERSION}" != "trunk" ]]; then
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
TAR_FLAGS="-xJ"
else
LLVM_URL="https://github.com/llvm-mirror/llvm/archive/master.tar.gz"
LIBCXX_URL="https://github.com/llvm-mirror/libcxx/archive/master.tar.gz"
LIBCXXABI_URL="https://github.com/llvm-mirror/libcxxabi/archive/master.tar.gz"
TAR_FLAGS="-xz"
fi
mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi
travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 ${TAR_FLAGS} -C llvm
travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 ${TAR_FLAGS} -C llvm/projects/libcxx
travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 ${TAR_FLAGS} -C llvm/projects/libcxxabi
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install -DCMAKE_CXX_COMPILER=clang++)
(cd llvm/build/projects/libcxx && make install -j2)
(cd llvm/build/projects/libcxxabi && make install -j2)
export CXXFLAGS="-isystem ${DEPS_DIR}/llvm/install/include/c++/v1"
export LDFLAGS="-L ${DEPS_DIR}/llvm/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/install/lib"
fi
before_script:
- export CXX=$MYCXX
- export CC=$MYCC
- $CXX --version
- cmake --version
script:
- cd ${TRAVIS_BUILD_DIR}
- ./install.sh ..
- cd tutorial && make all