Skip to content

Commit 9bd1674

Browse files
authored
Merge pull request hpcugent#877 from hajgato/Rlibs
add R module set R package location docs
2 parents 804b988 + 873cdca commit 9bd1674

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

config/templates/hpc.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ nav:
5959
- OpenFOAM: openFOAM.md
6060
- Python: python.md
6161
- Python virtual environments: setting_up_python_virtual_environments.md
62+
- R packages: r-packages.md
6263
- Transcribe: transcribe.md
6364
- VS Code Tunnel: vscodetunnel.md
6465
- FAQ:

mkdocs/docs/HPC/r-packages.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

Comments
 (0)