Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure Lmod via $LMOD_CONFIG_DIR and $LMOD_PACKAGE_PATH + don't set $LMOD_RC #524

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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