Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
weslleyspereira opened this issue Oct 13, 2023 · 1 comment

Comments

@weslleyspereira
Copy link
Contributor

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:

  • BLAS++ commit 91dd418fa910498cc03dee397826099914cc3185
  • LAPACK++ commit 88088c3
  • BLAS and LAPACK libraries are installed in LAPACK_LIBS. commit 4174d8d080199d30c0c834a959752bc361b91cbe
  • Environment: Linux
  1. in your blaspp folder:
cmake -B build -D BLAS_LIBRARIES="$LAPACK_LIBS/libblas.a;-lgfortran" -D LAPACK_LIBRARIES=$LAPACK_LIBS/liblapack.a -D build_tests=OFF -D CMAKE_INSTALL_PREFIX=$BLASPP_INSTALL
cmake --build build --target install
  1. in you lapackpp folder:
cmake -B build -D blaspp_DIR=$BLASPP_INSTALL/lib/cmake/blaspp -D LAPACK_LIBRARIES="$LAPACK_LIBS/liblapack.a;$LAPACK_LIBS/libblas.a;-lgfortran" -D build_tests=OFF -D CMAKE_INSTALL_PREFIX=$PWD/build-install

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
Copy link
Collaborator

mgates3 commented Nov 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants