summaryrefslogtreecommitdiff
path: root/numpy/core/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r--numpy/core/setup.py34
1 files changed, 22 insertions, 12 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 8c6c287a1..75c129a5d 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):
@@ -679,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)
@@ -696,11 +700,14 @@ 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', 'npysort', 'selection.c.src')])
+ sources=npysort_sources,
+ include_dirs=[])
#######################################################################
@@ -774,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'),
@@ -887,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)
@@ -912,11 +921,12 @@ 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,
generate_ufunc_api],
- depends = deps,
+ depends = deps + npymath_sources,
libraries = ['npymath'],
)