-
-
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
Extension ignores CXXFLAGS #1192
Comments
Seems like maybe a reasonable thing to support, though I'm surprised it's only now coming to light. How is it that for so long there's been no need in distutils or setuptools for CXXFLAGS? I suspect such a feature should first be implemented in distutils and then setuptools can support the backport. |
I think given that |
It came to light fifteen years ago in distutils. Various patches were carried forward there for years but nothing was ever merged and distutils is dead now. Meanwhile we continue to suffer from this problem. |
See also #1732. |
So what's going to happen with this? How many more decades do we need to wait for Python to properly support modules written in C++? |
@ryandesign, could you please consider patching the feature yourself, either downstream or upstream here if it's urgent. I understand that it's frustrating to not get the responses you expected but currently as you can see setuptools don't have a lot of human power. |
I'm probably not the best person to do it. Besides being very busy with many other projects, I have no knowledge of the distutils/setuptools source code and only a very basic understanding of python. I would suggest that someone already familiar with those would be a better choice. Perhaps a good starting point is to look at the patches submitted to the distutils bug report to see if any of that code is still applicable to setuptools. |
Conda build on CentOS fails with the `error: expected ')' before 'PRIxPTR'`. The fix is to add -D__STDC_FORMAT_MACROS flag. Cython Extension build ignores $CXXFLAGS environment variable (pypa/setuptools#1192), the workaround is to add -D__STDC_FORMAT_MACROS flag to the Extension extra_compile_args.
Conda build on CentOS fails with the `error: expected ')' before 'PRIxPTR'`. The fix is to add -D__STDC_FORMAT_MACROS flag. Cython Extension build ignores $CXXFLAGS environment variable (pypa/setuptools#1192), the workaround is to add -D__STDC_FORMAT_MACROS flag to the Extension extra_compile_args.
It looks like this was fixed in setuptools 72.2.0, which includes pypa/distutils#228. |
(I'm not sure if I should report this here, or at the Cython project.)
When using Extension (I used it for Cython, not sure about other cases), the CXXFLAGS variable is ignored during compile. This is a problem because it is normally set as an environmental variable for OSX/clang instead of CFLAGS (which is the norm for linux/gcc). For example, conda will not build C++11 code at all without the extra options present in CXXFLAGS.
I had to write a workaround to insert the CXXFLAGS into the Extension through the extra_compile_args parameter. Example code below:
Software tested (from conda):
The text was updated successfully, but these errors were encountered: