Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RDlto to test R with --enable-lto #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This repository contains a Dockerfile for creating an Docker image, `wch1/r-debu
* `RDcsan`: R-devel compiled with clang, Address Sanitizer and Undefined Behavior Sanitizer.
* `RDstrictbarrier`: R-devel compiled with `--enable-strict-barrier`. This can be used with `gctorture(TRUE)`, or `gctorture2(1, inhibit_release=TRUE)`.
* `RDthreadcheck`: R-devel compiled with `-DTHREADCHECK`, which causes it to detect if memory management functions are called from the wrong thread.
* `RDlto`: R-devel compiled with `--enable-lto`


See [Writing R Extensions](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Checking-memory-access) for more information about these builds (except for the threadcheck build, which is not documented there.)
Expand Down
1 change: 1 addition & 0 deletions buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ docker build -t wch1/r-debug-1 r-debug-1
docker build -t wch1/r-debug-2 r-debug-2
docker build -t wch1/r-debug-3 r-debug-3
docker build -t wch1/r-debug-4 r-debug-4
docker build -t wch1/r-debug-5 r-debug-5
docker build -t wch1/r-debug r-debug
1 change: 1 addition & 0 deletions debugging-r.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The r-debug docker image contains the following:
* `RDcsan`: R-devel compiled with clang, Address Sanitizer and Undefined Behavior Sanitizer.
* `RDstrictbarrier`: R-devel compiled with `--enable-strict-barrier`. This can be used with `gctorture(TRUE)`, or `gctorture2(1, inhibit_release=TRUE)`.
* `RDthreadcheck`: R-devel compiled with `-DTHREADCHECK`, which causes it to detect if memory management functions are called from the wrong thread.
* `RDlto`: R-devel compiled with `--enable-lto`

Each of the builds of R has its own libpath, so that a package installed with one build will not be accidentally used by another. Each one comes with devtools and Rcpp installed.

Expand Down
9 changes: 9 additions & 0 deletions r-debug-5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# To build from the parent directory:
# docker build -t wch1/r-debug-5 r-debug-5

FROM wch1/r-debug-4

# RDlto: R built with --enable-lto
RUN /tmp/buildR.sh lto
RUN RDlto -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")'
RUN RDlto -q -e 'pak::pkg_install(c("devtools", "Rcpp", "roxygen2", "testthat", "memoise", "rmarkdown"))'
2 changes: 1 addition & 1 deletion r-debug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# To build from the parent directory:
# docker build -t wch1/r-debug r-debug

FROM wch1/r-debug-4
FROM wch1/r-debug-5

# RDthreadcheck: Make sure that R's memory management functions are called
# only from the main R thread.
Expand Down
4 changes: 4 additions & 0 deletions r-devel/buildR.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ elif [[ "$1" = "threadcheck" ]]; then
export CFLAGS="${CFLAGS} -DTHREADCHECK"
export CXXFLAGS="${CXXFLAGS} -DTHREADCHECK"
configure_flags="--without-recommended-packages"

elif [[ "$1" = "lto" ]]; then
suffix="lto"
configure_flags="--enable-lto"
fi

dirname="RD${suffix}"
Expand Down