Hi Glenn,

On 29/02/16 20:02, Glenn Johnson wrote:
I am relatively new to Easybuild so I apologize if I overlooked something. Is there a way to add extra variables that are local to environment module files? That would be in addition to the 'root' variable that is set. As an example, our (non-EB) Gaussian09 module uses the following to set the user scratch directory:

#%Module
...
set user $env(USER)
...
setenv GAUSS_SCRDIR /scratch/Users/$user

I see the option to add extra environment variables:
modextravars

How can I get the extra variables to use the value of a module local variable?

The only way right now would be to use 'modtclfooter'.

Since you get no control over the order, you'll probably need to jam the 'setenv' in there too.

modtclfooter = "set user $env(USER)\nsetenv GAUSS_SCRDIR /scratch/Users/$user"

Note that if you ever start generating module files in Lua syntax (to be consumed by Lmod), this will simply be ignored; to be 'safe' you should add the equivalent 'modluafooter' too.

I guess we could add support for something like "modlocalvars", but since you also want to grab values from the environment, it would have to be both 'modlocalvarstcl' and 'modlocalvarslua', and I don't like where this is going... :)

Does this help?


regards,

Kenneth

Reply via email to