-
Notifications
You must be signed in to change notification settings - Fork 369
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
Use Development.Module
to be compatible with static Python interpreter
#2195
Conversation
I am confused by the description 🤯 Either the word "but" requires an "is available" or similar at the end of the first paragraph, or it needs to be re-formulated altogether. Can you please unconfuse me?! |
Better? |
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.
The first test on my laptop was positive. Now I tried it in a Docker image and unfortunately I got the following error message:
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Python (missing: Development.Module) (found suitable version
"3.8.10", minimum required is "3.8")
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindPython/Support.cmake:2214 (find_package_handle_standard_args)
/usr/share/cmake-3.16/Modules/FindPython.cmake:304 (include)
cmake/ProcessOptions.cmake:395 (find_package)
CMakeLists.txt:130 (nest_process_with_python)
Any idea?
Can you try a newer version of CMake? Perhaps we'll have to hike the minimum CMake version. From the doc it seems added in
Up-to-date CMake is available everywhere through |
I will try, but it is cmake 3.16 the default version in Ubuntu Focal, the latest LTS version. |
Technically, I'm always in favor of minimalizing things, but @steffengraber's concern is a very valid one. Would it be possible to ship (and for |
Emit an error to enforce CMake 3.18+. This would only be a deal breaker for Ubuntu users who haven't obtained Ubuntu software outside of
What do you think? |
|
@terhorstd and I have discussed this and are in favor of a switch based on the CMake version available. I.e.,
|
40d8a01
to
94b8696
Compare
@jougs ready for review |
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.
Sweet!
@steffengraber: could you please re-review (and possibly merge)? Thanks! |
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.
Have tested it in a clean Ubuntu 20.04 installation and found no problems. 👍
The current CMake build requires Python's shared library and header files to be available (
libpython.so
andPython.h
). These aren't always available, and appearantly NEST builds perfectly fine without them.Let's drop this requirement (one line change from
find_package(Python3 Development)
toDevelopment.Module
) so that NEST can also build and be deployed to environments where Python is built in static mode.Many non-Ubuntu non-system Python installations do not have these shared libraries. The most relevant use cases where we bump into this issue is on lightweight containers and the manylinux wheel images where these files have been intentionally removed.
(And another one, often relevant to me and 15% of Python users, is that
pyenv
also builds without shared libraries ;) )