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

Compilation failure with latest updates #146

Closed
dschmitz89 opened this issue Jul 22, 2024 · 5 comments
Closed

Compilation failure with latest updates #146

dschmitz89 opened this issue Jul 22, 2024 · 5 comments

Comments

@dschmitz89
Copy link

dschmitz89 commented Jul 22, 2024

The master branch of SuperLU does not compile with the flags used in the SciPy build. See an exemplary CI log here: https://github.com/scipy/scipy/actions/runs/9912930601/job/27388819521?pr=21172#step:9:386

Important to note: this occurs on all platforms with different OSes

FAILED: scipy/sparse/linalg/_dsolve/libsuperlu_lib.a.p/SuperLU_SRC_cdiagonal.c.o 
ccache cc -Iscipy/sparse/linalg/_dsolve/libsuperlu_lib.a.p -Iscipy/sparse/linalg/_dsolve -I../scipy/sparse/linalg/_dsolve -I../scipy/sparse/linalg/_dsolve/SuperLU/SRC -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c17 -O2 -g -Wno-unused-but-set-variable -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -fPIC -DUSE_VENDOR_BLAS=1 -Wno-unused-variable -Wno-parentheses -Wno-unused-label -Wno-implicit-function-declaration -Wno-switch -Wno-unused-result -Wno-maybe-uninitialized -MD -MQ scipy/sparse/linalg/_dsolve/libsuperlu_lib.a.p/SuperLU_SRC_cdiagonal.c.o -MF scipy/sparse/linalg/_dsolve/libsuperlu_lib.a.p/SuperLU_SRC_cdiagonal.c.o.d -o scipy/sparse/linalg/_dsolve/libsuperlu_lib.a.p/SuperLU_SRC_cdiagonal.c.o -c ../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cdiagonal.c
../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cdiagonal.c: In function ‘cfill_diag’:
../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cdiagonal.c:47:19: error: assignment to ‘singlecomplex *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
   47 |         nzval_new = singlecomplexMalloc(nnz + fill);
      |                   ^
../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cdiagonal.c: In function ‘cdominate’:
../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cdiagonal.c:97:19: error: assignment to ‘singlecomplex *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
   97 |         nzval_new = singlecomplexMalloc(nnz + fill);
      |                   ^
cc1: all warnings being treated as errors
[264/1341] Compiling C object scipy/sparse/csgraph/_traversal.cpython-310-x86_64-linux-gnu.so.p/meson-generated__traversal.c.o
ninja: build stopped: subcommand failed.
Build failed!

CC the following PR in SciPy: scipy/scipy#21172

For visibility CC @rgommers

@dschmitz89 dschmitz89 changed the title Compilation issues with latest updates Compilation failure with latest updates Jul 22, 2024
@gruenich
Copy link
Contributor

Is this a duplicate of #122? Or at least related?

@adedner
Copy link

adedner commented Jul 23, 2024

I've run into a problem with singlecomplex as well yesterday with superlu build as part of petsc and using it in dune.
This looks like a duplicate of #122.

Issue

After including the superlu header the usage of std::complex in the dune code fails with singlecomplex not a member of std.

Fix

I changed

#define complex singlecomplex  // backward compatibility

to

typedef singlecomplex complex;

in slu_complex.h. Which solved the problem for me.

Removing the define completely could lead to backward compatibility issues. In my case it caused problems with the usage of ::complex (no std) in parts of the dune code but this could be seen as a bug in the our code and fixed there.

@gruenich
Copy link
Contributor

Thanks for the explanations @adedner and @wo80! I created #148 to remove the #define complex and add an optional typdef for people who need backwards compatibility. Can you please give it a try? I welcome feedback, including wording and naming of variables.

@dschmitz89
Copy link
Author

@gruenich : I will give your branch a test over at SciPy but will take a few days.

@dschmitz89
Copy link
Author

Thanks @gruenich @xiaoyeli : compilation works now, will SciPy's vendored SuperLU soon.

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

No branches or pull requests

3 participants