AcademySoftwareFoundation / AcademySoftwareFoundation/openexr

Installing the pybind11 PyOpenEXR target with Debug build type

Open
#1,895 0 comments 0 reactions 1 assignee Claimed by @cary-ilm View on GitHub
needs attention
Dominant language
C
Stars
1.8k
Forks
700
Avg merge
3d 12h
Merged PRs (30d)
29

Description

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 "", line 1, in
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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.