Skip to content
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

Installing the pybind11 PyOpenEXR target with Debug build type #1895

Open
skurmedel opened this issue Oct 25, 2024 · 0 comments
Open

Installing the pybind11 PyOpenEXR target with Debug build type #1895

skurmedel opened this issue Oct 25, 2024 · 0 comments

Comments

@skurmedel
Copy link
Contributor

skurmedel commented Oct 25, 2024

This is not a huge issue really, but it can lead to an odd situation.

If you do a debug install of the Python module, CMake may stick a suffix to the shared library name. But the module name no longer matches the exported name.

Importing the new name wont work, for example on my Linux:

>>> import OpenEXR_d.so
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_OpenEXR_d)

An obvious workaround is to simply rename/symlink the file to OpenEXR[.so/dll] after install.

I suspect it is a very niche case few people will encounter. It is however quite confusing unless you know your way around Python bindings.

One fix is to just make sure the module export name matches the CMake output name, although this is also a bit confusing. Disabling the suffix might be the least surprising behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant