forked from stan-dev/rstan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
81 lines (71 loc) · 2.85 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
sudo: true
dist: trusty
services:
- docker
git:
submodules: false
cache:
apt: true
ccache: true
packages: true
directories:
- $HOME/.ccache
- $HOME/.m2
language: r
os:
- linux
- osx
env:
global:
- STAN_BRANCH=master
- STAN_MATH_BRANCH=master
- RSTAN_NEXT_VER=2.99
matrix:
- CXX_OLEVEL=2 RCPP_VER=cran CXX=clang++
matrix:
allow_failures:
- env: CXX_OLEVEL=0 RCPP_VER=cran
- env: CXX_OLEVEL=3 RCPP_VER=github
- compiler: gcc
before_install:
- echo -e "#\x21/bin/sh\n\$1 &\nPROCESS=\"\$!\"\nwhile :\ndo\n RESULT=\`ps -p \${PROCESS} -o comm=\`" > wait4.sh
- echo -e " if [ -z \"\${RESULT}\" ]; then\n wait \${PROCESS}; exit \$?\n else\n echo \"-\"; sleep 10\n fi\ndone\nexit \$?" >> wait4.sh
- more wait4.sh
- echo -e "Package\x3A mnb_bnm" > DESCRIPTION
- chmod 755 wait4.sh
- git submodule update --init --recursive || echo "ok"
- cd ${TRAVIS_BUILD_DIR}/StanHeaders/inst/include/upstream && git checkout origin/${STAN_BRANCH}
- cd ${TRAVIS_BUILD_DIR}/StanHeaders/inst/include/mathlib && git checkout origin/${STAN_MATH_BRANCH}
- cd ${TRAVIS_BUILD_DIR}
before_script:
- Rscript -e "install.packages(c('inline', 'Rcpp', 'coda', 'BH', 'RcppEigen', 'RInside', 'RUnit', 'ggplot2', 'gridExtra', 'knitr', 'rmarkdown', 'loo'), repos='http://cran.rstudio.com')"
- R CMD build StanHeaders/
- R CMD INSTALL `find StanHeaders*.tar.gz`
- if [[ $TRAVIS_OS_NAME = 'osx' ]] ; then sudo tlmgr update --self; fi
- if [[ $TRAVIS_OS_NAME = 'osx' ]] ; then sudo tlmgr install verbatimbox readarray ifnextok multirow fancyvrb url titlesec booktabs; fi
- if [[ $TRAVIS_OS_NAME != 'osx' ]] ; then tlmgr install verbatimbox readarray ifnextok; fi
- if [[ $TRAVIS_OS_NAME = "osx" ]] ; then brew install ccache; brew link ccache; fi
- echo "CXX = `R CMD config CXX`" >> ./rstan/R_Makevars
- echo "CXXFLAGS = `R CMD config CXXFLAGS` -pedantic -g0" >> ./rstan/R_Makevars
- export CLANG_EXTRA_ARG=""
- if [[ $CXX = "clang++" ]] ; then export CLANG_EXTRA_ARG=" -Qunused-arguments -fcolor-diagnostics " ; fi
- if [[ $RCPP_VER = 'github' ]]; then R -q -e "options(repos = getCRANmirrors()[1,'URL']); library(devtools); install_github('Rcpp', 'Rcppcore')"; fi
- echo ${CXX}
- echo ${CLANG_EXTRA_ARG}
- sed -i.bak "s/^\(Version.\).*/\1 ${RSTAN_NEXT_VER}/" ./rstan/rstan/DESCRIPTION
- sed -i.bak "s/ g++/ ${CXX}${CLANG_EXTRA_ARG}/" ./rstan/R_Makevars
- sed -i.bak "s/O[0-3]/O$CXX_OLEVEL/" ./rstan/R_Makevars
- rm ./rstan/R_Makevars.bak
- more ./rstan/R_Makevars
- mkdir -p ~/.R/; cat ./rstan/R_Makevars > ~/.R/Makevars
- more ~/.R/Makevars
notifications:
email:
# recipients:
on_success: change
on_failure: always
script:
- cd rstan
- R -q -e "library(Rcpp); sessionInfo()"
- ../wait4.sh "make install" && cd tests && R -q -f runRunitTests.R