From 10ce5b29cf1fd507f1ba8d072724388089774ac4 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Mon, 14 Oct 2013 21:54:17 +0200 Subject: MAINT: add src/private in build_dir to include search paths allows generating headers like npy_partition.h with the code generator --- numpy/core/setup.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'numpy/core/setup.py') diff --git a/numpy/core/setup.py b/numpy/core/setup.py index 8c6c287a1..c3f79a3c7 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -529,6 +529,10 @@ def configuration(parent_package='',top_path=None): def generate_numpyconfig_h(ext, build_dir): """Depends on config.h: generate_config_h has to be called before !""" + # put private include directory in build_dir on search path + # allows using code generation in headers headers + config.add_include_dirs(join(build_dir, "src", "private")) + target = join(build_dir, header_dir, '_numpyconfig.h') d = os.path.dirname(target) if not os.path.exists(d): @@ -697,10 +701,17 @@ def configuration(parent_package='',top_path=None): # This library is created for the build but it is not installed config.add_library('npysort', - sources = [join('src', 'npysort', 'quicksort.c.src'), - join('src', 'npysort', 'mergesort.c.src'), - join('src', 'npysort', 'heapsort.c.src'), - join('src', 'npysort', 'selection.c.src')]) + sources=[join('src', 'npysort', 'quicksort.c.src'), + join('src', 'npysort', 'mergesort.c.src'), + join('src', 'npysort', 'heapsort.c.src'), + join('src','private', 'npy_partition.h.src'), + join('src', 'npysort', 'selection.c.src')], + deps=[join('src', 'npysort', 'quicksort.c'), + join('src', 'npysort', 'mergesort.c'), + join('src', 'npysort', 'heapsort.c'), + join('src', 'private', 'npy_partition.h'), + join('src', 'npysort', 'selection.c')], + include_dirs=[]) ####################################################################### -- cgit v1.2.1 From 3f5ef54558e3546134be32edfdc2ed510a9cc6ca Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Mon, 14 Oct 2013 21:55:33 +0200 Subject: ENH: add scalarmathmodule.h.src with integer overflow functions and use them in scalarmathmodule.c instead of the old (disabled) ones. --- numpy/core/setup.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'numpy/core/setup.py') diff --git a/numpy/core/setup.py b/numpy/core/setup.py index c3f79a3c7..d5c1481d0 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -767,6 +767,7 @@ def configuration(parent_package='',top_path=None): join('src', 'multiarray', 'ucsnarrow.h'), join('src', 'multiarray', 'usertypes.h'), join('src', 'private', 'lowlevel_strided_loops.h'), + join('src', 'private', 'scalarmathmodule.h.src'), join('include', 'numpy', 'arrayobject.h'), join('include', 'numpy', '_neighborhood_iterator_imp.h'), join('include', 'numpy', 'npy_endian.h'), @@ -923,6 +924,7 @@ def configuration(parent_package='',top_path=None): config.add_extension('scalarmath', sources = [join('src', 'scalarmathmodule.c.src'), + join('src', 'private', 'scalarmathmodule.h.src'), generate_config_h, generate_numpyconfig_h, generate_numpy_api, -- cgit v1.2.1 From 777c6e5346251c0c2fc9fba4d1295a7cc8fc83d7 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Mon, 14 Oct 2013 22:59:05 +0200 Subject: MAINT: add library sources to some dependencies fixes missing recompilation of parts of numpy when the static libraries change. --- numpy/core/setup.py | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'numpy/core/setup.py') diff --git a/numpy/core/setup.py b/numpy/core/setup.py index d5c1481d0..75c129a5d 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -683,12 +683,12 @@ def configuration(parent_package='',top_path=None): subst_dict["posix_mathlib"] = posix_mlib subst_dict["msvc_mathlib"] = msvc_mlib + npymath_sources = [join('src', 'npymath', 'npy_math.c.src'), + join('src', 'npymath', 'ieee754.c.src'), + join('src', 'npymath', 'npy_math_complex.c.src'), + join('src', 'npymath', 'halffloat.c')] config.add_installed_library('npymath', - sources=[join('src', 'npymath', 'npy_math.c.src'), - join('src', 'npymath', 'ieee754.c.src'), - join('src', 'npymath', 'npy_math_complex.c.src'), - join('src', 'npymath', 'halffloat.c'), - get_mathlib_info], + sources=npymath_sources + [get_mathlib_info], install_dir='lib') config.add_npy_pkg_config("npymath.ini.in", "lib/npy-pkg-config", subst_dict) @@ -700,17 +700,13 @@ def configuration(parent_package='',top_path=None): ####################################################################### # This library is created for the build but it is not installed + npysort_sources=[join('src', 'npysort', 'quicksort.c.src'), + join('src', 'npysort', 'mergesort.c.src'), + join('src', 'npysort', 'heapsort.c.src'), + join('src','private', 'npy_partition.h.src'), + join('src', 'npysort', 'selection.c.src')] config.add_library('npysort', - sources=[join('src', 'npysort', 'quicksort.c.src'), - join('src', 'npysort', 'mergesort.c.src'), - join('src', 'npysort', 'heapsort.c.src'), - join('src','private', 'npy_partition.h.src'), - join('src', 'npysort', 'selection.c.src')], - deps=[join('src', 'npysort', 'quicksort.c'), - join('src', 'npysort', 'mergesort.c'), - join('src', 'npysort', 'heapsort.c'), - join('src', 'private', 'npy_partition.h'), - join('src', 'npysort', 'selection.c')], + sources=npysort_sources, include_dirs=[]) @@ -767,7 +763,6 @@ def configuration(parent_package='',top_path=None): join('src', 'multiarray', 'ucsnarrow.h'), join('src', 'multiarray', 'usertypes.h'), join('src', 'private', 'lowlevel_strided_loops.h'), - join('src', 'private', 'scalarmathmodule.h.src'), join('include', 'numpy', 'arrayobject.h'), join('include', 'numpy', '_neighborhood_iterator_imp.h'), join('include', 'numpy', 'npy_endian.h'), @@ -786,7 +781,9 @@ def configuration(parent_package='',top_path=None): join('include', 'numpy', 'ndarraytypes.h'), join('include', 'numpy', 'npy_1_7_deprecated_api.h'), join('include', 'numpy', '_numpyconfig.h.in'), - ] + # add library sources as distuils does not consider libraries + # dependencies + ] + npysort_sources + npymath_sources multiarray_src = [ join('src', 'multiarray', 'arrayobject.c'), @@ -899,7 +896,7 @@ def configuration(parent_package='',top_path=None): generate_umath_py, join('src', 'umath', 'simd.inc.src'), join(codegen_dir, 'generate_ufunc_api.py'), - join('src', 'private', 'ufunc_override.h')] + join('src', 'private', 'ufunc_override.h')] + npymath_sources if not ENABLE_SEPARATE_COMPILATION: umath_deps.extend(umath_src) @@ -929,7 +926,7 @@ def configuration(parent_package='',top_path=None): generate_numpyconfig_h, generate_numpy_api, generate_ufunc_api], - depends = deps, + depends = deps + npymath_sources, libraries = ['npymath'], ) -- cgit v1.2.1