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 fails with WITH_CHECK=OFF #9

Closed
Fabian188 opened this issue Dec 29, 2022 · 3 comments · Fixed by #10
Closed

build fails with WITH_CHECK=OFF #9

Fabian188 opened this issue Dec 29, 2022 · 3 comments · Fixed by #10
Labels

Comments

@Fabian188
Copy link

I test SuiteSparse-5.13.0-cmake.3 on macOS.

In build cmake .. -DWITH_DEMOS=OFF works, however
cmake .. -DWITH_DEMOS=OFF -DWITH_CHECK=OFF
results in

Consolidate compiler generated dependencies of target umfpack_int
[ 26%] Building C object CMakeFiles/umfpack_int.dir/UMFPACK/Source/umf_cholmod.c.o
/Users/fwein/Downloads/SuiteSparse-5.13.0-cmake.3/UMFPACK/Source/umf_cholmod.c:224:9: error: implicit declaration of function 'cholmod_print_common' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        CHOLMOD_print_common ("for UMFPACK", &cm) ;
        ^
/Users/fwein/Downloads/SuiteSparse-5.13.0-cmake.3/UMFPACK/Source/umf_cholmod.c:28:35: note: expanded from macro 'CHOLMOD_print_common'
#define CHOLMOD_print_common      cholmod_print_common
                                  ^
1 error generated.

The setting does WITH_PRINT=OFF and resetting has no effect (possibly because it is a cache variable).

@sergiud sergiud added the bug label Dec 29, 2022
@sergiud
Copy link
Owner

sergiud commented Dec 29, 2022

Thanks for the report. The issue is in the original SuiteSparse where I only observe a warning which is elevated to an error in your build because you set -Werror. A quick fix would be to remove -Werror or disable the warning.

As for the actual problem: cholmod_print_common and cholmod_l_print_common are (confusingly) part of the CHOLDMOD Check module

int cholmod_print_common

int cholmod_l_print_common (const char *, cholmod_common *) ;

which is why WITH_PRINT does not have any effect here.

@Fabian188
Copy link
Author

I do not set -Werror but use the default settings. These result in

Building C object CMakeFiles/umfpack_int.dir/UMFPACK/Source/umf_cholmod.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -DBLAS_UNDERSCORE -DDINT -Dumfpack_EXPORTS -I/Users/fwein/code/SuiteSparse-serguid/AMD/Include -I/Users/fwein/code/SuiteSparse-serguid/UMFPACK/Include -I/Users/fwein/code/SuiteSparse-serguid/UMFPACK/Source -I/Users/fwein/code/SuiteSparse-serguid/build/include/SuiteSparse/UMFPACK -I/Users/fwein/code/SuiteSparse-serguid/build/CHOLMOD/Include -I/Users/fwein/code/SuiteSparse-serguid/CHOLMOD/Cholesky -I/Users/fwein/code/SuiteSparse-serguid/CHOLMOD/Core -I/Users/fwein/code/SuiteSparse-serguid/CHOLMOD/Include -I/Users/fwein/code/SuiteSparse-serguid/CHOLMOD/MatrixOps -I/Users/fwein/code/SuiteSparse-serguid/CHOLMOD/Modify -I/Users/fwein/code/SuiteSparse-serguid/CHOLMOD/Supernodal -I/Users/fwein/code/SuiteSparse-serguid/build/include/SuiteSparse/CHOLMOD -I/Users/fwein/code/SuiteSparse-serguid/SuiteSparse_config -I/Users/fwein/code/SuiteSparse-serguid/build/include/SuiteSparse -I/Users/fwein/code/SuiteSparse-serguid/build/include/SuiteSparse/AMD -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk -mmacosx-version-min=12.3 -fPIC -fvisibility=hidden -MD -MT CMakeFiles/umfpack_int.dir/UMFPACK/Source/umf_cholmod.c.o -MF CMakeFiles/umfpack_int.dir/UMFPACK/Source/umf_cholmod.c.o.d -o CMakeFiles/umfpack_int.dir/UMFPACK/Source/umf_cholmod.c.o -c /Users/fwein/code/SuiteSparse-serguid/UMFPACK/Source/umf_cholmod.c
/Users/fwein/code/SuiteSparse-serguid/UMFPACK/Source/umf_cholmod.c:224:9: error: implicit declaration of function 'cholmod_print_common' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        CHOLMOD_print_common ("for UMFPACK", &cm) ;
        ^
/Users/fwein/code/SuiteSparse-serguid/UMFPACK/Source/umf_cholmod.c:28:35: note: expanded from macro 'CHOLMOD_print_common'
#define CHOLMOD_print_common      cholmod_print_common
                                  ^
1 error generated.

I checked this for clang on macOS and icx on Windows. I'll try your patch. Thanks!

@sergiud
Copy link
Owner

sergiud commented Dec 29, 2022

It does not matter who sets -Werror. Evidently, the flag is being set which is not a compiler default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants