Skip to content
Ceres Barros edited this page Aug 15, 2023 · 17 revisions

Prerequisites

To run development modules etc., users will need to have installed R, Rstudio and SpaDES.

Install R

Windows

  1. Download and run the R installer (as administrator!).
  2. Download and install the latest Rtools (as administrator!). Be sure to check the "add rtools to PATH" option during installation if necessary (Rtools v4.0).

macOS

  1. Download and run the R installer from https://cran.r-project.org/bin/macosx.

  2. Install Xcode commandline tools from the terminal:

    xcode-select --install
  3. Install homebrew from the terminal (instructions at https://brew.sh/)

  4. Install GDAL and other spatial packages (instructions at https://www.alexchubaty.com/post/2020-01-08-using-latest-gdal-macos-redux/)

  5. Install OpenMP support for data.table:

    brew update && brew install llvm
  6. Install GLPK (needed for full igraph functionality; used with SpaDES.core::moduleGraph):

    brew install glpk

    Then, reinstall igraph from source so it is compiled with GLPK:

    install.packages("igraph", type = "source")

Linux

Install via apt or yum depending on your distribution. Instructions for Ubuntu 18.04 LTS are shown below.

  1. Install R and its development libraries:

    sudo apt install r-base r-base-dev
  2. Install java and configure R to use it:

    sudo apt build-dep -y r-cran-rjava
    sudo R CMD javareconf
  3. Install dependencies for spatial and other packages:

    sudo apt build-dep -y r-cran-tkrplot
    
    sudo apt-get install -y \
      ccache \
      gdal-bin \
      git \
      libcairo2-dev \
      libcurl4-gnutls-dev \
      libgdal-dev \
      libgeos-dev \
      libgit2-dev \
      libgmp-dev \
      libjq-dev \
      libmagick++-dev \
      libproj-dev \
      libprotobuf-dev \
      libprotoc-dev \
      libssh2-1-dev \
      libssl-dev \
      libudunits2-dev \
      libv8-dev \
      libxml2-dev \
      libxt-dev \
      pandoc \
      pandoc-citeproc \
      protobuf-compiler \
      python-gdal \
      python3-gdal \
      curl \
      r-cran-littler

Install Rstudio

Download and run the installer for your operating system from https://www.rstudio.com/products/rstudio/download/#download.

Install SpaDES and other packages

Use the SpaDES.install package.

if (!require("Require", quietly = TRUE)) {
  # install.packages("Require") ## current CRAN version errors; devel version warns but doesn't fail

  ## use development version from GitHub
  install.packages("remotes")
  remotes::install_github("PredictiveEcology/Require@development")
  library(Require)
}

Require("PredictiveEcology/SpaDES.install@development")

installSpaDES() ## will install to your default librayr path; see .libPaths()
## adjust this as needed
modulePath <- "modules"
makeSureAllPackagesInstalled(modulePath)