-
Notifications
You must be signed in to change notification settings - Fork 63
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
Python 11 and 12 support #2441
Python 11 and 12 support #2441
Conversation
It is not sufficient to modify your |
Unfortunately, it does not seem to be the case the cmake respects pyenv. E.g., I have this:
Nevertheless, cmake uses Python 3.12.7:
The same occurs if I run cmake manually in the src-gen directory, so this is not an lfc problem. So, empirical evidence shows that cmake does NOT respect pyenv. Note that I'm running the latest cmake:
The older version of cmake before updating to this version exhibits the same behavior. lfc generates the following line in the CMakeLists.txt file:
My plan is to modify lfc to constrain find_package to exactly the version the path, which should then work with pyenv. |
Did you have a look at the hints for ind_python? |
Thanks for the pointer to HINTS! I tried the following, but it still fails to find the version of Python specified by
|
A missing Now, the required Python version is 3.10.0 and newer versions. |
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.
All regression tests passed on my laptop with Ubuntu 24.10 and Python 3.12.7.
All the tests also passed on my laptop with Python 3.13.0. Any ideas why CI is stuck? In this commit: 33cc862 I've changed the Python version to fix it at 3.12. I suspect that the code that was there was for testing with 3.10, 3.11, and 3.12, but that was probably what was blocking. |
This PR makes Python versions 3.11, 3.12, and 3.13, at least, work with the Python target.
By default, the Python version is found by CMake with the constraint that it be at least 3.10.0.
This is specified by the following directive:
Because CMake does not work as advertised (see below), this PR adds a target parameter
python-version
to specify a precise version to use. For example, to use 3.13.0, you would specify:This will change the above directive in the generated CMakeLists.txt file to read like this:
This PR fixes some memory issues, particularly with modal models, that were previously causing crashes with Python versions greater than 3.10.
The rest of this text documents the issue with CMake.
There is a problem I need help with, however. In this PR, the Python version is hardwired to 3.12.7 in the PythonGenerator.java file, which generates the CMake directives, and has this line:
The problem is that if this line allows 3.10.0 up to 3.13.0, which is what we want, then lfc inevitably picks a different Python from one identified by CMake, and you get an error message like:
How can we force CMake to pick the Python version that is in the PATH? Sadly, it does not do that.
This supersedes #1902, which I will close.