8000 Merge pull request #24665 from charris/backport-24664 · numpy/numpy@91f6245 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91f6245

Browse files
authored
Merge pull request #24665 from charris/backport-24664
BLD: fix bug in random.mtrand extension, don't link libnpyrandom
2 parents 164a201 + b1d215b commit 91f6245

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

numpy/random/meson.build

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ npyrandom_sources = [
1111
npyrandom_lib = static_library('npyrandom',
1212
npyrandom_sources,
1313
c_args: staticlib_cflags,
14-
# include_directories: '../core/include',
1514
dependencies: [py_dep, np_core_dep],
1615
install: true,
1716
install_dir: np_dir / 'random/lib',
@@ -52,23 +51,26 @@ if host_machine.system() == 'cygwin'
5251
c_args_random += ['-Wl,--export-all-symbols']
5352
endif
5453

55-
# name, sources, extra link libs, extra c_args< 8000 /div>
54+
# name, sources, extra c_args, extra static libs to link
5655
random_pyx_sources = [
57-
['_bounded_integers', _bounded_integers_pyx, [], npymath_lib],
58-
['_common', '_common.pyx', [], []],
59-
['_mt19937', ['_mt19937.pyx', 'src/mt19937/mt19937.c', 'src/mt19937/mt19937-jump.c'], [], []],
60-
['_philox', ['_philox.pyx', 'src/philox/philox.c'], [], []],
61-
['_pcg64', ['_pcg64.pyx', 'src/pcg64/pcg64.c'], ['-U__GNUC_GNU_INLINE__'], []],
62-
['_sfc64', ['_sfc64.pyx', 'src/sfc64/sfc64.c'], [], []],
63-
['bit_generator', 'bit_generator.pyx', [], []],
56+
['_bounded_integers', _bounded_integers_pyx, [], [npyrandom_lib, npymath_lib]],
57+
['_common', '_common.pyx', [], [npyrandom_lib]],
58+
['_mt19937', ['_mt19937.pyx', 'src/mt19937/mt19937.c', 'src/mt19937/mt19937-jump.c'],
59+
[], [npyrandom_lib]
60+
],
61+
['_philox', ['_philox.pyx', 'src/philox/philox.c'], [], [npyrandom_lib]],
62+
['_pcg64', ['_pcg64.pyx', 'src/pcg64/pcg64.c'], ['-U__GNUC_GNU_INLINE__'], [npyrandom_lib]],
63+
['_sfc64', ['_sfc64.pyx', 'src/sfc64/sfc64.c'], [], [npyrandom_lib]],
64+
['bit_generator', 'bit_generator.pyx', [], [npyrandom_lib]],
6465
# The `fs.copyfile` usage here is needed because these two .pyx files import
6566
# from _bounded_integers,and its pxd file is only present in the build directory
66-
['_generator', fs.copyfile('_generator.pyx'), [], npymath_lib],
67+
['_generator', fs.copyfile('_generator.pyx'), [], [npyrandom_lib, npymath_lib]],
6768
['mtrand', [
6869
fs.copyfile('mtrand.pyx'),
6970
'src/distributions/distributions.c',
7071
'src/legacy/legacy-distributions.c'
71-
], ['-DNP_RANDOM_LEGACY=1'], npymath_lib,
72+
],
73+
['-DNP_RANDOM_LEGACY=1'], [npymath_lib],
7274
],
7375
]
7476
foreach gen: random_pyx_sources
@@ -77,7 +79,7 @@ foreach gen: random_pyx_sources
7779
c_args: [c_args_random, gen[2]],
7880
include_directories: 'src',
7981
dependencies: np_core_dep,
80-
link_with: [npyrandom_lib, gen[3]],
82+
link_with: gen[3],
8183
install: true,
8284
subdir: 'numpy/random',
8385
)

0 commit comments

Comments
 (0)
0