Skip to content
Dan Kelley edited this page Mar 27, 2022 · 15 revisions
  1. Install docker from its website https://docs.docker.com/get-docker/
  2. Get the image for R-devel with clang, on debian
docker pull rhub/debian-clang-devel
  1. Verify that you have it, with
docker images
  1. Run the image, with
docker run -it --rm rhub/debian-clang-devel

and you will be in a linux session. NOTE: the --rm will remove whatever you do in the session. I don't know why the heck I just did that, but I need to stay in this session until I'm done debugging oce, because otherwise I'll need to reinstall quite a few system libraries using apt and quite a few R packages. Sheesh.

  1. Install git with
apt install git-core
  1. Clone oce with
git clone https://github.com/dankelley/oce.git

(note that you can use git clone git@ETC if you have local keys set up). Doing that would let you push changes.

  1. Now ... build it
opt/R-devel/bin/R CMD build oce

but note that you'll need to install other packages first. (FIXME: does the --rm means we need to redo this in each session?) Here are some things I had to do at the system level

apt install git-core
apt install libssl-dev
apt install libudunits2-dev
apt install libgdal-dev
apt install vim

and at the R level, I had to install lots of things, at least the following (but likely many more that I've forgotten ... I'll add to this list if I recall them).

install.packages(c('akima', 'automap', 'knitr', 'lubridate',
    'marmap', 'ncdf4', 'ocedata',
    'raster', 'rgeos', 'rmarkdown', 'RSQLite', 'R.utils',
    's2', 'sf', 'sp',
    'testthat', 'tiff', 'XML'))

but there could be a dozen more. I need to figure out how to make my own docker container, in which I do that stuff.

  1. Now you may use
opt/R-devel/bin/R

to launch R. The normal course of events would be to work interactively, but at some point you will want to do the following.

/opt/R-devel/bin/R CMD build oce
/opt/R-devel/bin/R CMD check oce_1.7-3.tar.gz
/opt/R-devel/bin/R CMD INSTALL oce_1.7-3.tar.gz