Skip to content

mrgsolve Installation

Kyle Baron edited this page Apr 26, 2019 · 41 revisions

Installation guide

Prerequisites

  • R: https://cran.r-project.org/
    • Currently R >= 3.1.2 is required
  • Seriously consider running in Rstudio if possible. This is not required but is recommended.
  • Compilers: C++ and gfortran (see the Compilers section below)

Compilers

Current versions of C++ and FORTRAN compilers are required to use mrgsolve. Available compilers and requirements may vary by operating system. Please see system-specific instructions below. But note well that the toolchain that needs to be in place is the usual toolchain required for ordinary use of R (either to compile R from source or to compile R packages from source). There is very detailed and complete information on compilers to use with R on the r-project website (https://cran.r-project.org/doc/manuals/R-admin.html and see links below). There are no special compiler requirements to get mrgsolve up and running; just install the compilers you would normally need to use with R and mrgsolve will compile and you will be able to compile your mrgsolve models.

Windows users

You need to download and properly install the Windows toolset (Rtools). Do not use any compiler other than the one provided by the r-project. You MUST use Rtools. Please update to a recent version even if you think you already have it installed.

Tips for installing the Rtools toolchain

These tips are based on many hours spent helping people install Rtools for Windows properly.

  • Download RtoolsXX.exe from this page
    • XX is the version number (e.g. Rtools35.exe)
    • Get the version number that corresponds to your version of R
    • Do not get a version that is not frozen yet; experience has told us that the latest / newest version isn’t at all the best
  • Install RtoolsXX.exe
    • When you are installing, pay attention for a prompt asking about changing the PATH; make sure that the installer updates PATH; you might have to opt in to this path modification
  • Check your PATH environment variable in R
    • Use the command Sys.getenv("PATH") in R, after restarting to make sure the proper directories are listed there. R will not find the toolchain unless the PATH is correctly
    • If PATH is not properly set, try to set it with a system-wide environment variable
    • If a system-wide environment variable is not posible, there are some other options here
  • Common error messages from incorrect Windows installs can be found here

See also

Mac OSX users

Install C++ and gfortran compilers found here: https://cran.r-project.org/bin/macosx/tools/

Unix users

UNIX usually include C++ and FORTRAN compliers. If not, install gcc.

Test the installation

library(mrgsolve)
?mrgsolve
example("mrgsolve")
Clone this wiki locally