dstndstn / astrometry.net

Astrometry.net -- automatic recognition of astronomical images
http://astrometry.net
Other
666 stars 187 forks source link

fix for numpy 2.0 #298

Closed branchvincent closed 3 months ago

branchvincent commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

Looks like there are some python issues as well https://app.circleci.com/pipelines/github/dstndstn/astrometry.net/256/workflows/89a6156a-855b-40d7-b37f-a842f490f39c/jobs/957

branchvincent commented 3 months ago

Ah oops, see #299