Skip to content

Conversation

@tylerjereddy
Copy link
Contributor

"Upstream" version of scipy#1 (@lucascolley suggested we at least flush the CI, regardless of where we merge it, if we merge it..)

  • tries to address this: BUG: SciPy 1.13.0 not buildable on old macOS due to pocketfft code scipy/scipy#20300

  • I needed the preceding underscores added here to produce __MAC_OS_X_VERSION_MIN_REQUIRED and actually populate a value into this preprocessor "variable"

  • After that adjustment locally, I see this from carefully crafted pragma messages: __MAC_OS_X_VERSION_MIN_REQUIRED: 140000 and MAC_OS_X_VERSION_10_15: 101500 (the latter "variable" was already populated)

  • of course, I'm on a way newer MacOS (14.4) than the problem this patch attempts to deal with, but to be fair I was reproducing the problem of MAC_OS_VERSION_MIN_REQUIRED not being populated with a constant value nonetheless

* tries to address this:
scipy/scipy#20300

* I needed the preceding underscores added here to produce
`__MAC_OS_X_VERSION_MIN_REQUIRED` and actually populate a value
into this preprocessor "variable"

* After that adjustment locally, I see this from carefully crafted pragma
messages: `__MAC_OS_X_VERSION_MIN_REQUIRED: 140000` and
`MAC_OS_X_VERSION_10_15: 101500 ` (the latter "variable" was already
populated)

* of course, I'm on a way newer MacOS (14.4) than the problem
this patch attempts to deal with, but to be fair I was reproducing
the problem of `MAC_OS_VERSION_MIN_REQUIRED` not being populated
with a constant value nonetheless
@lucascolley
Copy link
Contributor

I suppose there isn't CI on this repo... given that SciPy CI was passing before this change, I recommend we just try it and see if it fixes for the original issue authors

@mreineck
Copy link
Owner

Yes, CI is missing, since this repo has ben mostly dormant for several years. I'll see if I can add something (at least for compilation), but the trick will be to cover all the unusual OSs and OS versions that cause trouble.

That said, perhaps we should simply give up on the idea of a portable aligned_alloc and always emulate it. I'm doing this in ducc0 now, since the number of non-compliant systems simply makes this not wothwhile.

@mreineck
Copy link
Owner

mreineck commented Mar 22, 2024

Is this something that needs to be settled very urgently, or do we have time to try a version that unconditionally uses the home-grown aligned allocation?

@lucascolley
Copy link
Contributor

lucascolley commented Mar 22, 2024

Is this something that needs to be settled very urgently, or do we have time to try a version that unconditionally uses the home-grown aligned allocation?

It needs to be settled urgently for NumPy and SciPy, but we could apply the patch in the fork we maintain under the SciPy organisation, if you would like to try a more substantial fix in this repo.

EDIT: numpy/numpy#25940 also reported an issue on Termux

@mreineck
Copy link
Owner

The (somewhat) more substantial patch I have in mind would be to simply remove the #if branch and always use the #else branch. That should be maximally future-proof.

But if you prefer to apply the proposed one-liner for the next numpy and scipy releases, that's perfectly fine for me as well. Then I'll just merge the PR, the repos will stay in sync, and we can think about more general solutions afterwads.

@lucascolley
Copy link
Contributor

The (somewhat) more substantial patch I have in mind would be to simply remove the #if branch and always use the #else branch. That should be maximally future-proof.

This may be preferable, as I don't know whether anyone have found a patch which works for the Termux issue.

But if you prefer to apply the proposed one-liner for the next numpy and scipy releases, that's perfectly fine for me as well. Then I'll just merge the PR, the repos will stay in sync, and we can think about more general solutions afterwads.

This also sounds sensible, maybe no harm in merging this now then considering other options.

@mreineck
Copy link
Owner

Great, let's do it like this!

@mreineck mreineck merged commit cb9988c into mreineck:cpp Mar 22, 2024
@mreineck
Copy link
Owner

Done! You can now choose between cb9988c86f4b005de5f77594026a8ba9efec45ee (the original PR) and 33ae5dc94c9cdc7f1c78346504a85de87cadaa12 (fully disabled aligned_alloc).

tylerjereddy added a commit to tylerjereddy/scipy that referenced this pull request Mar 22, 2024
* related to scipygh-20300, though awaits `conda-forge` testing
on old MacOS versions for actual confirmation of fix

* pulls in changes described at mreineck/pocketfft#11
and scipy/pocketfft#2

* I'm honestly not sure how much we gain by being conservative and
not just turning the code path off entirely
(mreineck/pocketfft@33ae5dc);
perhaps there are some performance advantages or something, but if
we have any more trouble with this we should obviously just do that
(and I suspect that's what NumPy should do for
numpy/numpy#25940)

[skip cirrus] [skip circle]
rgommers pushed a commit to rgommers/scipy that referenced this pull request Mar 24, 2024
* related to scipygh-20300, though awaits `conda-forge` testing
on old MacOS versions for actual confirmation of fix

* pulls in changes described at mreineck/pocketfft#11
and scipy/pocketfft#2

* I'm honestly not sure how much we gain by being conservative and
not just turning the code path off entirely
(mreineck/pocketfft@33ae5dc);
perhaps there are some performance advantages or something, but if
we have any more trouble with this we should obviously just do that
(and I suspect that's what NumPy should do for
numpy/numpy#25940)

[skip cirrus] [skip circle]
tylerjereddy added a commit to tylerjereddy/scipy that referenced this pull request Apr 1, 2024
* related to scipygh-20300, though awaits `conda-forge` testing
on old MacOS versions for actual confirmation of fix

* pulls in changes described at mreineck/pocketfft#11
and scipy/pocketfft#2

* I'm honestly not sure how much we gain by being conservative and
not just turning the code path off entirely
(mreineck/pocketfft@33ae5dc);
perhaps there are some performance advantages or something, but if
we have any more trouble with this we should obviously just do that
(and I suspect that's what NumPy should do for
numpy/numpy#25940)

[skip cirrus] [skip circle]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants