forked from OHDSI/RcppBoostCompute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
126 lines (115 loc) · 4.21 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
languague: cpp
env:
global:
- secure: S3VMaROvyrkRV/t2Lmdtt6/B3R7IHynfYX0kRSDL5mW/zkxUpV3Wm8TMOcsUpz7vBX53UK+ze882L/nIzBhVc5NEl2unswqDd8LYMZmAqKeeKB3RiSkdCZPOAJVVvru3M3hy/RIVxQgyCRLK8QSwhax0nVqRu51JL4WUMrDkqxo=
- OPENCL_STEM=$HOME/opencl
matrix:
include:
# No OpenCL
- os: linux
sudo: false
compiler: gcc
addons:
apt:
sources:
- r-packages-precise
packages:
- r-base-dev
- r-recommended
- texinfo
- qpdf
# With AMD OpenCL
- os: linux
sudo: false
compiler: gcc
addons:
apt:
sources:
- r-packages-precise
packages:
- r-base-dev
- r-recommended
- texinfo
- qpdf
env:
- OPENCL_LIB=amdappsdk
- OPENCL_VERSION="12"
- AMDAPPSDK_VERSION=291 # OpenCL 1.2
- AMDAPPSDKROOT=${OPENCL_STEM}/AMDAPPSDK
- OPENCL_ROOT=${AMDAPPSDKROOT}
cache:
directories:
- ~/Rlib # R libraries
- ~/texlive # LaTex
- ~/bin # pandoc
before_install:
- |
if [[ ${OPENCL_LIB} == "amdappsdk" ]]; then
mkdir -p ${OPENCL_STEM}
bash .travis/amd_sdk.sh ${AMDAPPSDK_VERSION}
tar -xjf AMD-SDK.tar.bz2
export OPENCL_VENDOR_PATH=${AMDAPPSDKROOT}/etc/OpenCL/vendors
mkdir -p ${OPENCL_VENDOR_PATH}
sh AMD-APP-SDK*.sh --tar -xf -C ${AMDAPPSDKROOT}
echo libamdocl64.so > ${OPENCL_VENDOR_PATH}/amdocl64.icd
export LD_LIBRARY_PATH=${AMDAPPSDKROOT}/lib/x86_64:${LD_LIBRARY_PATH}
export CMAKE_LIBRARY_PATH=${AMDAPPSDKROOT}/lib/x86_64;
chmod +x ${AMDAPPSDKROOT}/bin/x86_64/clinfo
${AMDAPPSDKROOT}/bin/x86_64/clinfo
rm AMD-APP-SDK*.sh
rm AMD-SDK.tar.bz2
fi
# install dependencies
install:
# - rm -rf ~/Rlib
# Save R packages in Rlib
- mkdir -p ~/Rlib
- echo 'R_LIBS=~/Rlib' > .Renviron
- echo 'options(repos = "http://cran.rstudio.com")' > .Rprofile
- mkdir -p ~/.R
- grep '\-g' /etc/R/Makeconf | sed 's/-g//g' > ~/.R/Makevars # Turn off debug symbols
# Build LaTex and pandoc
- mkdir -p ~/bin
- wget -q -O - https://github.com/yihui/crandalf/raw/master/inst/scripts/install-texlive | bash
- wget -q -O - https://github.com/yihui/crandalf/raw/master/inst/scripts/install-pandoc | bash
- PATH=$HOME/texlive/bin/x86_64-linux:$PATH
# Install R packages
- Rscript -e "if (!require('devtools')) install.packages('devtools')"
- Rscript -e "if (!require('BH')) install.packages('BH')"
- Rscript -e "if (!require('drat')) install.packages('drat')"
- Rscript -e "if (!require('BoostCompiledLibraries')) devtools::install_github('OHDSI/BoostCompiledLibraries')"
- Rscript -e "if (!require('Rcpp')) install.packages('Rcpp')"
- Rscript -e "if (!require('testthat')) install.packages('testthat')"
before_script:
- export PKG_NAME=$(Rscript -e 'cat(paste0(devtools::as.package(".")$package))')
- export PKG_TARBALL=$(Rscript -e 'pkg <- devtools::as.package("."); cat(paste0(pkg$package,"_",pkg$version,".tar.gz"))')
- export CPLUS_INCLUDE_PATH=${OPENCL_ROOT}/include:${CPLUS_INCLUDE_PATH}
- export LD_LIBRARY_PATH=${OPENCL_ROOT}/lib/x86_64:${LD_LIBRARY_PATH}
- export LIBRARY_PATH=${OPENCL_ROOT}/lib/x86_64:${LIBRARY_PATH}
# - echo $AMDAPPSDKROOT
# - echo $OPENCL_ROOT
# - echo $CPLUS_INCLUDE_PATH
# - echo $LD_LIBRARY_PATH
# - echo $LIBRARY_PATH
# - ls $HOME/opencl/lib
# - ls $HOME/opencl/lib/bin
# - find $OPENCL_ROOT
# Build and check package
script:
- R CMD build .
- _R_CHECK_CRAN_INCOMING_=FALSE R CMD check "${PKG_TARBALL}" --as-cran
- cat ${PKG_NAME}.Rcheck/00install.out # Print out install / compile log
# Print out device information
# - Rscript -e "install.packages('${PKG_TARBALL}', lib = '.', repo = NULL, type = 'source'); RcppBoostCompute::compute_hello_world()"
after_success:
# - Rscript -e 'covr::codecov()'
# Rebuild docker container
# - curl --data "build=true" -X POST https://registry.hub.docker.com/u/ohdsi/broadsea-methodslibrary/trigger/f0b51cec-4027-4781-9383-4b38b42dd4f5/
# Rebuild drat repo
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh
notifications:
recipients:
email:
on_success: change
on_failure: always