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 library not found. #56

Open
yurivict opened this issue Dec 14, 2023 · 3 comments
Open

LAPACK library not found. #56

yurivict opened this issue Dec 14, 2023 · 3 comments

Comments

@yurivict
Copy link

Configure fails:

-- Looking for LAPACK libraries and options
   In BLAS library                                  no (didn't link: routine not found)
   -llapack                                         no (didn't link: routine not found)
   LAPACK library not found.
CMake Error at CMakeLists.txt:720 (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.

In cmake/LAPACKFinder.cmake the compilation of lapack_pstrf.cc fails with this output:

Change Dir: /usr/ports/math/lapackpp/work/.build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/local/bin/cmake -E env VERBOSE=1 /usr/local/bin/gmake -f Makefile cmTC_09eb8/fast && gmake[1]: Entering directory '/usr/ports/math/lapackpp/work/.build/CMakeFiles/CMakeTmp'
/usr/local/bin/gmake  -f CMakeFiles/cmTC_09eb8.dir/build.make CMakeFiles/cmTC_09eb8.dir/build
gmake[2]: Entering directory '/usr/ports/math/lapackpp/work/.build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_09eb8.dir/lapack_pstrf.cc.o
/usr/local/libexec/ccache/c++ -DBLAS_HAVE_CBLAS -DBLAS_HAVE_OPENBLAS  -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -fopenmp=libomp -MD -MT CMakeFiles/cmTC_09eb8.dir/lapack_pstrf.cc.o -MF CMakeFiles/cmTC_09eb8.dir/lapack_pstrf.cc.o.d -o CMakeFiles/cmTC_09eb8.dir/lapack_pstrf.cc.o -c /usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc
In file included from /usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:9:
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/config.h:19:6: error: "must define one of FORTRAN_ADD_, FORTRAN_LOWER, FORTRAN_UPPER"
    #error "must define one of FORTRAN_ADD_, FORTRAN_LOWER, FORTRAN_UPPER"
     ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:16:6: error: unknown type name 'dpstrf'
void LAPACK_dpstrf_base(
     ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:11:42: note: expanded from macro 'LAPACK_dpstrf_base'
#define LAPACK_dpstrf_base FORTRAN_NAME( dpstrf, DPSTRF )
                                         ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:16:6: error: unknown type name 'DPSTRF'
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:11:50: note: expanded from macro 'LAPACK_dpstrf_base'
#define LAPACK_dpstrf_base FORTRAN_NAME( dpstrf, DPSTRF )
                                                 ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:16:6: error: function cannot return function type 'void (const char *, const lapack_int *, double *, const lapack_int *, lapack_int *, lapack_int *, const double *, double *, lapack_int *)' (aka 'void (const char *, const int *, double *, const int *, int *, int *, const double *, double *, int *)')
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:11:40: note: expanded from macro 'LAPACK_dpstrf_base'
#define LAPACK_dpstrf_base FORTRAN_NAME( dpstrf, DPSTRF )
                                       ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:58:5: error: use of undeclared identifier 'dpstrf'
    LAPACK_dpstrf( "lower", n, A, n, ipiv, &rank, &tol, work, &info );
    ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:31:34: note: expanded from macro 'LAPACK_dpstrf'
    #define LAPACK_dpstrf( ... ) LAPACK_dpstrf_base( __VA_ARGS__ )
                                 ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:11:42: note: expanded from macro 'LAPACK_dpstrf_base'
#define LAPACK_dpstrf_base FORTRAN_NAME( dpstrf, DPSTRF )
                                         ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:58:5: error: use of undeclared identifier 'DPSTRF'
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:31:34: note: expanded from macro 'LAPACK_dpstrf'
    #define LAPACK_dpstrf( ... ) LAPACK_dpstrf_base( __VA_ARGS__ )
                                 ^
/usr/ports/math/lapackpp/work/lapackpp-2023.11.05/config/lapack_pstrf.cc:11:50: note: expanded from macro 'LAPACK_dpstrf_base'
#define LAPACK_dpstrf_base FORTRAN_NAME( dpstrf, DPSTRF )
                                                 ^
6 errors generated.

Version: 2023.11.05
lapack-3.11.0
clang-16
FreeBSD 13.2

@mgates3
Copy link
Collaborator

mgates3 commented Dec 14, 2023

What BLAS and LAPACK libraries are you using?
Is LAPACK part of your BLAS library (as in Intel MKL, Cray LibSci, usually OpenBLAS; not IBM ESSL), or are there separate libraries (e.g., libblas.so and liblapack.so)?
Is liblapack.so or liblapack.a in your compiler's LIBRARY_PATH?

Please include the complete input and output of CMake, including any environment variables you may have set ($CXX, $LIBRARY_PATH, etc.).

You can also try the Makefile-based configure. Even if it fails with the same issue, it generates a config/log.txt file for diagnosis.

    lapackpp> make config

You can also try

    lapackpp> mkdir build && cd build
    lapackpp/build> cmake -DCMAKE_MESSAGE_LOG_LEVEL=TRACE ..

but the output is quite verbose and difficult to understand.

Mark

@yurivict
Copy link
Author

Here is a complete log.

lapack-3.11.0 is from https://github.com/Reference-LAPACK/lapack/archive/refs/tags/

openblas-0.3.20 is used.

MKL is a linux-only package and isn't available on *BSD.

@yurivict
Copy link
Author

@mgates3

Hi Mark,

The build is still failing.

First, LAPACK_LIBRARIES aren't passed to cmake/LAPACKFinder.cmake
Second, when LAPACK_LIBRARIES is passed as blaspp, lapack_pstrf.cc fails to compile because it needs -DFORTRAN_ADD_ which isn't provided.

Do you know how to resolve these issues?

Thank you,
Yuri

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