Closed xuanweishan closed 11 months ago
Steps of installing Module:
curl -LJO https://github.com/cea-hpc/modules/releases/download/v5.1.1/modules-5.1.1.tar.gz
tar xfz modules-5.1.1.tar.gz
mkdir /software/modulefiles
cd modules-5.1.1
make clean
./configure --modulefilesdir=/software/modulefiles
make
make install
cp [module path]/init/profile.sh /etc/profile.d/modules.sh
cp [module path]/init/profile.csh /etc/profile.d/modules.csh
source [module path]/init/bash
Creating modulfiles (example):
#%Module1.0#
## Change library path to different version
remove-path LD_LIBRARY_PATH [origin_version_path]
append-path LD_LIBRARY_PATH [version_want_to_load]
## Change the command
set-alias [command] command1
Usage:
module load [modulefile/path]
Load modulefile
module unload [modulefile/path]
Unload modulefile
module list
Check loaded modulefiles
module avail
Check available modulefiles
Modulefiles in Taiwania Template:
#%Module1.0
##
## Modulename [modulename]
##
proc ModulesHelp {} {
puts stderr "/tAdd CUDA 10.2 to your environment variables"
}
module-whatis "\tAdd CUDA 10.2 to your environment variables"
remove-path LD_LIBRARY_PATH /software/cuda/default/lib64 --append-on-unload
set version 10.2
set root /software/cuda/10.2
prepend-path PATH $root/bin
prepend-path LD_LIBRARY_PATH $root/lib64
prepend-path MANPATH $root/doc/man
setenv CUDA_PATH $root
setenv CUDA_HOME $root
family "cuda"
## module within the same family will automatically set as conflict
## optional
always-load [dependence package]
.version
file in the directory with following content
#%Module1.0
set ModulesVersion "[default version]"
Procedure:
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Referenct: https://modules.readthedocs.io/en/latest/module.html