-
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
let CMakeMake
easyblock also set Python_EXECUTABLE
option, as well as Python3_EXECUTABLE
and Python2_EXECUTABLE
derivatives (when appropriate)
#3463
Merged
ocaisa
merged 12 commits into
easybuilders:develop
from
Crivella:feature-cmake_pythonvenv
Oct 11, 2024
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7212d55
Added to CMakeMake
Crivella 47f21b9
Generalized to `Python_EXECUTABLE`
Crivella 2878569
Update easybuild/easyblocks/generic/cmakemake.py
Crivella 57b03e4
Store generate options to allow usage by children classes
Crivella 606533b
Convenience function to set find_python HINTS
Crivella 9a31f79
Modularized and more convenience functions
Crivella fa30b9c
Generalized functions and removed redundant policy
Crivella bdcf7da
lint
Crivella c88446f
Removed helper function
Crivella b265338
Update easybuild/easyblocks/generic/cmakemake.py
Crivella 7aff4c0
Add default
Crivella cd7cad3
Apply suggestions from code review
Crivella File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
I'm a bit confused by this one, what's the plan with this?
As is, it can only be used in easyblocks that derive from
CMakeMake
?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.
Yes I would make 2 free functions out of that:
-DPython*_EXECUTABLE=...
, maybe optionally only as a dictThe first function is the safe way for every situation we can pass CMake variables. We can use that to enhance the GROMACS easyblock to move the CMake config options out from the EasyConfig to the easyblock and add those options.
The 2nd function can be used whenever we cannot use the first. It might still pick up a
python
from a virtualenv whenPython*_FIND_STRATEGY
isn't set toLOCATION
("older" codes default this to LOCATION if unset) but at least we did a best effort to avoid that which might work for most cases.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.
Added the 2 separate functions to return the options as a dict or as a string:
get_cmake_python_config_dict
get_cmake_python_config_str
and changed the name of the function to set the env vars to
set_cmake_python_env_hints
(9a31f79)There might be an argument of making that function a context manager to be used with
with
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.
Since we are taking the convenience function route, i am wondering if we should (probably another PR) also change the detection of all other options into separate/grouped convenience functions to make them reusable by other easyblocks than need to implement their own more complex configure step (eg the new LLVM one)