-
Notifications
You must be signed in to change notification settings - Fork 283
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
Ignore Python from virtualenvs in GROMACS configure via -DPython3_FIND_VIRTUALENV=STANDARD
#3283
Ignore Python from virtualenvs in GROMACS configure via -DPython3_FIND_VIRTUALENV=STANDARD
#3283
Conversation
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 8 out of 8 (8 easyconfigs in total) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
-DPython3_FIND_VIRTUALENV=STANDARD
I also just ran into this issue when trying to make/test an easyconfig for GROMACS 2024.3. Initially the configure step showed this:
and it failed in some test step because gmxapi was built for this wrong Python version. Then I used the fix from this PR, and it picked up the right Python (which also allowed the tests to run):
@boegel was there any reason why you hadn't hit the merge button after having approved the changes? |
Tested in easybuilders/easybuild-easyconfigs#21430 |
(created using
eb --new-pr
)As reported in Slack GROMACS may pick up Python from an active virtualenv (e.g. when EasyBuild is installed in a virtualenv) instead of from the Python module
This is caused by GROMACS explicitly preferring that:
This happens when
find_package(Python3)
is used which is the case for version 2021 and up. The currentself.cfg.update('configopts', "-DPYTHON_EXECUTABLE=%s" % bin_python)
only applies to usages offind_package(PythonInterp ...)
which are still present (e.g. in the gtest submodule) but not used exclusively as they are deprecated by CMake 3.12+ in favor ofFindPython/2/3
This change avoids it picking up the virtualenv by setting the CMake variable which avoids GROMACS changing it.
Especially together with #3282 the intended Python should be picked up.
I also did a quick Search&Replace to avoid constructing
LooseVersion(self.version)
many times in this function.