icl-utk-edu / lapackpp

LAPACK++ is a C++ wrapper around CPU and GPU LAPACK and LAPACK-like linear algebra libraries, developed as part of the SLATE project.
https://icl.utk.edu/slate/
BSD 3-Clause "New" or "Revised" License
51 stars 14 forks source link

LAPACK found by LAPACK++ can be different from the one in the BLAS++ #50

Open weslleyspereira opened 1 year ago

weslleyspereira commented 1 year ago

I am experiencing an issue with linking my local LAPACK library. I can link BLAS++ with the BLAS and LAPACK I want. Then, I am having trouble in making LAPACK++ link with the same libraries.

How to reproduce the issue:

The error:

-- The CXX compiler identification is GNU 9.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CMAKE_INSTALL_PREFIX = /home/weslleyp/storage/lapackpp/build-install

-- Looking for CUDA (gpu_backend = auto)
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Building CUDA support

-- No HIP/ROCm support: gpu_backend = cuda

-- No oneMKL-SYCL device support: gpu_backend = cuda

-- lapackpp_id = 62680a1
-- Check for BLAS++
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found CUDAToolkit: /usr/include (found version "10.1.243") 
   Found BLAS++: /home/weslleyp/storage/lapackpp/../blaspp/build-install/lib/cmake/blaspp

-- Looking for LAPACK libraries and options
   /home/weslleyp/storage/lapackpp/../lapack/build/lib/liblapack.a;/home/weslleyp/storage/lapackpp/../lapack/build/lib/libblas.a;-lgfortran  no (didn't run: int mismatch, etc.)
   LAPACK library not found.
CMake Error at CMakeLists.txt:716 (message):
  LAPACK++ requires a LAPACK library and none was found.  Ensure that it is
  accessible in environment variables $CPATH, $LIBRARY_PATH, and
  $LD_LIBRARY_PATH.

-- Configuring incomplete, errors occurred!
See also "/home/weslleyp/storage/lapackpp/build/CMakeFiles/CMakeOutput.log".
See also "/home/weslleyp/storage/lapackpp/build/CMakeFiles/CMakeError.log".

I have tried to modify the configuration step in LAPACK++. For example, if I don't specify LAPACK_LIBRARIES it will link with the LAPACK library that I have installed in my system. I am sure this behavior was not intended.

How to solve:

The solution is clear to me. BLAS++ already links with LAPACK. Thus, I don't think we need to search for LAPACK in LAPACK++.

mgates3 commented 1 year ago

Off hand, I think this would work. I'd like to move [cz]syr and [cz]symv from LAPACK++ back to BLAS++, since BLAS++ links with LAPACK now.