|
| 1 | +# R packages |
| 2 | + |
| 3 | +!!! note |
| 4 | + Please keep in mind that this is not general documentation |
| 5 | + about installing `R` packages, but specific information about |
| 6 | + self-installed R packages at the {{ hpcinfra }}. |
| 7 | + |
| 8 | +The {{ hpcinfra }} contains different generations of CPUs, with different microarchitectures, that are |
| 9 | +not necessarily compatible with each other. Additionally, we have |
| 10 | +multiple versions of `R` installed with different versions of toolchains, and by default, |
| 11 | +self-installed packages are installed in separate directories based only |
| 12 | +on `R` major and minor versions (only using `x.y` for R version `x.y.z`). |
| 13 | + |
| 14 | +In this way, you might use self-installed `R` packages on incompatible CPU microarchitectures and/or |
| 15 | +compiled with incompatible toolchains, or for a different major version of the operating system, |
| 16 | +which might lead to hangs or other types of errors. |
| 17 | + |
| 18 | +Since end of February 2025, we make sure that `R` packages that you install yourself will be installed |
| 19 | +in a directory that is specific to the operating system version, CPU microarchitecture, toolchain, |
| 20 | +and `R` version that is being used. The location of this directory by default is |
| 21 | +(by setting `$R_LIBS_USER` environment variable to) |
| 22 | +`$VSC_DATA/local_R_LIBS/$VSC_OS_LOCAL/$VSC_ARCH_LOCAL/<R version>-<toolchain>`. |
| 23 | + |
| 24 | +### Controlling the location for self-installed R packages |
| 25 | + |
| 26 | +If you would like to have another location (for example you are using a central location |
| 27 | +in your Virtual Organisation), you should set the environment variable `$R_LIBS_BASEDIR` to the desired location |
| 28 | +*before* you load any centrally installed `R` module. In this case, the location of the |
| 29 | +directory for self-installed `R` packages will be |
| 30 | +`$R_LIBS_BASEDIR/local_R_LIBS/$VSC_OS_LOCAL/$VSC_ARCH_LOCAL/<R version>-<toolchain>`. |
| 31 | +If this directory is not writable, you will still be able to use already installed |
| 32 | +`R` packages from that location, but you will not be able to install `R` packages |
| 33 | +yourself. |
| 34 | + |
| 35 | +You can always check the default location(s) of `R` packages by issuing `.libPaths()` command |
| 36 | +in `R`. This command will show the package locations, ordered by their priorities. |
| 37 | + |
| 38 | +### Missing R packages intalled before |
| 39 | + |
| 40 | +Please be aware that if you have installed `R` packages yourself before end of February 2025, |
| 41 | +then you have to reinstall all of them. You might have to reinstall self |
| 42 | +installed `R` packages if you want to use them: |
| 43 | + |
| 44 | +- on a different cluster |
| 45 | +- with a different version of `R` |
| 46 | +- with an `R` compiled with a different version of toolchain |
| 47 | +- if the operating system was changed/updated. |
| 48 | + |
0 commit comments