diff options
author | njsmith <njs@pobox.com> | 2012-06-25 02:22:38 -0700 |
---|---|---|
committer | njsmith <njs@pobox.com> | 2012-06-25 02:22:38 -0700 |
commit | 6a06466c5970e4f1cd5ba5ba5457eeb41d9a7280 (patch) | |
tree | 06fe336d71734bb41fcc146cf8801bffcb0c1370 /numpy | |
parent | 699c2f3cca63966bf086c58a59e1b6ee6fa7e090 (diff) | |
parent | 465c2f44f0c19d2abe7b5d060c447f69526ca14c (diff) | |
download | numpy-6a06466c5970e4f1cd5ba5ba5457eeb41d9a7280.tar.gz |
Merge pull request #317 from cournape/travis_ci_separate_compilation
Travis ci separate compilation
Diffstat (limited to 'numpy')
-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 |
5 files changed, 25 insertions, 6 deletions
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" |