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

Can't build PyImath_d on Windows without debug Python build #288

Open
SimonBoorer opened this issue Feb 1, 2023 · 1 comment
Open

Can't build PyImath_d on Windows without debug Python build #288

SimonBoorer opened this issue Feb 1, 2023 · 1 comment

Comments

@SimonBoorer
Copy link
Contributor

On Windows pyconfig.h automatically links to debug Python builds if _DEBUG is defined:
https://github.com/python/cpython/blob/v3.10.9/PC/pyconfig.h#L270-L271

Boost Python wraps this so that it can be compiled in debug mode without requiring a debug build of Python:
https://github.com/boostorg/python/blob/boost-1.76.0/include/boost/python/detail/wrap_python.hpp#L23-L48

This is the default behaviour and can be controlled using BOOST_DEBUG_PYTHON.

Because PyImath headers include Python.h directly this bypasses the Boost python wrapper causing link incompatibility.

These headers should include boost/python/detail/wrap_python.hpp instead. Other libraries (e.g. USD) wrap BOOST_DEBUG_PYTHON in a cmake option, e.g.: PixarAnimationStudios/OpenUSD#1478

@SimonBoorer SimonBoorer changed the title Can't build PyImath in debug mode on Windows without debug Python build Can't build PyImath_d on Windows without debug Python build Feb 1, 2023
@meshula
Copy link
Contributor

meshula commented Feb 3, 2023

This is a reasonable suggestion, we could do that. Are you interested in submitting a PR? I don't personally work with debug python builds on windows, so I'm not really set up to try this locally.

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

2 participants