Skip to content

Commit

Permalink
Merge pull request #524 from casparvl/fix_lmodrc
Browse files Browse the repository at this point in the history
Fix lmodrc
  • Loading branch information
bedroge committed Apr 2, 2024
2 parents b1508b5 + d2c5dab commit 3bca5b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
1 change: 1 addition & 0 deletions create_lmodrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

DOT_LMOD = '.lmod'

# LMOD_RC file is the place to define properties, see https://lmod.readthedocs.io/en/latest/145_properties.html
TEMPLATE_LMOD_RC = """propT = {
}
scDescriptT = {
Expand Down
34 changes: 14 additions & 20 deletions init/eessi_environment_variables
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,23 @@ if [ -d $EESSI_PREFIX ]; then
show_msg "Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory."
export EESSI_SOFTWARE_PATH=$EESSI_PREFIX/software/$EESSI_OS_TYPE/$EESSI_SOFTWARE_SUBDIR

# Configure our LMOD_RC file
export LMOD_RC="$EESSI_SOFTWARE_PATH/.lmod/lmodrc.lua"
if [ -f $LMOD_RC ]; then
show_msg "Found Lmod configuration file at $LMOD_RC"
# Configure our LMOD
export LMOD_CONFIG_DIR="$EESSI_SOFTWARE_PATH/.lmod"
lmod_rc_file="$LMOD_CONFIG_DIR/lmodrc.lua"
if [ -f $lmod_rc_file ]; then
show_msg "Found Lmod configuration file at $lmod_rc_file"
else
error "Lmod configuration file not found at $LMOD_RC"
error "Lmod configuration file not found at $lmod_rc_file"
fi

export LMOD_PACKAGE_PATH="$EESSI_SOFTWARE_PATH/.lmod"
lmod_sitepackage_file="$LMOD_PACKAGE_PATH/SitePackage.lua"
if [ -f $lmod_sitepackage_file ]; then
show_msg "Found Lmod SitePackage.lua file at $lmod_sitepackage_file"
else
error "Lmod SitePackage.lua file not found at $lmod_sitepackage_file"
fi

if [ ! -z $EESSI_BASIC_ENV ]; then
show_msg "Only setting up basic environment, so we're done"
elif [ -d $EESSI_SOFTWARE_PATH ]; then
Expand All @@ -85,21 +94,6 @@ if [ -d $EESSI_PREFIX ]; then
false
fi

export LMOD_CONFIG_DIR="$EESSI_SOFTWARE_PATH/.lmod"
lmod_rc_file="$LMOD_CONFIG_DIR/lmodrc.lua"
if [ -f $lmod_rc_file ]; then
show_msg "Found Lmod configuration file at $lmod_rc_file"
else
error "Lmod configuration file not found at $lmod_rc_file"
fi

export LMOD_PACKAGE_PATH="$EESSI_SOFTWARE_PATH/.lmod"
lmod_sitepackage_file="$LMOD_PACKAGE_PATH/SitePackage.lua"
if [ -f $lmod_sitepackage_file ]; then
show_msg "Found Lmod SitePackage.lua file at $lmod_sitepackage_file"
else
error "Lmod SitePackage.lua file not found at $lmod_sitepackage_file"
fi

else
error "EESSI software layer at $EESSI_SOFTWARE_PATH not found!"
Expand Down

0 comments on commit 3bca5b7

Please sign in to comment.