ewels / clusterflow

A pipelining tool to automate and standardise bioinformatics analyses on cluster environments.
https://ewels.github.io/clusterflow/
GNU General Public License v3.0
97 stars 27 forks source link

Clusterflow doesn't work with Lmod modulefile system #124

Open s-andrews opened 5 years ago

s-andrews commented 5 years ago

On our system we're using the newer Lmod environment module system rather than the original environment modules.

LMod is syntactically and API compatible with environment modules, but uses different back end commands. Because clusterflow doesn't call module but goes behind to call modulecmd then it fails with Lmod.

I'll attach a patch which will test for LMod and will support it if that's what people are running.

s-andrews commented 5 years ago
$ diff cf-orig cf
334,336c334,342
< if($CF_MODULES){
<       if (system('which modulecmd > /dev/null 2>&1')){
<               die( "ERROR - could not find modulecmd on the PATH. Aborting run.\n" .
---
>
> my $modulecmd = "modulecmd";
>
> if (exists $ENV{LMOD_CMD}) {
>               $modulecmd = $ENV{LMOD_CMD};
> }
>
> if($CF_MODULES){if (system("which $modulecmd > /dev/null 2>&1")){
>               die( "ERROR - could not find $modulecmd on the PATH. Aborting run.\n" .
1339c1345
<       my $mod_list = `modulecmd sh list 2>&1`;
---
>       my $mod_list = `$modulecmd sh list 2>&1`;
ewels commented 5 years ago

Thanks! Can you just submit a PR instead of a diff?

s-andrews commented 5 years ago

I already did :-)

ewels commented 5 years ago

Ah you did already! x-ref #126