BLD: remove /usr/include from default include dirs#18658
Merged
charris merged 1 commit intonumpy:mainfrom Mar 21, 2021
Merged
Conversation
Including this directory is painful for cross-compiling, see numpygh-14980 and numpygh-13280. Removing this directory fixes the following build failure: ``` gcc: numpy/core/src/common/numpyos.c In file included from numpy/core/src/common/numpyos.c:23: /usr/include/xlocale.h:27:16: error: redefinition of ‘struct __locale_struct’ 27 | typedef struct __locale_struct ``` This error also shows up in various other build issues outside of the NumPy issue tracker. Compilers normally always include this path, so this shouldn't break anything. The default include paths for the compiler can be checked, e.g. for gcc with `cpp -v`. That will typically have /usr/include last. In case this breaks something for a nonstandard compiler, that can be worked around via a site.cfg file in the root of the repo (or equivalently, `~/numpy-site.cfg`) containing: ``` [DEFAULT] include_dirs = /usr/include ``` The same principle should apply to `/usr/lib`. I will make that change in a separate commit, because the failure mode for that will be different (and I'm not running into it right now).
Member
Author
|
The and on Shippable with: So that seems to need |
Member
|
The two github actions failure both use blas64. |
Member
Author
|
The design of I'll just remove the second commit, we can deal with |
Member
|
Thanks Ralf. |
rgommers
added a commit
to rgommers/numpy
that referenced
this pull request
Mar 21, 2021
Member
Author
|
Thanks Chuck. This needs a release note too, sending a follow-up PR now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Including this directory is painful for cross-compiling, see gh-14980 and gh-13280. Removing this directory fixes the following build failure:
This error also shows up in various other build issues outside of the NumPy issue tracker.
Compilers normally always include this path, so this shouldn't break anything. The default include paths for the compiler can be checked, e.g. for gcc with
cpp -v. That will typically have /usr/include last.In case this breaks something for a nonstandard compiler, that can be worked around via a site.cfg file in the root of the repo (or equivalently,
~/numpy-site.cfg) containing:The same principle should apply to
/usr/lib. The/usr/libchange is made in a separate commit, because the failure mode for that will be different (may be useful in case this breaks something else).EDIT: to clarify: it is not possible to fix this with an extra
ifdefinnumpyos.c, the problem is that there's a mix betweenlocale.handxlocale.hthat both exist but are not compatible. For example, a really newlocale.hin/usr/includeon Arch Linux, combined with an oldxlocale.hshipped with conda.EDIT2: currently it's really easy to reproduce the
xlocale.hfailure:environment.ymlin DEV: add a conda environment.yml with all development dependencies #18659python setup.py build_ext -i.