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: special: fix dependencies for _ellip_harm_2 #19168

Merged
merged 1 commit into from Sep 1, 2023

Conversation

mathstuf
Copy link
Contributor

Generating the source for _ellip_harm_2 requires the cython_special module to already be compiled. Add a dependency for this. Note that it now must be a custom target because generators do not support extra dependencies.

Fixes: #19167

Reference issue

Closes gh-19167

What does this implement/fix?

Fix dependencies for _ellip_harm_2 Cython generation.

Additional information

@mathstuf
Copy link
Contributor Author

Cc: @rgommers

@mathstuf
Copy link
Contributor Author

mathstuf commented Aug 31, 2023

Well, one from-scratch build succeeded here, so any other missing dependencies seem to be masked by available parallelism on the test machine (the only one that found the problem).

@rgommers rgommers self-requested a review August 31, 2023 15:58
@rgommers rgommers added scipy.special Build issues Issues with building from source, including different choices of architecture, compilers and OS labels Aug 31, 2023
@rgommers
Copy link
Member

Thanks @mathstuf. This does fix the problem, but wouldn't this more minimal fix do?

diff --git a/scipy/special/meson.build b/scipy/special/meson.build
index e7e25aa54..900064410 100644
--- a/scipy/special/meson.build
+++ b/scipy/special/meson.build
@@ -318,12 +318,12 @@ cython_special_pxd = custom_target('_dummy_cython_special.pxd',
 uf_cython_gen = generator(cython,
   arguments : cython_args,
   output : '@BASENAME@.c',
-  depends : [_cython_tree, _ufuncs_pxi_pxd_sources])
+  depends : [_cython_tree, _ufuncs_pxi_pxd_sources, cython_special_pxd])
 
 uf_cython_gen_cpp = generator(cython,
   arguments : cython_cplus_args,
   output : '@BASENAME@.cpp',
-  depends : [_cython_tree, _ufuncs_pxi_pxd_sources])
+  depends : [_cython_tree, _ufuncs_pxi_pxd_sources, cython_special_pxd])
 
 py3.extension_module('_ufuncs',
   [

That's analogous to how it's already done in linalg/meson.build and optimize/meson.build. I just tested two builds, with -j64 and -j1, as well as only building _ellip_harm_2.so, and that is all happy.

@mathstuf
Copy link
Contributor Author

That does look better. I think I had first tried that with cython_special and got told "no" because of it being a CustomTarget or something. I didn't go back and try it with the _pxd object.

Generating the source for `_ellip_harm_2` requires the
`cython_special.pxd` header to be generated. So add a dependency for
this.

Closes scipygh-19167

Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
@rgommers rgommers added this to the 1.12.0 milestone Sep 1, 2023
@rgommers rgommers changed the title scipy.special: fix dependencies for _ellip_harm_2 BLD: special: fix dependencies for _ellip_harm_2 Sep 1, 2023
@rgommers rgommers merged commit d0fe75d into scipy:main Sep 1, 2023
24 checks passed
@rgommers
Copy link
Member

rgommers commented Sep 1, 2023

In it goes. Thanks @mathstuf!

@mathstuf mathstuf deleted the ellip_harm_2-deps branch September 1, 2023 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS scipy.special
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: build graph non-determinism
2 participants