Skip to content

Commit

Permalink
Adding docker check (trying to)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Sep 5, 2023
1 parent 5a6baf3 commit 8c58386
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Makefile
defm\.code-workspace
README\.html
paper/
\.vscode
\.vscode
^docker$
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ inst/NEWS: NEWS.md

# Thanls to Dirk Eddelbuettel for the Dockerfile
# https://dirk.eddelbuettel.com/blog/2015/01/18/
docker-check: clean build
docker run --rm -ti -v $(PWD):/mnt -w/mnt \
--cap-add=SYS_PTRACE \
rocker/r-devel-san \
make littler-install-deps

littler-install-deps:
apt update && apt install --no-install-suggests -y libssl-dev && \
RDscript --vanilla -e 'install.packages(c("Rcpp", "texreg"), repos = "https://cloud.r-project.org")' && \
RD CMD check --as-cran defm_0.1-1.tar.gz
docker-check:
docker run --rm -ti -v $(PWD):/mnt -w/mnt gvegayon/defm:latest make docker-check-all


# -fno-sanitize=float-divide-by-zero,vptr \
\ # -fno-sanitize-recover"
docker-check-all:
RD CMD build . && \
DEFM_CONFIG="-DBARRY_DEBUG -std=c++11 -fsanitize=address -L/usr/local/lib" \
RD CMD check defm_*.tar.gz
11 changes: 11 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM rocker/r-devel-san

RUN apt update && apt install --no-install-suggests -y libssl-dev

RUN RDscript --vanilla -e \
'install.packages(c("Rcpp", "texreg"), repos = "https://cloud.r-project.org")'

CMD ["bash"]



11 changes: 11 additions & 0 deletions docker/Dockerfile-clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM rocker/r-devel-ubsan-clang

RUN apt update && apt install --no-install-suggests -y libssl-dev

RUN RDscript --vanilla -e \
'install.packages(c("Rcpp", "texreg"), repos = "https://cloud.r-project.org")'

CMD ["bash"]



12 changes: 12 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
build: Dockerfile
docker build -t gvegayon/defm:latest .

build-clang: Dockerfile-clang
docker build -f Dockerfile-clang -t gvegayon/defm:clang .

run:
docker run --rm -ti -v $(PWD)/..:/mnt -w/mnt gvegayon/defm:latest bash




2 changes: 1 addition & 1 deletion src/Makevars.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) @OPENMP_FLAG@
PKG_CXXFLAGS=@OPENMP_FLAG@ -I../inst/include/ $(EPI_CONFIG) \
PKG_CXXFLAGS=@OPENMP_FLAG@ -I../inst/include/ $(DEFM_CONFIG) \
-Dprintf_barry=Rprintf
2 changes: 1 addition & 1 deletion src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

# This is necesary since ARMADILLO now supports OpenMP
PKG_CXXFLAGS=$(SHLIB_OPENMP_CXXFLAGS) -I../inst/include/ \
-Dprintf_barry=Rprintf
$(DEFM_CONFIG) -Dprintf_barry=Rprintf

# For testing
#PKG_CXXFLAGS=-Wall

0 comments on commit 8c58386

Please sign in to comment.