Bug#1039904: libopenblas64-pthread-dev: 64-bit lapack-openblas.pc needs -lopenblas64
Drew Parsons
dparsons at debian.org
Thu Jun 29 11:58:40 BST 2023
Package: libopenblas64-pthread-dev
Version: 0.3.23+ds-2
Severity: important
I'm trying to build hypre 2.29.0. It uses lapack+blas, configuring
via pkg-config to get the appropriate -llapack -lblas flags. The
debian hypre package builds both 32 bit and 64 bit variants of
libhypre.so.
On my local system blas,lapack are installed as OpenBLAS-pthread
(libopenblas-pthread-dev, libopenblas64-pthread-dev)
The 64-bit variant of hypre fails to build with an error
mpicc -shared -o libHYPRE64-2.29.0.so .... -L/usr/lib/x86_64-linux-gnu/openblas64-pthread -llapack64 -L/usr/lib/x86_64-linux-gnu/openblas64-pthread -lblas64 -lmpi -lm ....
/usr/bin/ld: /home/drew/projects/mathlibs/build/hypre/src64/parcsr_ls/par_mgr.o: in function `hypre_BlockDiagInvLapack':
./src64/parcsr_ls/./src64/parcsr_ls/par_mgr.c:4430: undefined reference to `dgetri_'
/usr/bin/ld: ./src64/parcsr_ls/./src64/parcsr_ls/par_mgr.c:4422: undefined reference to `dgetri_'
...
/usr/bin/ld: /home/drew/projects/mathlibs/build/hypre/src64/parcsr_ls/schwarz.o:./src64/parcsr_ls/./src64/parcsr_ls/schwarz.c:1083: more undefined references to `dpotrs_' follow
/usr/bin/ld: /home/drew/projects/mathlibs/build/hypre/src64/parcsr_mv/par_csr_matop.o: in function `hypre_ParcsrBdiagInvScal':
./src64/parcsr_mv/./src64/parcsr_mv/par_csr_matop.c:4573: undefined reference to `dgetri_'
/usr/bin/ld: ./src64/parcsr_mv/./src64/parcsr_mv/par_csr_matop.c:4583: undefined reference to `dgetri_'
/usr/bin/ld: /home/drew/projects/mathlibs/build/hypre/src64/parcsr_ls/ame.obj: in function `hypre_AMESolve':
./src64/parcsr_ls/./src64/parcsr_ls/ame.c:840: undefined reference to `dsygv_'
collect2: error: ld returned 1 exit status
openblas uses the debian BLAS alternatives system.
The pkgconfig file alternative for lapack64.pc points at
/usr/lib/x86_64-linux-gnu/openblas64-pthread/pkgconfig/lapack-openblas.pc
The liblapack64.so alternative points ultimate at
/usr/lib/x86_64-linux-gnu/openblas64-pthread/liblapack64.so
which is not the same as
/usr/lib/x86_64-linux-gnu/openblas64-pthread/libopenblas64.so
both provided by libopenblas64-0-pthread
lapack-openblas.pc defines the lib as -llapack64 not -lopenblas64
(which is reasonable)
If I inspect
$ nm -D /usr/lib/x86_64-linux-gnu/openblas64-pthread/liblapack64.so | grep -P "dgetri_|dsygv_"
I see the symbols are indeed missing.
though they can be found in the 32 bit variant
$ nm -D /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so | grep
-P "dgetri_|dsygv_"
000000000020cdd0 T dgetri_
00000000002e4c80 T dsygv_
00000000002e5110 T dsygv_2stage_
I find the symbols are also found (in 64 bit) in libopenblas64.so
$ nm -D /usr/lib/x86_64-linux-gnu/openblas64-pthread/libopenblas64.so
| grep -P "dgetri_|dsygv_"
0000000001cd7e20 T dgetri_
0000000001db1c40 T dsygv_
0000000001db2110 T dsygv_2stage_
I also see from
objdump -p /usr/lib/x86_64-linux-gnu/openblas64-pthread/liblapack64.so
that openblas's liblapack64.so needs
NEEDED libopenblas64.so.0
Following that, I can get hypre to compile by adding -lopenblas64
after -llapack64.
So it looks like lapack-openblas.pc is incomplete
It currently declares (for openblas64-pthread)
Libs: -L${libdir} -llapack64
Looks like that should be
Libs: -L${libdir} -llapack64 -lopenblas64
(I guess Libs.private should be patched the same way)
I presume the same problem also exists with libopenblas64-openmp-dev
and libopenblas64-serial-dev
-- System Information:
Debian Release: trixie/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental')
merged-usr: no
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.3.0-1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages libopenblas64-pthread-dev depends on:
ii libopenblas64-0-pthread 0.3.23+ds-2
libopenblas64-pthread-dev recommends no packages.
libopenblas64-pthread-dev suggests no packages.
-- no debconf information
More information about the debian-science-maintainers
mailing list