Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: fix issue with incomplete threads dependency handling #17200

Merged
merged 1 commit into from Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions scipy/fft/_pocketfft/meson.build
@@ -1,12 +1,8 @@
thread_dep = dependency('threads', required: false)

# mingw-w64 does not implement pthread_pfork, needed by pocket_fft
win_gcc = is_windows and meson.get_compiler('cpp').get_id() == 'gcc'

pocketfft_threads = []
fft_deps = []
if is_windows
if win_gcc
if is_mingw
# mingw-w64 does not implement pthread_pfork, needed by pocket_fft
# Disable threading completely, because of freezes using threading for
# mingw-w64 gcc: https://github.com/mreineck/pocketfft/issues/1
pocketfft_threads += ['-DPOCKETFFT_NO_MULTITHREADING']
Expand Down
2 changes: 2 additions & 0 deletions scipy/meson.build
Expand Up @@ -34,6 +34,8 @@ if is_windows
endif
endif

thread_dep = dependency('threads', required: false)

# NumPy include directory - needed in all submodules
incdir_numpy = run_command(py3,
[
Expand Down
4 changes: 4 additions & 0 deletions scipy/optimize/_highs/meson.build
Expand Up @@ -104,6 +104,7 @@ ipx_lib = static_library('ipx',
'../../_lib/highs/extern/',
'cython/src/'
],
dependencies: thread_dep,
cpp_args: [highs_flags, highs_define_macros]
)

Expand Down Expand Up @@ -220,6 +221,7 @@ highs_lib = static_library('highs',
'../../_lib/highs/src/lp_data/',
'../../_lib/highs/src/util/',
],
dependencies: thread_dep,
cpp_args: [highs_flags, highs_define_macros]
)

Expand All @@ -234,6 +236,7 @@ _highs_wrapper = py3.extension_module('_highs_wrapper',
'../../_lib/highs/src/lp_data/',
'../../_lib/highs/src/util/'
],
dependencies: thread_dep,
link_args: version_link_args,
link_with: [highs_lib, ipx_lib, basiclu_lib],
cpp_args: [highs_flags, highs_define_macros, cython_c_args],
Expand All @@ -252,6 +255,7 @@ _highs_constants = py3.extension_module('_highs_constants',
'../../_lib/highs/src/lp_data/',
'../../_lib/highs/src/simplex/'
],
dependencies: thread_dep,
link_args: version_link_args,
install: true,
subdir: 'scipy/optimize/_highs'
Expand Down
4 changes: 1 addition & 3 deletions scipy/stats/meson.build
Expand Up @@ -96,12 +96,10 @@ py3.install_sources([
subdir: 'scipy/stats'
)

pthread = dependency('threads')

_qmc_cy = py3.extension_module('_qmc_cy',
cython_gen_cpp.process('_qmc_cy.pyx'),
cpp_args: cython_cpp_args,
dependencies: [pthread],
dependencies: thread_dep,
include_directories: [inc_np],
link_args: version_link_args,
install: true,
Expand Down