#1702 Error linking UMFPACK when using SuiteSparse
Metadata
Property | Value |
---|---|
Reported by | Marco Agnese (m.agnese13@imperial.ac.uk) |
Reported at | Jul 27, 2015 15:48 |
Type | Bug Report |
Version | Git (pre2.4) [cmake] |
Operating System | Unspecified / All |
Last edited by | Christoph Grüninger (gruenich@iws.uni-stuttgart.de) |
Last edited at | Sep 29, 2015 14:12 |
Description
I am using the last available dune-trunk and SuiteSparse 4.4.0.
When I compile the core modules UMFPACK is found.
Then when I compile my project (I have in my CMakeList.txt dune_enable_all_packages()
) at the linking stage I obtain the following error:
Linking CXX executable dune-interface
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_di_kernel_init.o): In function `umfdi_kernel_init':
umf_kernel_init.c:(.text+0x844): undefined reference to `amd_valid'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umfpack_di_report_status.o): In function `umfpack_di_report_status':
umfpack_report_status.c:(.text+0x2a): undefined reference to `SuiteSparse_config'
umfpack_report_status.c:(.text+0xff): undefined reference to `SuiteSparse_config'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_i_free.o): In function `umf_i_free':
umf_free.c:(.text+0xa): undefined reference to `SuiteSparse_free'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_i_malloc.o): In function `umf_i_malloc':
umf_malloc.c:(.text+0x4): undefined reference to `Suihat the correct libraries are not linkedteSparse_malloc'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_i_realloc.o): In function `umf_i_realloc':
umf_realloc.c:(.text+0x22): undefined reference to `SuiteSparse_config'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umfpack_gn_tictoc.o): In function `umfpack_tic':
umfpack_tictoc.c:(.text+0x5): undefined reference to `SuiteSparse_time'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umfpack_gn_tictoc.o): In function `umfpack_toc':
umfpack_tictoc.c:(.text+0x25): undefined reference to `SuiteSparse_time'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umfpack_di_qsymbolic.o): In function `symbolic_analysis':
umfpack_qsymbolic.c:(.text+0x21c): undefined reference to `amd_defaults'
umfpack_qsymbolic.c:(.text+0x12af): undefined reference to `amd_aat'
umfpack_qsymbolic.c:(.text+0x232b): undefined reference to `amd_defaults'
umfpack_qsymbolic.c:(.text+0x4ced): undefined reference to `amd_2'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_i_analyze.o): In function `umf_i_analyze':
umf_analyze.c:(.text+0x949): undefined reference to `amd_postorder'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_i_colamd.o): In function `umf_i_colamd':
umf_colamd.c:(.text+0x1551): undefined reference to `amd_postorder'
umf_colamd.c:(.text+0x17b4): undefined reference to `amd_postorder'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_i_cholmod.o): In function `umf_i_cholmod':
umf_cholmod.c:(.text+0x82): undefined reference to `cholmod_start'
umf_cholmod.c:(.text+0x184): undefined reference to `cholmod_transpose'
umf_cholmod.c:(.text+0x194): undefined reference to `cholmod_analyze'
umf_cholmod.c:(.text+0x1a6): undefined reference to `cholmod_free_sparse'
umf_cholmod.c:(.text+0x253): undefined reference to `cholmod_free_factor'
umf_cholmod.c:(.text+0x267): undefined reference to `cholmod_print_common'
umf_cholmod.c:(.text+0x26f): undefined reference to `cholmod_finish'
/usr/local_machine/suitesparse-4.4.0/lib/libumfpack.a(umf_di_transpose.o): In function `umfdi_transpose':
umf_transpose.c:(.text+0x2ec): undefined reference to `amd_valid'
collect2: error: ld returned 1 exit status
make[2]: *** [src/dune-interface] Error 1
make[1]: *** [src/CMakeFiles/dune-interface.dir/all] Error 2
make: *** [all] Error 2
I know that this error is due the fact the LDFLAGS
are set wrongly. Indeed they should be:
-lumfpack -lsuitesparseconfig -lcholmod -lamd -lcolamd -lccolamd -lcamd -lrt -lblas -lgfortran
I don't know CMake so I cannot provide a patch to fix this flag issue but should be quite straightforward to fix it.