-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (49 loc) · 2.23 KB
/
Dockerfile
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
ARG TIDYVERSE_TAG
FROM rocker/tidyverse:${TIDYVERSE_TAG}
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends libglpk-dev clang-3.6 clinfo pocl-opencl-icd nvidia-settings nvidia-cuda-toolkit libxt-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/downloaded_packages
RUN mkdir -p $HOME/.R/ \
&& echo "CXX=clang++ -stdlib=libc++ -fsanitize=address,undefined -fno-sanitize=float-divide-by-zero -fno-omit-frame-pointer -fsanitize-address-use-after-scope -fno-sanitize=alignment -frtti" >> $HOME/.R/Makevars \
&& echo "CC=clang -fsanitize=address,undefined -fno-sanitize=float-divide-by-zero -fno-omit-frame-pointer -fsanitize-address-use-after-scope -fno-sanitize=alignment" >> $HOME/.R/Makevars \
&& echo "CFLAGS=-O3 -Wall -pedantic -mtune=native" >> $HOME/.R/Makevars \
&& echo "FFLAGS=-O2 -mtune=native" >> $HOME/.R/Makevars \
&& echo "FCFLAGS=-O2 -mtune=native" >> $HOME/.R/Makevars \
&& echo "CXXFLAGS=-O3 -march=native -mtune=native -fPIC" >> $HOME/.R/Makevars \
&& echo "MAIN_LD=clang++ -stdlib=libc++ -fsanitize=undefined,address" >> $HOME/.R/Makevars \
&& echo "rstan::rstan_options(auto_write = TRUE)" >> $HOME/.Rprofile \
&& echo "options(mc.cores = parallel::detectCores())" >> $HOME/.Rprofile
ENV CMDSTAN /usr/share/.cmdstan
ARG CMDSTAN_VERSION
RUN cd /usr/share/ \
&& wget --progress=dot:mega https://github.com/stan-dev/cmdstan/releases/download/v${CMDSTAN_VERSION}/cmdstan-${CMDSTAN_VERSION}.tar.gz \
&& tar -zxpf cmdstan-${CMDSTAN_VERSION}.tar.gz \
&& rm cmdstan-${CMDSTAN_VERSION}.tar.gz \
&& mv cmdstan-${CMDSTAN_VERSION} .cmdstan \
&& ln -s .cmdstan cmdstan && cd .cmdstan && echo "CXX = clang++" >> make/local \
&& make build
ENV DOWNLOAD_STATIC_LIBV8 1
RUN install2.r --error --skipmissing --skipinstalled -n -1 rstan remotes
ARG CMDSTANR_VERSION
RUN Rscript -e 'remotes::install_github( paste0("stan-dev/cmdstanr@v", Sys.getenv("CMDSTANR_VERSION")) )'
RUN install2.r --error --skipmissing --skipinstalled -n -1 \
renv \
here \
config \
rstanarm \
brms \
loo \
tidybayes \
bayesplot \
posterior \
rstantools \
projpred \
shinystan \
future \
yaml \
reshape2 \
testthat \
targets
RUN strip /usr/local/lib/R/site-library/*/libs/*.so