Closed kelbstf closed 2 years ago
Hello.
i found this previous discussion:
https://github.com/easybuilders/easybuild-framework/issues/3275
I am not sure, whether this is actually the same situation, because i try to just source a file, thus the file is currently not executable.
LMod seems to support s.th. similar:
https://lmod.readthedocs.io/en/latest/260_sh_to_modulefile.html#calling-the-shell-script-directly-inside-a-modulefile", but apparently only for 8.6+, while my version is "8.2.10".
What i still don't understand:
Does anyone has an idea?
@kelbstf This module file has the source
statement in it exactly, and where does that module file come from?
The problem here is that EasyBuild is consuming module files via Python, so loading the module is done via $LMOD_CMD python load
(whereas loading the module manually via module load
is equivalent to loading it via $LMOD_CMD bash load
).
The source
command is not valid Python syntax, which explains the error you are getting.
To help you out, we need more info on where the module file using source
comes from.
You'll basically need to make sure that EasyBuild doesn't try to load that module (it's not clear to me why it would, currently, but I don't have enough info about this module file this is exactly).
Hello @boegel,
thank you very much for looking into it! And for explaining how the module file is parsed in EasyBuild.
If i understand you right, there seems to be 2 aspects to this problem:
@Background/use case: "source" is meant to launch the python venv any time but only for the occasion of using EasyBuild to maintain software. This seemed the most convenient and "failsafe" (prerequisite venv can't be missed when launching EasyBuild), non-global solution, where the same account still should have options to launch alternative venvs outside of using EasyBuild.
The Lmod (8.2) module for EasyBuild is written by me, as i installed EasyBuild via pip, not via EasyBuild:
/opt/ohpc/admin/easybuild/easybuild/modulefiles/EasyBuild/4.5.0
#%Module1.0#####################################################################
proc ModulesHelp { } {
puts stderr "Module for loading easybuild"
puts stderr "\nVersion 4.5.0\n"
}
module-whatis "Name: easybuild"
module-whatis "Version: 4.5.0"
module-whatis "Category: system tool"
module-whatis "Description: Software build and installation framework"
module-whatis "URL: https://easybuilders.github.io/easybuild/"
set version 4.5.0
set home $::env(HOME)
if { [ module-info mode load ] } {
puts stdout "source /opt/ohpc/admin/easybuild/bin/activate;"
} elseif { [ module-info mode remove ] } {
puts stdout "deactivate;"
}
source_sh("python", "/opt/ohpc/admin/easybuild/bin/activate activate")
prepend-path PATH /opt/ohpc/admin/easybuild/bin
prepend-path PATH /opt/ohpc/admin/lmod/lmod/libexec
prepend-path LD_LIBRARY_PATH /opt/ohpc/admin/easybuild/lib
prepend-path LIBRARY_PATH /opt/ohpc/admin/easybuild/lib
module use /opt/ohpc/pub/moduleseb
setenv EASYBUILD_CONFIGFILES /opt/ohpc/admin/easybuild/etc/config.cfg
setenv EBROOTEASYBUILD /opt/ohpc/admin/easybuild
setenv EBVERSIONEASYBUILD 4.5.0
setenv EB_PYTHON python3
setenv EASYBUILD_MODULE_NAMING_SCHEME CategorizedHMNS
prepend-path PYTHONPATH /opt/ohpc/admin/easybuild/lib/python3.6/site-packages
#source_sh("python", "/opt/ohpc/admin/easybuild/bin/activate activate")
For the python access i now tried with what LMod proposes for accessing scripts in LMod module (),, using the "source_sh" statement above.
But that fails with:
Lmod has detected the following error:
/opt/ohpc/admin/easybuild/easybuild/modulefiles/EasyBuild/4.5.0:
(EasyBuild/4.5.0): extra characters after close-quote
While processing the following module(s):
Module fullname Module Filename
--------------- ---------------
EasyBuild/4.5.0 /opt/ohpc/admin/easybuild/easybuild/modulefiles/EasyBuild/4.5.0
This might still be due to "Lmod 8.2.10 (TCL Version 8.6.8)", while apparently source_sh depends on LMod 8.6+. Unfortunately i currently don't have access to LMod 8.6+ in the very short term :-/
But in case the solution would depend on Lmod 8.6+, it would still be interesting whether this would be possible in general? The general relevance could be: "Running EasyBuild in a temporary venv".
Best regards
Hello, i just wanted to update that in an effort to keep the implementation simple, i believe it's better to remove the loading of the venv should be done externally from the module. At least switching to Lua to begin with would possibly be the better choice for s.th. like this. From my point of view i then would close this issue, if no one disagrees?
Hello,
i have difficulties with M4 to install in a situation where EasyBuild 4.5.0 is installed via pip3 in a venv. All packages work well (M4 is part of the attempt to eb foss-2020a.eb), but M4 stumbles upon the LMod module of EasyBuild (the one i use to isntall), which activates the venv like this:
This is what causes the compilation fail:
Does it make sense that M4 actually attempts to load the module? All other packages seems not to depend on it... And if so: what might be the problem with source? On the CLI, it works perfectly fine...