diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | numpy/core/bscript | 6 | ||||
-rw-r--r-- | numpy/core/setup.py | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/_datetime.h | 6 | ||||
-rw-r--r-- | numpy/core/src/multiarray/datetime_busdaycal.h | 5 | ||||
-rw-r--r-- | numpy/core/src/umath/reduction.c | 10 |
6 files changed, 29 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index 2c15d9dbc..d310f8d2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,10 @@ matrix: include: - python: 2.5 env: TEST_PY24="true" + - python: 2.7 + env: NPY_SEPARATE_COMPILATION=1 + - python: 3.2 + env: NPY_SEPARATE_COMPILATION=1 before_install: - mkdir builds - pushd builds diff --git a/numpy/core/bscript b/numpy/core/bscript index 33493d55b..89cf5fae4 100644 --- a/numpy/core/bscript +++ b/numpy/core/bscript @@ -30,7 +30,11 @@ from setup_common \ C99_FUNCS_SINGLE, C99_COMPLEX_TYPES, C99_COMPLEX_FUNCS, \ MANDATORY_FUNCS, C_ABI_VERSION, C_API_VERSION -ENABLE_SEPARATE_COMPILATION = False +try: + val = os.environ['NPY_SEPARATE_COMPILATION'] + ENABLE_SEPARATE_COMPILATION = (val != "0") +except KeyError: + ENABLE_SEPARATE_COMPILATION = False NUMPYCONFIG_SYM = [] diff --git a/numpy/core/setup.py b/numpy/core/setup.py index 92d352e9a..2d36f5ee1 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -13,8 +13,8 @@ from setup_common import * # Set to True to enable multiple file compilations (experimental) try: - os.environ['NPY_SEPARATE_COMPILATION'] - ENABLE_SEPARATE_COMPILATION = True + val = os.environ['NPY_SEPARATE_COMPILATION'] + ENABLE_SEPARATE_COMPILATION = (val != "0") except KeyError: ENABLE_SEPARATE_COMPILATION = False diff --git a/numpy/core/src/multiarray/_datetime.h b/numpy/core/src/multiarray/_datetime.h index b359a9f17..7ec3cd907 100644 --- a/numpy/core/src/multiarray/_datetime.h +++ b/numpy/core/src/multiarray/_datetime.h @@ -1,9 +1,13 @@ #ifndef _NPY_PRIVATE__DATETIME_H_ #define _NPY_PRIVATE__DATETIME_H_ +#ifdef NPY_ENABLE_SEPARATE_COMPILATION +extern NPY_NO_EXPORT char *_datetime_strings[NPY_DATETIME_NUMUNITS]; +extern NPY_NO_EXPORT int _days_per_month_table[2][12]; +#else NPY_NO_EXPORT char *_datetime_strings[NPY_DATETIME_NUMUNITS]; - NPY_NO_EXPORT int _days_per_month_table[2][12]; +#endif NPY_NO_EXPORT void numpy_pydatetime_import(); diff --git a/numpy/core/src/multiarray/datetime_busdaycal.h b/numpy/core/src/multiarray/datetime_busdaycal.h index 8401f38b6..5d7325733 100644 --- a/numpy/core/src/multiarray/datetime_busdaycal.h +++ b/numpy/core/src/multiarray/datetime_busdaycal.h @@ -26,7 +26,12 @@ typedef struct { npy_bool weekmask[7]; } NpyBusDayCalendar; +#ifdef NPY_ENABLE_SEPARATE_COMPILATION +extern NPY_NO_EXPORT PyTypeObject NpyBusDayCalendar_Type; +#else NPY_NO_EXPORT PyTypeObject NpyBusDayCalendar_Type; +#endif + /* * Converts a Python input into a 7-element weekmask, where 0 means diff --git a/numpy/core/src/umath/reduction.c b/numpy/core/src/umath/reduction.c index be301e26d..2f0420610 100644 --- a/numpy/core/src/umath/reduction.c +++ b/numpy/core/src/umath/reduction.c @@ -6,12 +6,18 @@ * * See LICENSE.txt for the license. */ +#define _UMATHMODULE +#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define PY_SSIZE_T_CLEAN #include <Python.h> -#define NPY_NO_DEPRECATED_API NPY_API_VERSION -#define _MULTIARRAYMODULE +#include "npy_config.h" +#ifdef ENABLE_SEPARATE_COMPILATION +#define PY_ARRAY_UNIQUE_SYMBOL _npy_umathmodule_ARRAY_API +#define NO_IMPORT_ARRAY +#endif + #include <numpy/arrayobject.h> #include "npy_config.h" |