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

Build failure of SuperLU with the development version of numpy #19036

Closed
WarrenWeckesser opened this issue Aug 9, 2023 · 4 comments · Fixed by #19062
Closed

Build failure of SuperLU with the development version of numpy #19036

WarrenWeckesser opened this issue Aug 9, 2023 · 4 comments · Fixed by #19062
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg

Comments

@WarrenWeckesser
Copy link
Member

WarrenWeckesser commented Aug 9, 2023

NumPy has recently changed how it defines complex numbers in its C code. As a result of these changes, the NumPy C header file "npy_common.h" now does #include <complex.h>. This will break the compilation of any extension module that includes the NumPy C header files and that has its own definition of the name complex. See numpy/numpy#24344 and numpy/numpy#24198 and the links therein for details.

We are encountering this problem with the SuperLU code. Specifically, in https://github.com/scipy/scipy/blob/main/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h, which has

typedef struct { float r, i; } complex;

Until SuperLU modernizes its code so that it doesn't rely on its own implementation of complex arithmetic (or at least doesn't use the name complex), AND someone then takes on the challenges of updating our vendored version, I think we'll have to add another patch to our vendored copy, to change the name complex to, say, singlecomplex.

@WarrenWeckesser WarrenWeckesser added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg Build issues Issues with building from source, including different choices of architecture, compilers and OS labels Aug 9, 2023
@WarrenWeckesser WarrenWeckesser changed the title Test failures with the development version of numpy Build failure of SuperLU with the development version of numpy Aug 9, 2023
@rgommers
Copy link
Member

@lysnikolaou would you have time to patch this up and then upstream the fix to https://github.com/xiaoyeli/superlu?

@lysnikolaou
Copy link
Contributor

@lysnikolaou would you have time to patch this up and then upstream the fix to https://github.com/xiaoyeli/superlu?

Of course! I'll be back home and in front of a computer on Sunday, so I'll probably work on this on Monday. Is that okay?

@rgommers
Copy link
Member

Sure no worries! And in case it bothers anyone enough before that time, they can fix it instead.

lysnikolaou added a commit to lysnikolaou/scipy that referenced this issue Aug 14, 2023
- Replace all occurences of complex with singlecomplex
- Add a second patch file for the complex changes (to make it easier
  to remove once the upstream patch is merged)

Closes scipygh-19036.
@lysnikolaou
Copy link
Contributor

Opened #19062.

rgommers pushed a commit to lysnikolaou/scipy that referenced this issue Aug 15, 2023
- Replace all occurences of complex with singlecomplex
- Add a second patch file for the complex changes (to make it easier
  to remove once the upstream patch is merged)

Closes scipygh-19036.
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 defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants