Only To: Software developers in Linux.
Linux use “module” to manage its functions, that is our working env (including: kernel, libs, tools…).
Below are some basic “module” commands, you need to know in your daily work.
List modules already loaded into your environment.
· module list
· Note:
o Some modules may be loaded automatically by other modules.
o And some tools (like “source build_init.sh”, “git_setup.sh”) will also unload/load some needed modules automatically.
o So “module list” may give different output for shell windows, which have run: “source build_init.sh”.
Load modules
· module load - load modules into your working shell window temporally.
o Like: module load git/1.7.6; module load tp_isa_be/current
o Note: modules loaded by “module load” are only valid in your working shell window. They will disappear after you close the window, and are not valid in other shell windows.
· module initadd – load modules permanently (be added into your login bash, thus can be loaded automatically whenever you open a new shell window).
o Like: module initadd java/1.6.0
· Edit your login bash, to let some modules be loaded automatically. Refer to: How to setup your linux account
Unload modules
· Module unload – unload modules from your working shell window
o Like: module unload git/1.7.5
· Edit your login bash, remove “module load …” from there. Refer to: How to setup your linux account
Check available modules
· module avail [-a] [my_module] - list [all] available modules
o Like: module avail [-a] tww/perl
o Then you can select a specific version to load. Like: module load tww/perl/5.8.8
Q&A:
1. How to solve module confilct?
Some times, you may meet below error/warning, like: “WARNING: git/1.7.6 cannot be loaded due to a conflict. HINT: Might try module unload git first”. Then you need to open your login bash (~/.env/user.bashrc) to check, and unload some un-needed modules using “module unload xxx”.