| getBasiliskDir {basilisk.utils} | R Documentation |
Find the installation directory for the basilisk-managed Anaconda instance.
getBasiliskDir(installed = TRUE)
installed |
Logical scalar indicating whether basilisk is already installed. |
By default, Anaconda is installed to a location specified by getExternalDir.
This ensures that R package build systems do not attempt to generate binaries that include the Anaconda 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 Anaconda installation,
the function will return it directly without modification.
This allows users to use their own Anaconda 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 Anaconda and basilisk re-installations are synchronized.
It also ensures that any R process that can load basilisk will also have permissions to access the Anaconda instance,
which makes life easier for sysadmins of clusters or other shared resources.
We suggest always calling this function after an installAnaconda call,
which guarantees the presence of the Anaconda installation directory (or dies trying).
Setting installed=FALSE should only happen inside the basilisk configure script.
String containing the path to the Anaconda instance.
Aaron Lun
# 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)