SebWouters / CheMPS2

CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
GNU General Public License v2.0
70 stars 34 forks source link

clang-40 build on FreeBSD fails: undefined reference to `dorglq_' #62

Closed yurivict closed 7 years ago

yurivict commented 7 years ago

Build fails:

libchemps2.so.2: undefined reference to `dorglq_'
libchemps2.so.2: undefined reference to `dgemm_'
libchemps2.so.2: undefined reference to `daxpy_'
libchemps2.so.2: undefined reference to `dlasrt_'
libchemps2.so.2: undefined reference to `dgesdd_'
libchemps2.so.2: undefined reference to `dsyev_'
libchemps2.so.2: undefined reference to `dlange_'
libchemps2.so.2: undefined reference to `dcopy_'
libchemps2.so.2: undefined reference to `dscal_'
libchemps2.so.2: undefined reference to `dgelqf_'
libchemps2.so.2: undefined reference to `ddot_'
libchemps2.so.2: undefined reference to `dorgqr_'
libchemps2.so.2: undefined reference to `dgeqrf_'
libchemps2.so.2: undefined reference to `dgemv_'
libchemps2.so.2: undefined reference to `dlansy_'
loriab commented 7 years ago

Sorry, you can't escape me on GH this weekend, it seems, @yurivict. It looks like lapack isn't getting linked in properly. The latest commit to this repo has some additional notes. If it's helpful, my packaging scripts are here.

yurivict commented 7 years ago

This is because cmake fails to find lapack.

I use openblas and have to supply CMAKE_ARGS+=-DLAPACK_LIBRARIES="-lopenblas", otherwise it can't find it.

loriab commented 7 years ago

Yes, the usual CMake find_package(LAPACK) didn't work with OpenBLAS until CMake 3.6, so it's possibly not surprising you had to seed your build.

This incomplete LAPACK support is part of the reason Psi uses more sophisticated math detection internally, then conveys that library/header configuration through the TargetLAPACK files that trouble you.

yurivict commented 7 years ago

There are also several LAPACK implementations that can be installed at the same time. It isn't clear how can cmake even decide which one to use.