SuiteSparse SPQR not linked correctly
SPQR is not linked correctly. Indeed, the compilation of dune/istl/spqrtest.cc returns the following error:
/usr/local_machine/suitesparse-4.4.0/lib/libspqr.a(spqr_larftb.o): In function `void spqr_larftb<double>(int, long, long, long, long, long, double*, double*, double*, double*, cholmod_common_struct*)':
spqr_larftb.cpp:(.text._Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct[_Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct]+0x2c3): undefined reference to `dlarfb_'
spqr_larftb.cpp:(.text._Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct[_Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct]+0x3b9): undefined reference to `dlarft_'
spqr_larftb.cpp:(.text._Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct[_Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct]+0x673): undefined reference to `dlarft_'
spqr_larftb.cpp:(.text._Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct[_Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct]+0x711): undefined reference to `dlarft_'
spqr_larftb.cpp:(.text._Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct[_Z11spqr_larftbIdEvilllllPT_S1_S1_S1_P21cholmod_common_struct]+0x7a8): undefined reference to `dlarft_'
/usr/local_machine/suitesparse-4.4.0/lib/libspqr.a(spqr_larftb.o): In function `void spqr_larftb<std::complex<double> >(int, long, long, long, long, long, std::complex<double>*, std::complex<double>*, std::complex<double>*, std::complex<double>*, cholmod_common_struct*)':
spqr_larftb.cpp:(.text._Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct[_Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct]+0x2c3): undefined reference to `zlarfb_'
spqr_larftb.cpp:(.text._Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct[_Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct]+0x3b9): undefined reference to `zlarft_'
spqr_larftb.cpp:(.text._Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct[_Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct]+0x673): undefined reference to `zlarft_'
spqr_larftb.cpp:(.text._Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct[_Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct]+0x711): undefined reference to `zlarft_'
spqr_larftb.cpp:(.text._Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct[_Z11spqr_larftbISt7complexIdEEvilllllPT_S3_S3_S3_P21cholmod_common_struct]+0x7a8): undefined reference to `zlarft_'
/usr/local_machine/suitesparse-4.4.0/lib/libspqr.a(spqr_front.o): In function `long spqr_front<double>(long, long, long, double, long, long, double*, long*, char*, double*, double*, double*, double*, cholmod_common_struct*)':
spqr_front.cpp:(.text._Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct[_Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct]+0x656): undefined reference to `dlarfg_'
spqr_front.cpp:(.text._Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct[_Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct]+0x936): undefined reference to `dlarf_'
/usr/local_machine/suitesparse-4.4.0/lib/libspqr.a(spqr_front.o): In function `long spqr_front<std::complex<double> >(long, long, long, double, long, long, std::complex<double>*, long*, char*, std::complex<double>*, std::complex<double>*, double*, double*, cholmod_common_struct*)':
spqr_front.cpp:(.text._Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct[_Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct]+0x67e): undefined reference to `zlarfg_'
spqr_front.cpp:(.text._Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct[_Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct]+0x9c2): undefined reference to `zlarf_'
collect2: error: ld returned 1 exit status
make[3]: *** [dune/istl/test/spqrtest] Error 1
make[2]: *** [dune/istl/test/CMakeFiles/spqrtest.dir/all] Error 2
make[1]: *** [dune/istl/test/CMakeFiles/spqrtest.dir/rule] Error 2
make: *** [dune/istl/test/CMakeFiles/spqrtest.dir/rule] Error 2
According to Tim Davis (the developer of SuiteSparse) to fix the linking error: "You have to link SPQR to LAPACK" but it does not work. See !23 (closed).
SPQR is correctly linked inside the dune-fem module.