8000 MAINT: fix defines for universal2 python builds of NumPy by mattip · Pull Request #22169 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: fix defines for universal2 python builds of NumPy #22169

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

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions numpy/core/include/numpy/numpyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@

#undef NPY_SIZEOF_LONGDOUBLE
#undef NPY_SIZEOF_COMPLEX_LONGDOUBLE
#ifdef HAVE_LDOUBLE_IEEE_DOUBLE_LE
#undef HAVE_LDOUBLE_IEEE_DOUBLE_LE
#endif
#ifdef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
#undef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
#endif

#if defined(__arm64__)
#define NPY_SIZEOF_LONGDOUBLE 8
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
#define HAVE_LDOUBLE_IEEE_DOUBLE_LE 1
#elif defined(__x86_64)
#define NPY_SIZEOF_LONGDOUBLE 16
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1
#elif defined (__i386)
#define NPY_SIZEOF_LONGDOUBLE 12
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 24
Expand Down
4 changes: 4 additions & 0 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,10 @@ def generate_config_h(ext, build_dir):

# Generate the config.h file from moredefs
with open(target, 'w') as target_f:
if sys.platform == 'darwin':
target_f.write(
"/* may be overridden by numpyconfig.h on darwin */\n"
)
for d in moredefs:
if isinstance(d, str):
target_f.write('#define %s\n' % (d))
Expand Down
0