Skip to content

mrgsolve Installation

Kyle Baron edited this page Feb 27, 2017 · 41 revisions

Prerequisites

  • R: https://cran.r-project.org/
    • Currently R >= 3.1.2 is required
    • IMPORTANT Install R in a location such that no spaces are in the path to R executable; this is usually not an issue on unix type machines (linux or MacOSX) but can cause problems on windows. This means, do not install R in c:\Program Files; you won't be able to install packages from source or compile your model. For reference see this answer on SO.
  • Seriously consider running in Rstudio if possible. This is not required but is recommended.
  • Compilers: C++ and gfortran (see the Compilers section below)

Compilers

There is a separate wiki page for information on compilers required to use mrgsolve. Please visit that page and make sure the compiler is properly installed before proceeding to the next steps.

Installing the mrgsolve R package

It is recommended to install mrgsolve with the devtools package.

install.packages("devtools")

Use the install_github function.

devtools::install_github("metrumresearchgroup/mrgsolve", type="source")

See the releases page to download a specific release. Be sure to download the tarball (e.g. mrgsolve_x.y.z.tar.gz). To install from the tarball use:

install.packages("mrgsolve_x.y.z.tar.gz", repos=NULL)

If you are interested in testing a certian feature that is only available on the dev branch, use

devtools::install_github("metrumresearchgroup/mrgsolve", ref="dev")

Dependencies

Installing mrgsolve via devtools::install_github will also install required dependencies. It is best practice to use the most recent version of mrgsolve and recent versions of all depencencies.

An important note: always install Rcpp and RcppArmadillo from source

install.packages(c("Rcpp", "RcppArmadillo"), type="source")

For more / specific information on dependencies, see this page.

Test the installation

library(mrgsolve)
?mrgsolve
example("mrgsolve")

Upgrading to a new version

Users are encouraged to re-install or re-compile Rcpp and RcppArmadillo prior to upgrading to a new version of mrgsolve. To upgrade mrgsolve, simply install again from GitHub.


© 2017 Metrum Research Group, LLC
www.metrumrg.com
Clone this wiki locally