This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
environment_modules [2021/06/29 16:19] root |
environment_modules [2022/01/26 09:52] (current) root |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Environment Modules ===== | ===== Environment Modules ===== | ||
- | **This page applies only to the new cluster.** | + | Environment modules allow you to control which software (and which version of that software) is available in your environment. For instance, at the time of writing, |
- | + | ||
- | Environment modules allow you to control which software (and which version of that software) is available in your environment. For instance the new cluster has 4 different version of standard R installed: 3.5.3 | + | |
- | , 3.6.3, 4.0.5, 4.1.0. When you first log in and try to run R the OS will respond with " | + | |
< | < | ||
Line 30: | Line 27: | ||
</ | </ | ||
- | There' | + | There' |
< | < | ||
Line 61: | Line 58: | ||
</ | </ | ||
- | ==== Where to Load Modules | + | |
+ | ==== Where run Module | ||
You have several options as to where to use " | You have several options as to where to use " | ||
Line 78: | Line 76: | ||
* This might be a good way to specify what programs/ | * This might be a good way to specify what programs/ | ||
* You could have your scripts source the list of programs needed for the pipeline rather than explicitly listing module load commands in each script. | * You could have your scripts source the list of programs needed for the pipeline rather than explicitly listing module load commands in each script. | ||
+ | |||
==== Module Conflicts ==== | ==== Module Conflicts ==== | ||
Line 91: | Line 90: | ||
This would generate an error because of the latest version of R already being loaded. | This would generate an error because of the latest version of R already being loaded. | ||
- | So, in your script you should | + | So, in your script you could unload R before loading the new version. |
< | < | ||
Line 130: | Line 129: | ||
In most cases, modules is just a nice easy way of updating you PATH. So it seems preferable to use the module command rather than updating your PATH explicitly. | In most cases, modules is just a nice easy way of updating you PATH. So it seems preferable to use the module command rather than updating your PATH explicitly. | ||
+ | |||
==== Special Purpose Modules ==== | ==== Special Purpose Modules ==== | ||
Line 139: | Line 139: | ||
* This can lead to confusion if you have programs or scripts with the same name in different directories and forget where you are. | * This can lead to confusion if you have programs or scripts with the same name in different directories and forget where you are. | ||
+ | * use.own | ||
+ | * This module allows you to use modulefiles of your own. | ||
+ | * Try " | ||
+ | |||
+ | ==== Oddities and Exceptions ==== | ||
+ | |||
+ | === Python and Perl === | ||
+ | |||
+ | Since various OS level tools need python and perl there are versions of these languages installed system-wide. No module needed. These are python3 (version 3.8.5) and perl (version 5.30.0). You are welcome to use these, but there are also modules with slightly different versions: | ||
+ | |||
+ | * python 2.7.18 for older software that requires python2 | ||
+ | * python 3.9.5 | ||
+ | * perl 5.34.0 | ||
+ | |||
+ | The system-wide python is accessible only as " | ||
+ | |||
+ | Python and perl packages that users request will be installed into the module versions of these programs. You can install python and perl packages locally as you wish (using any of these versions). | ||
More information about environment modules can be found here: https:// | More information about environment modules can be found here: https:// | ||
+ | |||
+ | |||
+ | === Installing R Packages === | ||
+ | |||
+ | If you try to install an R package (as an ordinary user) and get a " | ||
+ | |||
+ | < | ||
+ | * installing to library '/ | ||
+ | Error: ERROR: no permission to install to directory '/ | ||
+ | </ | ||
+ | |||
+ | Then you might need to create the correct directory for R to use for package installation within your home directory. For R 4.1.0 this would be: | ||
+ | |||
+ | ~/ | ||
+ | |||
+ | Where " | ||
+ | |||
+ | You can create the directory from the command line, like this: | ||
+ | |||
+ | < | ||
+ | cd | ||
+ | mkdir -p ~/ | ||
+ | </ | ||
+ | |||
+ | Or you can do it from within R, and then you won't need to know any details like the specific version number - the R program that you have started will fill them in for you: | ||
+ | |||
+ | < | ||
+ | dir.create(Sys.getenv(" | ||
+ | </ | ||
+ | |||
+ | === Rscript and the "# | ||
+ | |||
+ | If you have used | ||
+ | |||
+ | < | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | as the first line of your R scripts so that you can run them just like programs on the old cluster, they will no longer work on the new cluster. This is because there is no interpreter at / | ||
+ | |||
+ | On the new cluster you should load an R module (possibly from within your .bashrc file so that R is always available when you log in), and then use: | ||
+ | |||
+ | < | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | at the top of your R scripts. | ||
+ | |||