-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Improve python cmake #4574
Improve python cmake #4574
Conversation
What's the Python 3 status on MacOS? |
@zeule AFAIK macOS does not come with any 3rd party language runtime installed by default other than Python 2, which is also deprecated there and supposed to be for "Apple use only" until it is fully removed. So users are supposed to install Python (3) manually, using the official installers or brew or something. |
43ba6ef
to
ea3ab52
Compare
@arvidn |
ea3ab52
to
f322352
Compare
macOS 10.15 finally comes with Python 3, it has Python 3.7, but Python 2.7 is also available |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
bump, will deal with this later. |
f322352
to
34edfac
Compare
34edfac
to
5af6869
Compare
OK, I'm finally happy with this. There should be no difference in behavior from the current implementation, except for the fact that the egg info is no longer generated by default. There are now two additional features related to the python bindings:
Let me know if you want me to squash/reword/reorder the commits. Once this is in, I'll continue with #5197 |
this seems like a problem: https://travis-ci.com/github/arvidn/libtorrent/jobs/400301284#L1227 |
Bad news: https://github.com/FranciscoPombal/libtorrent/runs/1261779636?check_suite_focus=true Might be a port bug in vcpkg... I have to try without it. |
be513c1
to
e3a6f0e
Compare
- Drop Python 2 support and EOL Python 3 versions - Use FindPython3 instead of the deprecated FindPythonInterp and FindPythonLibs scripts
directories in CMake, disabled by default
e3a6f0e
to
3702aaa
Compare
Alright, CMake CI passes now. Here is a run of #5197 on top of this: https://github.com/FranciscoPombal/libtorrent/runs/1266542035?check_suite_focus=true - it also works, except for debug builds and static linking, which is its own problem that I will look into in #5197. |
@arvidn ping, the remaining CI failure seems unrelated: https://travis-ci.com/github/arvidn/libtorrent/jobs/401080845 (or if it is related, I don't know what it's about). |
Basically changes to use the new FindPython3:
https://cmake.org/cmake/help/v3.17/module/FindPython3.html
. Also drops EOL python versions.Warning: slightly outdated info below. See #4574 (comment) for updated info.
The first commit introduces changes that make it work the same as before (on Ubuntu 18.04, I have to specify
-Dboost-python-module-name=python36
).The second commit makes further use of the new variables. One benefit is eliminating the build-time dependency on
python3-dev
andpython3-setuptools
packages. It requires the latest CMake version as of writing, but I don't think that's an issue, given how easy it is to install the latest version on basically any system. But I haven't managed to get the same results as before - the site-packages directory does not seems to respect theCMAKE_INSTALL_PREFIX
.Without this commit, the discovered site-packages directory is relative, while with it, it becomes absolute. Here are the differences in the configure output as well as the
install_manifest.txt
, for a run with the install prefix set to/usr/local
:Python site packages: lib/python3/dist-packages
vsPython site packages: /usr/lib/python3/dist-packages
Also, is it a problem if the
boost_python
module version is different from the python library version? e.g.libboost_python36.so
withlibpython3.8.so
? I have found that this build script allows that, with or without this PR.Finally, should
Python3_USE_STATIC_LIBS=ON
depend directly on the value ofBUILD_SHARED_LIBS
, or does it make sense to leave them independently configurable?@zeule any tips?