Skip to content

Commit

Permalink
MAINT: add library sources to some dependencies
Browse files Browse the repository at this point in the history
fixes missing recompilation of parts of numpy when the static libraries
change.
  • Loading branch information
juliantaylor committed Oct 14, 2013
1 parent 3f5ef54 commit 777c6e5
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,12 +683,12 @@ def get_mathlib_info(*args):
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)
Expand All @@ -700,17 +700,13 @@ def get_mathlib_info(*args):
#######################################################################

# 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=[])


Expand Down Expand Up @@ -767,7 +763,6 @@ def generate_multiarray_templated_sources(ext, build_dir):
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'),
Expand All @@ -786,7 +781,9 @@ def generate_multiarray_templated_sources(ext, build_dir):
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'),
Expand Down Expand Up @@ -899,7 +896,7 @@ def generate_umath_c(ext, build_dir):
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)
Expand Down Expand Up @@ -929,7 +926,7 @@ def generate_umath_c(ext, build_dir):
generate_numpyconfig_h,
generate_numpy_api,
generate_ufunc_api],
depends = deps,
depends = deps + npymath_sources,
libraries = ['npymath'],
)

Expand Down

0 comments on commit 777c6e5

Please sign in to comment.