-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
117 lines (105 loc) · 3.28 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
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
## Emacs, make this -*- mode: sh; -*-
## start with the Docker 'base R' Debian-based image
FROM r-base:latest
## This handle reaches Carl and Dirk
MAINTAINER "Carl Boettiger and Dirk Eddelbuettel" [email protected]
## Remain current
RUN apt-get update -qq \
&& apt-get dist-upgrade -y
## From the Build-Depends of the Debian R package, plus subversion
RUN apt-get update -qq \
&& apt-get install -t unstable -y --no-install-recommends \
bash-completion \
bison \
debhelper \
default-jdk \
g++ \
gcc \
gfortran \
groff-base \
libblas-dev \
libbz2-dev \
libcairo2-dev \
libcurl4-openssl-dev \
libjpeg-dev \
liblapack-dev \
liblzma-dev \
libncurses-dev \
libpango1.0-dev \
libpcre2-dev \
libpng-dev \
libreadline-dev \
libtiff5-dev \
libx11-dev \
libxt-dev \
mpack \
subversion \
tcl8.6-dev \
texinfo \
texlive-base \
texlive-extra-utils \
texlive-fonts-extra \
texlive-fonts-recommended \
texlive-plain-generic \
texlive-latex-base \
texlive-latex-extra \
texlive-latex-recommended \
tk8.6-dev \
valgrind \
x11proto-core-dev \
xauth \
xdg-utils \
xfonts-base \
xvfb \
zlib1g-dev
## Check out R-devel
RUN cd /tmp \
&& svn co https://svn.r-project.org/R/trunk R-devel
## Build and install according the standard 'recipe' I emailed/posted years ago
## Updated compiler flags to match https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt
RUN cd /tmp/R-devel \
&& R_PAPERSIZE=letter \
R_BATCHSAVE="--no-save --no-restore" \
R_BROWSER=xdg-open \
PAGER=/usr/bin/pager \
PERL=/usr/bin/perl \
R_UNZIPCMD=/usr/bin/unzip \
R_ZIPCMD=/usr/bin/zip \
R_PRINTCMD=/usr/bin/lpr \
LIBnn=lib \
AWK=/usr/bin/awk \
CC="gcc -std=gnu99 -fsanitize=undefined -fno-omit-frame-pointer" \
FFLAGS="-g -O2 -mtune=native" \
FCFLAGS="-g -O2 -mtune=native" \
CXX="g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer" \
CXXFLAGS="-g -O2 -Wall -pedantic -mtune=native" \
CXX11FLAGS="-g -O2 -Wall -pedantic -mtune=native" \
CXX14FLAGS="-g -O2 -Wall -pedantic -mtune=native" \
CXX17FLAGS="-g -O2 -Wall -pedantic -mtune=native" \
MAIN_LDFLAGS="-fsanitize=undefined -pthread" \
F77="gfortran -fsanitize=undefined" \
FC="gfortran -fsanitize=undefined" \
FCFLAGS="-g -O2 -mtune=native" \
FFLAGS="-g -O2 -mtune=native" \
./configure --enable-R-shlib \
--without-blas \
--without-lapack \
--with-readline \
--without-recommended-packages \
--program-suffix=dev \
--disable-openmp \
&& make \
&& make install \
&& make clean
## Set Renviron to get libs from base R install
RUN echo "R_LIBS=\${R_LIBS-'/usr/local/lib/R/site-library:/usr/local/lib/R/library:/usr/lib/R/library'}" >> /usr/local/lib/R/etc/Renviron
## Set default CRAN repo
RUN echo 'options("repos"="http://cloud.r-project.org")' >> /usr/local/lib/R/etc/Rprofile.site
## More verbose UBSAN/SAN output (cf #3) -- this is still somewhat speculative
## Entry copied from Prof Ripley's setup described at http://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt
ENV ASAN_OPTIONS 'alloc_dealloc_mismatch=0:detect_leaks=0:detect_odr_violation=0'
RUN cd /usr/local/bin \
&& mv R Rdevel \
&& mv Rscript Rscriptdevel \
&& ln -s Rdevel RD \
&& ln -s Rscriptdevel RDscript