How can I set up a personal environment modules file for my own build of LAMPPS, netCDF and MPI
CURATOR: Scott Yockel
How can I set up a personal environment modules file for my own build of LAMPPS, netCDF and MPI
CURATOR: Scott Yockel
Details will vary a bit depending what version of the “modules” command is
being used, but basically (to my knowledge) they all allow for the creation
of “personal” modules. This is certainly true of the two big branches:
Tcl Modules and Lmod.
Basically, you can create a directory (typically ~/privatemodules
or something
similar) and then place your own module files there. Then issue a module
command to add that directory to your modules path, and those modules are now
accessible for you to use. I would suggest using names different than the
system supplied LAMMPS, netCDF, and MPI packages, so that it is both clear
which versions you are using and you can still access the system versions if
desired.
First, determine what modules system is used on your system. If you don’t
know, try issuing the module spider
command. If it returns an “unrecognized
subcommand” error, you are probably using Tcl modules. If it returns a list
of modules, you are probably using Lmod.
Whichever module system being used, you need to figure out the changes to
the environment you wish the module package to implement. Typically this
includes adding directories to the path, maybe setting LD_LIBRARY_PATH
and/or
other environmental variables, etc. I would suggest creating modulefiles for
each version of each software package first, and then if desired you can create
a “bundle” package that loads the standard version of the package set.
If using Tcl modules, see
https://modules.readthedocs.io/en/stable/modulefile.html
for details on how to write the modulefile. You can then use the
module use $DIR
command to add your directory to the module path. If you
are using ~/privatemodules
as the directory, you could instead load the
use.own module to add that path.
If using Lmod, see e.g.
http://lmod.readthedocs.io/en/latest/100_modulefile_examples.html
for help on writing the modulefiles. You can then use the
module use $DIR
command to add your directory to the module path.