deepmodeling / deepmodeling/tbplas
[Code scan] Use the FindPython executable variable for f2py headers
- Dominant language
- No language data
- Stars
- 19
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
This issue comes from a Codex global scan of deepmodeling/tbplas at commit 4d3652b3dba8eb930e4869a6d41074f62d703692.
Severity: High
`find_package(Python COMPONENTS Interpreter Development.Module NumPy REQUIRED)` provides `Python_EXECUTABLE`, but the f2py include discovery command uses the old `PYTHON_EXECUTABLE` variable. With modern CMake `PYTHON_EXECUTABLE` is empty, so the command can fail to populate `F2PY_INCLUDE_DIR`; the next line then tries to build `${F2PY_INCLUDE_DIR}/fortranobject.c`, which can resolve to an invalid `/fortranobject.c` path.
Code references:
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/CMakeLists.txt#L7-L9
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/CMakeLists.txt#L52-L56
Suggested fix: use `${Python_EXECUTABLE}` in the `execute_process` call and fail early if the f2py include directory cannot be resolved.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with CMakeLists.txt lines 7-9 and 52-56, then inspect the f2py include discovery command and the following fortranobject.c path. Update the executable variable and add the requested early failure check; done means configuration resolves F2PY_INCLUDE_DIR successfully with modern CMake.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100