-
Notifications
You must be signed in to change notification settings - Fork 308
enhance CMakeMake easyblock to check whether correct Python installation was picked up by cmake
#3233
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
enhance CMakeMake easyblock to check whether correct Python installation was picked up by cmake
#3233
Changes from 4 commits
7e3b26a
40986c8
133e3b8
775dde0
067c4cd
16b6465
cfbe5e5
3d82787
c0d5e86
f260f73
b60ecd6
77884b9
492c330
c1f005a
4b3653b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -318,8 +318,29 @@ def configure_step(self, srcdir=None, builddir=None): | |||||||||
|
|
||||||||||
| (out, _) = run_cmd(command, log_all=True, simple=False) | ||||||||||
|
|
||||||||||
| return out | ||||||||||
|
|
||||||||||
| # sanitycheck for the configuration step | ||||||||||
| self.log.info("Checking python paths") | ||||||||||
| with open('CMakeCache.txt', 'r') as file: | ||||||||||
| lines = file.readlines() | ||||||||||
|
||||||||||
|
|
||||||||||
| # Search for Python paths in each line | ||||||||||
| for line in lines: | ||||||||||
| if line.startswith('Python3_EXECUTABLE:FILEPATH='): | ||||||||||
|
||||||||||
| pythonExecPath = line.split('=')[1].strip() | ||||||||||
|
||||||||||
| elif line.startswith('Python3_INCLUDE_DIR:FILEPATH='): | ||||||||||
| pythonIncludePath = line.split('=')[1].strip() | ||||||||||
| elif line.startswith('Python3_LIBRARY:FILEPATH='): | ||||||||||
| pythonLibraryPath = line.split('=')[1].strip() | ||||||||||
| self.log.info("Python executable path: %s", pythonExecPath) | ||||||||||
| self.log.info("Python include path: %s", pythonIncludePath) | ||||||||||
| self.log.info("Python library path: %s", pythonLibraryPath) | ||||||||||
|
||||||||||
| # Check if paths include EBROOTPYTHON | ||||||||||
| ebrootpython_path = os.getenv('EBROOTPYTHON') | ||||||||||
|
||||||||||
| ebrootpython_path = os.getenv('EBROOTPYTHON') | |
| ebrootpython_path = get_software_root("Python") | |
| if pythonExecPath and not ebrootpython_path: | |
| raise EasyBuildError("Python related path (%s) found but no Python dependency included, check log" % pythonExecPath) |
Outdated
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.
See above: pythonExecPath & co might not have been set at all. And maybe path.startswith(ebrootpython_path)? We possibly need to take symlinks into account too: either of the 2 might be a resolved symlink or not.
Outdated
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.
Move the return statement out of the if/else block, it is hidden here.
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.
This should handle the case that this file may not exist. E.g. when
configure_cmd != DEFAULT_CONFIGURE_CMDanything can happen.