rhub icon indicating copy to clipboard operation
rhub copied to clipboard

Docker image with gcc11

Open gaborcsardi opened this issue 4 years ago • 7 comments

Would be nice.

gaborcsardi avatar Oct 21 '20 11:10 gaborcsardi

Thank you very much for the v quick response @gaborcsardi! More context here https://github.com/r-spatial/s2/issues/79#issuecomment-712812605.

jefferis avatar Oct 21 '20 11:10 jefferis

Managed to compile gcc 11, in ~ 6 hours. Compiled R as well, all seems fine. So I can create a Docker container and also an R-hub builder for this tomorrow.

gaborcsardi avatar Oct 21 '20 23:10 gaborcsardi

Super! @appelmar FYI.

jefferis avatar Oct 22 '20 07:10 jefferis

OK here is an image that you can use: https://hub.docker.com/r/rhub/debian-gcc11-devel It has gcc 11 and R. Still needs some fine tuning, there is no Tcl/tk and no LaTeX, either, but you can use it for testing, hopefully.

gaborcsardi avatar Oct 22 '20 23:10 gaborcsardi

Thanks so much for this @gaborcsardi! I am not very experienced with Docker. I tried to get it to run like so

(base) Gregs-MBP-2:gcc11-docker jefferis$ docker run rhub/debian-gcc11-devel R
Fatal error: you must specify '--save', '--no-save' or '--vanilla'
(base) Gregs-MBP-2:gcc11-docker jefferis$ docker run rhub/debian-gcc11-devel bash

terminates immediately without error. I think it is something to do with waiting for use input.

Then I started the session from the Docker app and attached to the container and that seemed to work. At which point I tried to install Rcpp, the main dependency for the package I want to test. That failed because make is not installed. Do I need to set up some additional path? Thanks again!

> install.packages("Rcpp")
--- Please select a CRAN mirror for use in this session ---
Secure CRAN mirrors 

 1: 0-Cloud [https]
 [snip ...]

Selection: 1
trying URL 'https://cloud.r-project.org/src/contrib/Rcpp_1.0.5.tar.gz'
Content type 'application/x-gzip' length 2950521 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** using staged installation
** libs
sh: 1: make: not found
Warning in system(cmd) : error in running command
ERROR: compilation failed for package 'Rcpp'
* removing '/usr/local/lib/R/library/Rcpp'

The downloaded source packages are in
	'/tmp/RtmpyrTE5y/downloaded_packages'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Rcpp") :
  installation of package 'Rcpp' had non-zero exit status
> Sys.getenv("PATH")
[1] "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

jefferis avatar Oct 23 '20 23:10 jefferis

docker run -ti rhub/debian-gcc11-devel bash

starts an interactive shell. You might need to install some Debian packages, e.g.

apt-get install make

gaborcsardi avatar Oct 24 '20 07:10 gaborcsardi

Thanks so much again @gaborcsardi. I was able to solve my problem making use of this image. Here are the steps in case this of use to others. First make a Dockerfile inside an empty directory that looks like this

FROM rhub/debian-gcc11-devel
RUN apt-get update \
  && apt-get install -y --no-install-recommends \
  make \
  locales \
  bash-completion \
  g++-multilib

# NB I think g++-multilib uses gcc10 which is all wrong, but solves the multilib issue

RUN mkdir ~/.R
RUN echo 'CCFLAGS = -Wall -pedantic -O2' >> ~/.R/Makevars && \
    echo 'CXXFLAGS = -Wall -pedantic -O2' >> ~/.R/Makevars && \
	echo 'CXX11FLAGS = -Wall -pedantic -O2' >> ~/.R/Makevars && \
	echo 'MAKEFLAGS = -j6' >> ~/.R/Makevars

RUN echo 'options(repos="https://cloud.r-project.org")' > ~/.Rprofile

CMD ["bash"]

Then nb -v links the place that I had my R source files

docker build -t nat-r-gcc11 . && docker run -ti -v ~/dev/R/:/home/R/ nat-r-gcc11

then once inside docker

Rscript -e 'install.packages(c("Rcpp", "testthat"))'
cd /home/R
_R_CHECK_FORCE_SUGGESTS_=FALSE R CMD check --no-manual dracor_0.2.3.tar.gz

jefferis avatar Oct 24 '20 17:10 jefferis

This issue is about the previous R-hub system, it does not apply to the new system, so I am closing it now. Please see https://r-hub.github.io/rhub/ for the new system, R-hub v2.

gaborcsardi avatar May 09 '24 12:05 gaborcsardi