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

fix for numpy 2.0 #298

Merged
merged 1 commit into from
Jun 19, 2024
Merged

fix for numpy 2.0 #298

merged 1 commit into from
Jun 19, 2024

Conversation

branchvincent
Copy link
Contributor

Fixes #297

Numpy 2.0 removed eslize

Also, not sure how this is typically handled but numpy/arrayobject.h now includes complex.h, which defines an I macro conflicting with local variables

pyspherematch.c:338:17: error: expected identifier or '('
    npy_uint32* I;
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/complex.h:42:11: note: expanded from macro 'I'
#define I _Complex_I

@dstndstn
Copy link
Owner

It looks like that "I" definition is coming from MacOS code, so I'm curious whether that is an issue on other platforms. (If you try to #undef an undefined variable, is that an error?) I think the CI will tell us that.

Thanks for this!

@branchvincent
Copy link
Contributor Author

Is circleci running on PRs? I don't see it here https://app.circleci.com/pipelines/github/dstndstn/astrometry.net

But it's from complex.h, so not just macos. On ubuntu for example:

In file included from /src/.venv/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:376,
                 from /src/.venv/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:4,
                 from /src/.venv/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                 from /src/.venv/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                 from pyspherematch.c:17:
pyspherematch.c: In function ‘KdTree_get_data’:
pyspherematch.c:338:17: error: expected identifier or ‘(’ before ‘__extension__’
  338 |     npy_uint32* I;

@dstndstn dstndstn merged commit d079673 into dstndstn:main Jun 19, 2024
4 checks passed
@dstndstn
Copy link
Owner

@branchvincent
Copy link
Contributor Author

Ah oops, see #299

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.

Numpy 2.0 support
2 participants