The install_torsten() function attempts to download and install the latest release of Torsten. Installing a previous release or a new release candidate is also possible by specifying the version or release_url argument. See the first few sections of the CmdStan installation guide for details on the C++ toolchain required for installing CmdStan. install_torsten() does not automatically append to cpp_options for M1 Macs. It also does not provide support for WSL.

install_torsten(
  dir = NULL,
  cores = getOption("mc.cores", 2),
  quiet = FALSE,
  overwrite = FALSE,
  timeout = 1200,
  version = NULL,
  release_url = NULL,
  cpp_options = list(),
  check_toolchain = TRUE
)

Arguments

dir

(string) The path to the directory in which to install Torsten The default is to install it in a directory with a name generated by file.path(tools::R_user_dir("torsten")).

cores

(integer) The number of CPU cores to use to parallelize building CmdStan and speed up installation. If cores is not specified then the default is to look for the option "mc.cores", which can be set for an entire R session by options(mc.cores=value). If the "mc.cores" option has not been set then the default is 2.

quiet

(logical) Should the verbose output from the system processes be suppressed when building the Torsten binaries? The default is FALSE.

overwrite

(logical) Should Torsten still be downloaded and installed even if an installation of the same version is found in dir? The default is FALSE, in which case an informative error is thrown instead of overwriting the user's installation.

timeout

(positive real) Timeout (in seconds) for the build stage of the installation.

version

(string) The Torsten release version to install. The default is NULL, which downloads the latest stable release from https://github.com/metrumresearchgroup/Torsten/releases.

release_url

(string) The URL for the specific Torsten release or release candidate to install. See https://github.com/metrumresearchgroup/Torsten/releases. The URL should point to the tarball (.tar.gz file) itself, e.g., release_url="https://github.com/metrumresearchgroup/Torsten/archive/refs/tags/torsten_v0.90.0.tar.gz". If both version and release_url are specified then version will be used.

cpp_options

(list) Any makefile flags/variables to be written to the make/local file. For example, list("CXX" = "clang++") will force the use of clang for compilation.

check_toolchain

(logical) Should install_torsten() attempt to check that the required toolchain is installed and properly configured. The default is TRUE.

Examples

if (FALSE) {
install_torsten(cores = 4)

cpp_options <- list(
  "CXX" = "clang++",
  "CXXFLAGS+= -march=native",
  PRECOMPILED_HEADERS = TRUE
)
install_torsten(cores = 4, cpp_options = cpp_options)
}