Problem with blacs library
Hi, I am trying to build Stumpack on a debian computer. Everything runs OK until the tests compilation that complains about missing blacs library: /usr/bin/ld: CMakeFiles/test_HSS_mpi.dir/test_HSS_mpi.cpp.o: undefined reference to symbol 'Cblacs_exit' //usr/lib/libblacs-openmpi.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: *** [test/test_HSS_mpi] Error 1 make[1]: *** [test/CMakeFiles/test_HSS_mpi.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: CMakeFiles/test_sparse_mpi.dir/test_sparse_mpi.cpp.o: undefined reference to symbol 'Cblacs_exit' //usr/lib/libblacs-openmpi.so.1: error adding symbols: DSO missing from command line
But Blacs was found by CMake during the configuration. If I simply add " -L/usr/lib -lblacs-openmpi" to the link.txt file, the compilation ends and all the tests are OK.
Hi,
Thanks for reporting. What does CMake output? When I run on Ubuntu 19.04, I see this:
-- Found SCALAPACK: /usr/lib/x86_64-linux-gnu/libscalapack-openmpi.so;/usr/lib/x86_64-linux-gnu/libblacs-openmpi.so
We had to write our own FindSCALAPACK.cmake module, since it's not part of CMake. But it does look for blacs-openmpi in the /usr/lib folder and adds the library to be linked:
find_library(BLACS_LIBRARY NAMES blacs blacs-pvm blacs-mpi blacs-mpich blacs-mpich2 blacs-openmpi blacs-lam mpiblacs scalapack ${SCALAPACK_LIBRARY} PATHS /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /sw/lib /usr/lib64/mpich/lib ENV LD_LIBRARY_PATH ENV SCALAPACKDIR ENV BLACSDIR) set(SCALAPACK_LIBRARIES ${SCALAPACK_LIBRARY} ${BLACS_LIBRARY})
Pieter
Hi,
Everything runs ok during the configuration phase. I get : -- Found SCALAPACK: /usr/lib/libscalapack-openmpi.so;/usr/lib/libblacs-openmpi.so
But when linking the "test_HSS_mpi.cpp" test, the BLACS library is missing on the command line. If I simply add " -L/usr/lib -lblacs-openmpi" to the "./test/CMakeFiles/test_sparse_mpi.dir/link.txt" file, the compilation ends and all the tests are OK when I run "make test".
Nicolas