getBasiliskDir {basilisk.utils}R Documentation

Get the basilisk Miniconda directory

Description

Find the installation directory for the basilisk-managed Miniconda instance.

Usage

getBasiliskDir(installed = TRUE)

Arguments

installed

Logical scalar indicating whether basilisk is already installed.

Details

By default, Miniconda is installed to a location specified by getExternalDir. This ensures that R package build systems do not attempt to generate binaries that include the Miniconda installation; such binaries are not relocatable due to the presence of hard-coded paths, resulting in run-time failures.

If the BASILISK_EXTERNAL_ANACONDA environment variable is set to a path to an existing Miniconda installation, the function will return it directly without modification. This allows users to use their own Miniconda instances with basilisk but, in turn, they are responsible for managing it.

If the BASILISK_USE_SYSTEM_DIR environment variable is set to "1", the function will return a path to a location inside the basilisk system installation directory. This is the ideal approach when installing from source as any Miniconda and basilisk re-installations are synchronized. It also ensures that any R process that can load basilisk will also have permissions to access the Miniconda instance, which makes life easier for sysadmins of clusters or other shared resources.

We suggest always calling this function after an installMiniconda call, which guarantees the presence of the Miniconda installation directory (or dies trying). Setting installed=FALSE should only happen inside the basilisk configure script.

Value

String containing the path to the Miniconda instance.

Author(s)

Aaron Lun

Examples

# Setting the environment variable to run this example: 
# all other modes rely on installation of basilisk.
old <- Sys.getenv("BASILISK_USE_SYSTEM_DIR")
Sys.setenv(BASILISK_USE_SYSTEM_DIR=1)

getBasiliskDir(installed=FALSE)

Sys.setenv(BASILISK_USE_SYSTEM_DIR=old)

[Package basilisk.utils version 1.0.4 Index]