How to automatically generate the modulefile for Intel compilers

649 Views Asked by At

Do you know a way to automatically generate the modulefile for Intel compilers without using the env2 script?

1

There are 1 best solutions below

0
On

Using latest version of Modules (v4.6+), the module command gets a new sub-command called sh-to-mod that translates the environment changes performed by a given script into modulefile commands.

$ module sh-to-mod sh /path/to/foo-1.2/foo-setup.sh arg1
#%Module
prepend-path    PATH /path/to/foo-1.2/bin
set-alias       foo {foobin -q -l}
setenv          FOOENV arg1

The source-sh modulefile Tcl command is also introduced in version 4.6 of Modules to directly translate the environment changes performed by a given script as if it was the content of the modulefile currently being evaluated.

On older version of Modules, a standalone script named createmodule.py is provided to achieve such script to modulefile translation.