Zentrum für Datenverarbeitung (ZDV) (data center)

How to create your own software module?

The previous section described how you load a module automatically in your bash. The following section you will learn how to create your own software module and how it can be used in your working environment.

Preperation for an own module directory

First you create a new directory for your modules, e.g. ~/privatemodules.

For that your directory will be known to the future shells insert the following command in your ./bashrc file. This command effects that the files in your ~/privatemodules will be recognized as module files.

 

module load use.own

 

The module file

Each software module needs a module file which specifies the module's descriptions, dependencies, environment variables and where example and manual files can be found.

Jedes Softwaremodul bedarf einer Moduldatei, die Eigenschaften wie Abhängigkeiten des Moduls, Umgebungsvariablen, Beschreibungen oder die Orte der Beispiel- und Hilfedateien spezifiziert.

The Moldyn module offers a good template for your new module file. You can find it in the /opt/bwgrid/chem/moldyn/858-mkl-10.3.5/modulefiles on the hpc-bw-cluster.

The following shows an extract for a minimal module file:

 

#%Module -*- tcl -*- ## 
## modulefile
## proc ModulesHelp { } {

puts stderr "\tAdds Intel C/C++ compilers (11.0.081) to your environment,"

}

module-whatis "adds Intel C/C++ compilers (11.0.081) to your environment"

set root /usr/local/Cluster-Apps/intel/cce/11.0.081
prepend-path PATH $root/bin/intel64
prepend-path MANPATH $root/man
prepend-path LD_LIBRARY_PATH $root/lib/intel64
...