How to enable loading LMOD modules

I’m trying to get Galaxy 19.09 to load an LMOD module named FASTX-Toolkit/0.0.14-intel-2018b for the tool fasta_formatter.xml.
I’ve uncommented the lmod line in config/dependency_resolvers_conf.xml

<lmod />

I’ve also updated the fasta_formatter.xml tool to match the name of the LMOD module but the FASTX-Toolkit module is not getting loaded. Fails with ‘fasta_formatter: command not found’:

    <requirement type="package" version="0.0.14-intel-2018b">FASTX-Toolkit</requirement>

the lmod path for lmodexec is in the variable LMOD_CMD and MODULEPATH is also set

I’ve also tried using the config/lmod_modules_mapping.yml approach. Is there some other configuration I am missing?


I tried on 20.01 by adding to the tool_dependency_dir while testing Trinity:



if [ -z “$MODULEPATH” ] ; then
. /etc/profile.d/
module load Trinity/2.8.4-foss-2018b-Python-2.7.15

And added the requirement section in the trinity.xml file:

          <requirement type="package" version="2.8.4-foss-2018b-Python-2.7.15">Trinity</requirement>

The tool is recognizing the file but even though there are values for LMOD_CMD and MODULEPATH when the tool runs, it always fails with

Trinity/2.8.4-foss-2018b-Python-2.7.15/ line 6: module: command not found

I found a workaround to get lmod modules to load in v20.01 by using the lmod command instead of the module command to load modules.
Add the requirements section in the tool’s xml file:

   <requirement type="package" version="2.8.4-foss-2018b">Trinity</requirement>

Create the tool’s script


Source the output of the lmod command in the script

 /sw/lmod/lmod/libexec/lmod load Trinity/2.8.4-foss-2018b >