getCondaDir: Get the 'basilisk' Conda directory

Description Usage Arguments Details Value Author(s) Examples

View source: R/getCondaDir.R

Description

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

Usage

1
getCondaDir(installed = TRUE)

Arguments

installed

Logical scalar indicating whether basilisk is already installed.

Details

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

If the BASILISK_EXTERNAL_CONDA environment variable is set to a path to an existing conda instance, the function will return it directly without modification. This allows users to use their own conda 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 conda and basilisk re-installations are synchronized. It also ensures that any R process that can load basilisk will also have permissions to access the conda instance, which makes life easier for sysadmins of clusters or other shared resources.

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

Value

String containing the path to the conda instance.

Author(s)

Aaron Lun

Examples

1
2
3
4
5
6
7
8
# 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)

getCondaDir(installed=FALSE)

Sys.setenv(BASILISK_USE_SYSTEM_DIR=old)

LTLA/basilisk.utils documentation built on June 10, 2021, 8:41 p.m.