forked from tmcdonell/cuda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
95 lines (84 loc) · 3.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
language: haskell
env:
global:
- HAPPY=1.19.5
- ALEX=3.1.4
matrix:
- CUDA=6.5-14 GHC=7.6.3
- CUDA=6.5-14 GHC=7.8.4
- CUDA=6.5-14 GHC=7.10.2
- CUDA=7.0-28 GHC=7.6.3
- CUDA=7.0-28 GHC=7.8.4
- CUDA=7.0-28 GHC=7.10.2
- CUDA=7.0-28 GHC=head
# - CUDA=6.0-37
matrix:
allow_failures:
- env: CUDA=7.0-28 GHC=head
before_install:
# If travis doesn't have the version of GHC that we want, get it from hvr's PPA
- echo "Setting up GHC"
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update -qq
# - travis_retry sudo apt-get install -y c2hs
- export PATH=/usr/local/ghc/${GHC}/bin:${PATH}
- |
if [ $(ghc --numeric-version) != ${GHC} ]; then
travis_retry sudo apt-get install -y ghc-${GHC}
export PATH=/opt/ghc/${GHC}/bin:${PATH}
fi
- |
if [ ${CABAL} ]; then
travis_retry sudo apt-get install -y cabal-install-${CABAL}
export PATH=/opt/cabal/${CABAL}/bin:${PATH}
fi
# If we want to build c2hs from source, ghc-7.8 and later will require newer
# versions of happy and alex
- |
if [ ${GHC%.*} != 7.6 ]; then
travis_retry sudo apt-get install -y alex-${ALEX} happy-${HAPPY}
export PATH=/opt/alex/${ALEX}/bin:/opt/happy/${HAPPY}/bin:${PATH}
fi
- cabal install c2hs
# Need to install a newer version of the Cabal library in order to run the
# Setup.hs script
- cabal install Cabal --constraint="Cabal >= 1.22"
# Install the CUDA toolkit
- echo "Installing CUDA library"
- travis_retry wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_${CUDA}_amd64.deb
- travis_retry sudo dpkg -i cuda-repo-ubuntu1204_${CUDA}_amd64.deb
- travis_retry sudo apt-get update -qq
- export CUDA_APT=${CUDA%-*}
- export CUDA_APT=${CUDA_APT/./-}
# - travis_retry sudo apt-get install -y cuda-${CUDA_APT}
- travis_retry sudo apt-get install -y cuda-drivers cuda-core-${CUDA_APT} cuda-cudart-dev-${CUDA_APT}
- travis_retry sudo apt-get clean
- export CUDA_HOME=/usr/local/cuda-${CUDA%%-*}
- export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
- export PATH=${CUDA_HOME}/bin:${PATH}
install:
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- cabal --version
- c2hs --version
- nvcc --version
- cabal install --only-dependencies --enable-tests
script:
# Check the build
- cabal configure -v2 -flib-Werror
- cabal build
- cabal haddock
# - cabal test --show-details=always
# Check the source distribution can be generated, built, and installed
- cabal sdist
- |
export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}')
cd dist
if [ -f "$SRC_TGZ" ]; then
cabal install --force-reinstalls ${SRC_TGZ} || exit 1
else
echo "'$SRC_TGZ': not found"
exit 1
fi
after_failure:
- dmesg
- ls -R /usr/local/cuda*