Ignore Python from virtualenvs in GROMACS configure via -DPython3_FIND_VIRTUALENV=STANDARD#3283
Merged
ocaisa merged 3 commits intoeasybuilders:developfrom Sep 18, 2024
Conversation
Contributor
Author
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 8 out of 8 (8 easyconfigs in total) |
-DPython3_FIND_VIRTUALENV=STANDARD
Contributor
|
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? |
ocaisa
approved these changes
Sep 18, 2024
Member
|
Tested in easybuilders/easybuild-easyconfigs#21430 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(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/3This 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.