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

Failed to build with numpy v2 #239

Closed
t20100 opened this issue Jul 10, 2024 · 0 comments · Fixed by #240
Closed

Failed to build with numpy v2 #239

t20100 opened this issue Jul 10, 2024 · 0 comments · Fixed by #240

Comments

@t20100
Copy link
Contributor

t20100 commented Jul 10, 2024

Trying to build xraylib with numpy v2 and cython 3.0.10 I encountered the following error:

[100/162] Generating python/xraylib_np_c with a custom command
FAILED: python/xraylib_np.c 
envs/py312/bin/cython -X language_level=3,boundscheck=False,wraparound=False,cdivision=True ../python/xraylib_np.pyx -o python/xraylib_np.c

Error compiling Cython file:
------------------------------------------------------------
...
P5_SHELL = xrl.P5_SHELL
Q1_SHELL = xrl.Q1_SHELL
Q2_SHELL = xrl.Q2_SHELL
Q3_SHELL = xrl.Q3_SHELL

def AtomicWeight(np.ndarray[np.int_t, ndim=1] Z not None):
                               ^
------------------------------------------------------------

src/xraylib/python/xraylib_np.pyx:1494:31: Invalid type.
[101/162] Generating src/xrayglob_inline.c with a custom command
ninja: build stopped: subcommand failed.

int_t is no longer defined by numpy in numpy.__init__.pxd, while it was with v1.x: https://github.com/numpy/numpy/blob/v1.26.5/numpy/__init__.pxd#L712

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 a pull request may close this issue.

1 participant