Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux_environment_modules [2019/03/18 18:17]
ktm5j
linux_environment_modules [2021/12/21 18:30]
Line 1: Line 1:
-====== Environment Modules ====== 
  
-[[http://​modules.sourceforge.net|Environment Modules]] are designed to manage custom package installations. ​ Software in our department is all installed to a network filesystem mounted over NFS where each package available is installed to it's own directory. ​ This allows us to manage a wide range of software across different Linux distributions without users having to deal with any configuration. ​ We can include different versions of software, letting users choose which they want to use. 
- 
-===== Available Modules ===== 
- 
-Please see [[linux_modules:​start|Available Modules]] for a listing of available software. 
- 
-===== Using Modules ===== 
- 
-On any Linux system in our department, you can run ''​%%module avail%%''​ from your shell to get a list of available software. 
- 
-<​code>​ 
-ktm5j@applecake ~ $ module avail 
- 
------------------------- /​sw/​centos/​Modules/​modulefiles ------------------------ 
-altera_pro ​      ​modelsim_ae ​     php7             ​python3.6.2 
-cuda-toolkit-9.0 modelsim_ase ​    ​php7.1.10 ​       qsys 
-emacs            nios2eds ​        ​python ​          ​quartus 
-matlab ​          ​php ​             python3 
-</​code>​ 
- 
-After deciding what software you want to use, load the package using''​%%module load%%''​. ​ Now the software is ready to use. 
- 
-<​code>​ 
-ktm5j@applecake ~ $ module load python3 
-ktm5j@applecake ~ $ which python 
-/​sw/​centos/​python/​3.6.2/​bin/​python 
-ktm5j@applecake ~ $ python 
-Python 3.6.2 (default, Oct  6 2017, 13:​03:​05) ​ 
-[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux 
-Type "​help",​ "​copyright",​ "​credits"​ or "​license"​ for more information. 
->>>​ 
-</​code>​ 
- 
-After loading several modules in your session, ''​%%module list%%''​ will show what modules have been loaded. 
- 
-<​code>​ 
-ktm5j@applecake ~ $ module load matlab 
-ktm5j@applecake ~ $ module load php 
-ktm5j@applecake ~ $ module list 
-Currently Loaded Modulefiles:​ 
-  1) matlab ​   2) python3 ​  3) php 
-</​code>​ 
- 
-''​%%module display%%''​ will show specific information about the environment variables that will be modified by a module. 
- 
-<​code>​ 
-ktm5j@applecake ~ $ module display python 
-------------------------------------------------------------------- 
-/​sw/​centos/​Modules/​modulefiles/​python:​ 
-  
-module-whatis Python current ​ 
-prepend-path PATH /​sw/​centos/​python/​current/​bin ​ 
-prepend-path LD_LIBRARY_PATH /​sw/​centos/​python/​current/​lib ​ 
-prepend-path LD_INCLUDE_PATH /​sw/​centos/​python/​current/​include ​ 
-prepend-path MANPATH /​sw/​centos/​python/​current/​share/​man ​ 
-------------------------------------------------------------------- 
-ktm5j@applecake ~ $ echo $LD_LIBRARY_PATH ​ 
-/​sw/​centos/​python/​3.6.2/​lib 
-</​code>​ 
- 
-You can ''​%%switch%%'',​ changing one version of software for another, or ''​%%unload%%''​ modules when you are done or no longer want this software. 
- 
-<​code>​ 
-ktm5j@applecake ~ $ module switch python3 python2 
-ktm5j@applecake ~ $ module unload php 
-</​code>​ 
- 
-===== Things to keep in mind ===== 
- 
-==== Shell Scripting/​Slurm Batch ==== 
- 
-If you write shell scripts or slurm batch files that make use of these software packages, remember that you must still load modules from inside of your script. ​ For example, your script must contain the line ''​%%module load python3%%''​ before you can use python from inside of your script. 
- 
-**Note:** If you are having trouble loading modules from inside SLURM, try including the following line in your script **before** loading any modules: 
- 
-<code bash> 
-source /​etc/​profile.d/​modules.sh 
-</​code>​ 
  • linux_environment_modules.txt
  • Last modified: 2022/01/31 19:22
  • (external edit)