diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-11-26 21:47:41 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-11-26 23:30:04 +0100 |
commit | 7d106d590697fcbb7199b00e1f40ec835fe809f6 (patch) | |
tree | a9c9ec93ab63105c2a58fe797e760d291c8ac8e3 | |
parent | 3351dbf311d35220c2782367c543e4825fadce31 (diff) | |
download | numpy-7d106d590697fcbb7199b00e1f40ec835fe809f6.tar.gz |
BUG: reduce maximum alignment to 8 bytes on 32 bit
malloc only provides 8byte alignment and is sufficient to load complex
on x86 platforms.
This fixes the f2py alignment failures with complex types on win32 or on
linux32 with -malign-double
-rw-r--r-- | numpy/core/setup.py | 1 | ||||
-rw-r--r-- | numpy/core/src/private/npy_config.h | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py index a51eb690b..bad45787c 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -764,6 +764,7 @@ def configuration(parent_package='',top_path=None): join('src', 'multiarray', 'ucsnarrow.h'), join('src', 'multiarray', 'usertypes.h'), join('src', 'multiarray', 'vdot.h'), + join('src', 'private', 'npy_config.h'), join('src', 'private', 'templ_common.h.src'), join('src', 'private', 'lowlevel_strided_loops.h'), join('include', 'numpy', 'arrayobject.h'), diff --git a/numpy/core/src/private/npy_config.h b/numpy/core/src/private/npy_config.h index 882913e2f..44ac73a30 100644 --- a/numpy/core/src/private/npy_config.h +++ b/numpy/core/src/private/npy_config.h @@ -3,6 +3,7 @@ #include "config.h" #include "numpy/numpyconfig.h" +#include "numpy/npy_cpu.h" /* Disable broken MS math functions */ #if defined(_MSC_VER) || defined(__MINGW32_VERSION) @@ -19,7 +20,11 @@ * amd64 is not harmed much by the bloat as the system provides 16 byte * alignment by default. */ +#if (defined NPY_CPU_X86 || defined _WIN32) +#define NPY_MAX_COPY_ALIGNMENT 8 +#else #define NPY_MAX_COPY_ALIGNMENT 16 +#endif /* Disable broken Sun Workshop Pro math functions */ #ifdef __SUNPRO_C |