-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
OpenUSD fails to compile on Ubuntu22.04 due to missing Python symbols during linking #3031
Comments
Hi @stjaeckel cmake .. -DPYTHON_EXECUTABLE=/path/to/virtual/python/bin/python3.11 Because I was using the package managed python, I was able to apt install pybind11-dev, which seemed to be required, possibly for one of the deps or to build boost with python support. I also had to make sure that when I built boost, I made sure to activate my virtual python first, and also make sure that the python api headers were in the CPLUS_INCLUDE_PATH environment variable.
Finally, although it may not affect you, Note that boost 1.78 has an incompatibility with Python 3.11+. This was fixed in boost 1.81. |
Filed as internal issue #USD-9517 |
Same issue. |
Description of IssueI see the same undefined references as @stjaeckel on Ubuntu 22.04 for:
Previously, I have had successful builds on Ubuntu 20.04 and 24.04 with earlier versions of OpenUSD, but I am not able to Build script fails when installing on Ubuntu 22.04. Setup:
I tried to resolve the undefined references by passing python info (also to cmake), and ensuring abi conformity, but with no avail:
My hack of-last-resort is to enable successful link and build completion by:
|
Description of Issue
Build script fails when installing on Ubuntu 22.04. Setup:
The issue seems to be a linking error. When checking the provided symbols on
libboost_python310.so
:The output from the nm command shows that libboost_python310.so references a large number of Python C API functions (those symbols prefixed with Py), but all of these symbols are marked with a U, indicating that they are undefined within the library itself. This means that libboost_python310.so expects these symbols to be provided by another binary at runtime—typically, this would be the Python interpreter (libpython) itself. However, when building OpenUSD, the python library is not linked.
Manually building OpenUSD causes the same error (
undefined reference to
PyLong_AsLong'`):When checking the OpenUSD build config, there is a link to
libboost_python310.so
, but no link tolibpython3.10.so
which seems to be required for boost to work.I tried different Python versions from 3.8 to 3.12 (all istalled using anaconda) and different OpenUSD versions from 23.01 to 24.03 from GitHUB. All attempts to compile OpenUSD fail due to the same issue. Using the default Ubuntu 22.04 system installer without anaconda fails too since the cmake version from the Ubuntu 22.04 repository is 3.22 and OpenUSD requires at least 3.24.
Steps to Reproduce
Package Versions
cmake 3.29.0 (from anaconda)
python 3.10.14 (from anaconda)
pyside6 6.6.2 (from anaconda)
boost 1.78 (installed from OpenUSD build script)
The text was updated successfully, but these errors were encountered: