bh107 / bohrium

Automatic parallelization of Python/NumPy, C, and C++ codes on Linux and MacOSX
http://www.bh107.org
Apache License 2.0
221 stars 31 forks source link

Extmethods are only linked to LAPACKE, not LAPACK #339

Open dionhaefner opened 7 years ago

dionhaefner commented 7 years ago

I ran into the following problem on Ubuntu:

If one does not have e.g. libopenblas-dev installed (which provides BLAS, CBLAS, and LAPACK symbols), but libblas-dev and liblapacke-dev, running the LAPACK extmethods fails with

Cannot load library: /home/dion/.local/lib/libbh_lapack_le.so: undefined symbol: dgtsv_

This is because the LAPACKE library from apt-get only contains LAPACKE symbols, not the vanilla LAPACK symbols, and the CMake script only links the libbhlapack{driver} libraries to LAPACKE, not LAPACK. One remedy is to issue find_package(LAPACK) in extmethods/lapack/CMakeListst.txt and link it e.g. with target_link_libraries(bh_lapack_${DRIVER} ${LAPACK_LIBRARIES} ${LAPACKE_LIBRARIES}).

omegahm commented 7 years ago

When I get the time, I need to figure all of these various CMake dependencies out! At first, the LAPACKE ext method was just for show. Note that I have also only implemented a small handful of methods from LAPACK.