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
BLD: remove /usr/include from default include dirs #18658
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).
The
and on Shippable with:
So that seems to need |
The two github actions failure both use blas64. |
The design of I'll just remove the second commit, we can deal with |
Thanks Ralf. |
Thanks Chuck. This needs a release note too, sending a follow-up PR now. |
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/lib
change 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
ifdef
innumpyos.c
, the problem is that there's a mix betweenlocale.h
andxlocale.h
that both exist but are not compatible. For example, a really newlocale.h
in/usr/include
on Arch Linux, combined with an oldxlocale.h
shipped with conda.EDIT2: currently it's really easy to reproduce the
xlocale.h
failure:environment.yml
in DEV: add a conda environment.yml with all development dependencies #18659python setup.py build_ext -i
.