-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_fedora_clang_san
49 lines (37 loc) · 1.73 KB
/
Dockerfile_fedora_clang_san
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
# slight modification of https://github.com/r-hub/rhub-linux-builders/tree/master/fedora-clang-devel-san
FROM mlampros/fedora_clang:latest
ENV CRAN=http://cran.r-project.org
RUN cd /tmp \
&& svn co https://svn.r-project.org/R/trunk R-devel
ENV RPREFIX=/opt/R-devel
ENV ROPTIONS="--with-x --with-recommended-packages --enable-R-shlib --enable-R-static-lib"
ENV CC=/usr/bin/clang
ENV CXX=/usr/bin/clang++
ENV F77=gfortran
ENV CPP=cpp
RUN yum -y install rsync
RUN dnf install -y libcxx-devel
RUN cd /tmp/R-devel \
&& ./tools/rsync-recommended \
&& R_PAPERSIZE=letter \
R_BATCHSAVE="--no-save --no-restore" \
CC="clang -fsanitize=address,undefined -fno-sanitize=float-divide-by-zero -fno-omit-frame-pointer" \
CXX="clang++ -stdlib=libc++ -fsanitize=address,undefined -fno-sanitize=float-divide-by-zero -fno-omit-frame-pointer" \
CFLAGS="-g -O3 -Wall -pedantic -mtune=native" \
FFLAGS="-g -O2 -mtune=native" \
FCFLAGS="-g -O2 -mtune=native" \
CXXFLAGS="-g -O3 -Wall -pedantic -mtune=native" \
MAIN_LD="clang++ -stdlib=libc++ -fsanitize=undefined,address" \
R_OPENMP_CFLAGS=-fopenmp \
./configure --prefix=${RPREFIX} ${ROPTIONS} \
&& make \
&& make install
# 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'
ENV PATH=${RPREFIX}/bin:$PATH
RUN cd $RPREFIX/bin \
&& mv R Rdevel \
&& cp Rscript Rscriptdevel \
&& ln -s Rdevel RDsan \
&& ln -s Rscriptdevel RDscriptsan