Closed rangsimanketkaew closed 2 years ago
I ignored Cray libsci and compiled BLAS and LAPACK from the source, and explicitly added them to CXXFLAGS:
CXXFLAGS="-DNDEBUG -O3 -Wl,--no-as-needed -L/users/rketkaew/src/lapack-3.10.0 -L/users/rketkaew/src/BLAS-3.10.0"
and also used --enable-static --disable-shared
.
This is what I got:
...
...
/usr/bin/ld: blocked.cc:(.text+0x1e9): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x2ae): undefined reference to `zgemv_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract<(ts::impl::(anonymous namespace)::Trans)0, 1ul, 2ul, 2ul, 1ul, 1ul, 1ul>(std::complex<double>, ts::impl::SuperMatrix<1ul, 2ul> const&, ts::impl::SuperMatrix<2ul, 1ul> const&, ts::impl::SuperMatrix<1ul, 1ul>&) [clone .constprop.0]':
blocked.cc:(.text+0x37b): undefined reference to `zgemv_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract_tr<(ts::impl::(anonymous namespace)::Trans)0, 3ul, 2ul, 2ul, 1ul, 3ul, 1ul>(std::complex<double>, ts::impl::SuperMatrix<3ul, 2ul> const&, ts::impl::SuperMatrix<2ul, 1ul> const&, ts::impl::SuperMatrix<3ul, 1ul>&, std::complex<double>*) [clone .constprop.0]':
blocked.cc:(.text+0x480): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x4d0): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x5ab): undefined reference to `zgemv_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract_tr<(ts::impl::(anonymous namespace)::Trans)0, 1ul, 2ul, 2ul, 1ul, 1ul, 1ul>(std::complex<double>, ts::impl::SuperMatrix<1ul, 2ul> const&, ts::impl::SuperMatrix<2ul, 1ul> const&, ts::impl::SuperMatrix<1ul, 1ul>&, std::complex<double>*) [clone .constprop.0]':
blocked.cc:(.text+0x671): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x6aa): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x756): undefined reference to `zgemv_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract<(ts::impl::(anonymous namespace)::Trans)0, 1ul, 3ul, 3ul, 1ul, 1ul, 1ul>(std::complex<double>, ts::impl::SuperMatrix<1ul, 3ul> const&, ts::impl::SuperMatrix<3ul, 1ul> const&, ts::impl::SuperMatrix<1ul, 1ul>&) [clone .constprop.0]':
blocked.cc:(.text+0x82f): undefined reference to `zgemv_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract<(ts::impl::(anonymous namespace)::Trans)0, (ts::impl::(anonymous namespace)::Trans)0, 1ul, 3ul, 3ul, 1ul, 1ul, 1ul>(std::complex<double>, ts::impl::SuperMatrix<1ul, 3ul> const&, ts::impl::SuperMatrix<3ul, 1ul> const&, ts::impl::SuperMatrix<1ul, 1ul>&) [clone .constprop.0]':
blocked.cc:(.text+0x95e): undefined reference to `zgemm_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract<(ts::impl::(anonymous namespace)::Trans)1, (ts::impl::(anonymous namespace)::Trans)1, 3ul, 1ul, 1ul, 3ul, 1ul, 1ul>(std::complex<double>, ts::impl::SuperMatrix<3ul, 1ul> const&, ts::impl::SuperMatrix<1ul, 3ul> const&, ts::impl::SuperMatrix<1ul, 1ul>&) [clone .constprop.0]':
blocked.cc:(.text+0xa8e): undefined reference to `zgemm_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract<(ts::impl::(anonymous namespace)::Trans)0, (ts::impl::(anonymous namespace)::Trans)2, 1ul, 2ul, 3ul, 2ul, 1ul, 3ul>(std::complex<double>, ts::impl::SuperMatrix<1ul, 2ul> const&, ts::impl::SuperMatrix<3ul, 2ul> const&, ts::impl::SuperMatrix<1ul, 3ul>&) [clone .constprop.0]':
blocked.cc:(.text+0xbd8): undefined reference to `zgemm_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `void ts::impl::(anonymous namespace)::contract<(ts::impl::(anonymous namespace)::Trans)0, (ts::impl::(anonymous namespace)::Trans)2, 1ul, 2ul, 1ul, 2ul, 1ul, 1ul>(std::complex<double>, ts::impl::SuperMatrix<1ul, 2ul> const&, ts::impl::SuperMatrix<1ul, 2ul> const&, ts::impl::SuperMatrix<1ul, 1ul>&) [clone .constprop.0]':
blocked.cc:(.text+0xd28): undefined reference to `zgemm_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `ts::impl::panel_update(int, int, std::complex<double>*, std::complex<double>*, std::complex<double>*, std::complex<double>*, int, int, std::complex<double>*)':
blocked.cc:(.text+0x17c1): undefined reference to `zlartg_'
/usr/bin/ld: blocked.cc:(.text+0x1c81): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x1d76): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x1deb): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x1e7c): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x1f88): undefined reference to `zaxpy_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o):blocked.cc:(.text+0x2261): more undefined references to `zaxpy_' follow
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `ts::impl::panel_update(int, int, std::complex<double>*, std::complex<double>*, std::complex<double>*, std::complex<double>*, int, int, std::complex<double>*)':
blocked.cc:(.text+0x28e5): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x2929): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x29bf): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x2bab): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x2e21): undefined reference to `zscal_'
/usr/bin/ld: blocked.cc:(.text+0x3280): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x338e): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x359a): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x3734): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x3798): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x3a42): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x3a82): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x3ea9): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x3f6f): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x3fea): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x4079): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x40f8): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x42ee): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x4332): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x45fd): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x4660): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x4930): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x4a79): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x4af7): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x4c7f): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x4d0b): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x4d86): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x4e01): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x4f9e): undefined reference to `zaxpy_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o):blocked.cc:(.text+0x4fed): more undefined references to `zaxpy_' follow
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `ts::impl::panel_update(int, int, std::complex<double>*, std::complex<double>*, std::complex<double>*, std::complex<double>*, int, int, std::complex<double>*)':
blocked.cc:(.text+0x527c): undefined reference to `zlarfg_'
/usr/bin/ld: blocked.cc:(.text+0x5347): undefined reference to `zdotc_'
/usr/bin/ld: blocked.cc:(.text+0x561e): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x56d3): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x5740): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x57a9): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x5835): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x58c1): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x594d): undefined reference to `zaxpy_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o):blocked.cc:(.text+0x59d9): more undefined references to `zaxpy_' follow
/usr/bin/ld: ./.libs/libbagel.a(blocked.o): in function `ts::impl::panel_update(int, int, std::complex<double>*, std::complex<double>*, std::complex<double>*, std::complex<double>*, int, int, std::complex<double>*)':
blocked.cc:(.text+0x5a98): undefined reference to `zlarfg_'
/usr/bin/ld: blocked.cc:(.text+0x5eaf): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x5ef7): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x5fac): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x6250): undefined reference to `ztrmv_'
/usr/bin/ld: blocked.cc:(.text+0x6295): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x65f0): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x67e8): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x6a53): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x6b0a): undefined reference to `zlarfg_'
/usr/bin/ld: blocked.cc:(.text+0x72de): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x74e1): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x779d): undefined reference to `zdotc_'
/usr/bin/ld: blocked.cc:(.text+0x7855): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x7abf): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x7c07): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x7d62): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x7e9a): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x8151): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x822e): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x84b4): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x85f3): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x8721): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x87c3): undefined reference to `zgemv_'
/usr/bin/ld: blocked.cc:(.text+0x882e): undefined reference to `zdotc_'
/usr/bin/ld: blocked.cc:(.text+0x88dd): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x89d8): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x8a30): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x8b2d): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x8bf8): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x8c63): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x8cca): undefined reference to `zaxpy_'
/usr/bin/ld: blocked.cc:(.text+0x8dc6): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x8f23): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x92a2): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x93b7): undefined reference to `zgemm_'
/usr/bin/ld: blocked.cc:(.text+0x96b6): undefined reference to `zgemm_'
/usr/bin/ld: ./.libs/libbagel.a(blocked.o):blocked.cc:(.text+0x982e): more undefined references to `zgemm_' follow
/usr/bin/ld: ./.libs/libbagel.a(rmawindow.o): in function `bagel::RMAWindow<double>::scale(double const&)':
rmawindow.cc:(.text._ZN5bagel9RMAWindowIdE5scaleERKd[_ZN5bagel9RMAWindowIdE5scaleERKd]+0x67): undefined reference to `dscal_'
/usr/bin/ld: ./.libs/libbagel.a(rmawindow.o): in function `bagel::RMAWindow<std::complex<double> >::scale(std::complex<double> const&)':
rmawindow.cc:(.text._ZN5bagel9RMAWindowISt7complexIdEE5scaleERKS2_[_ZN5bagel9RMAWindowISt7complexIdEE5scaleERKS2_]+0x75): undefined reference to `zscal_'
/usr/bin/ld: ./.libs/libbagel.a(unblocked.o): in function `ts::impl::unblocked_update(int, std::complex<double>*, std::complex<double>*, std::complex<double>*, std::complex<double>*, int, int, std::complex<double>*)':
unblocked.cc:(.text+0x1e1): undefined reference to `zlartg_'
/usr/bin/ld: unblocked.cc:(.text+0x247): undefined reference to `zrot_'
/usr/bin/ld: unblocked.cc:(.text+0x2f1): undefined reference to `zrot_'
/usr/bin/ld: unblocked.cc:(.text+0x3c3): undefined reference to `zrot_'
/usr/bin/ld: unblocked.cc:(.text+0x52a): undefined reference to `zlarfg_'
/usr/bin/ld: unblocked.cc:(.text+0x699): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0x717): undefined reference to `zdotc_'
/usr/bin/ld: unblocked.cc:(.text+0x7d9): undefined reference to `zaxpy_'
/usr/bin/ld: unblocked.cc:(.text+0x878): undefined reference to `zgerc_'
/usr/bin/ld: unblocked.cc:(.text+0x902): undefined reference to `zgeru_'
/usr/bin/ld: unblocked.cc:(.text+0x99e): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0xa1d): undefined reference to `zgeru_'
/usr/bin/ld: unblocked.cc:(.text+0xaaa): undefined reference to `zgeru_'
/usr/bin/ld: unblocked.cc:(.text+0xb4c): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0xbe2): undefined reference to `zgeru_'
/usr/bin/ld: unblocked.cc:(.text+0xc81): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0xd14): undefined reference to `zgeru_'
/usr/bin/ld: unblocked.cc:(.text+0xdd2): undefined reference to `zlarfg_'
/usr/bin/ld: unblocked.cc:(.text+0xf4e): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0xfbf): undefined reference to `zdotc_'
/usr/bin/ld: unblocked.cc:(.text+0x1086): undefined reference to `zaxpy_'
/usr/bin/ld: unblocked.cc:(.text+0x110b): undefined reference to `zgerc_'
/usr/bin/ld: unblocked.cc:(.text+0x11b2): undefined reference to `zgerc_'
/usr/bin/ld: unblocked.cc:(.text+0x124c): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0x12ee): undefined reference to `zgeru_'
/usr/bin/ld: unblocked.cc:(.text+0x138a): undefined reference to `zgerc_'
/usr/bin/ld: unblocked.cc:(.text+0x1427): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0x14ce): undefined reference to `zgerc_'
/usr/bin/ld: unblocked.cc:(.text+0x1568): undefined reference to `zgemv_'
/usr/bin/ld: unblocked.cc:(.text+0x1607): undefined reference to `zgerc_'
/usr/bin/ld: unblocked.cc:(.text+0x168d): undefined reference to `zrot_'
/usr/bin/ld: unblocked.cc:(.text+0x1706): undefined reference to `zrot_'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:544: BAGEL] Error 1
make[3]: Leaving directory '/users/rketkaew/src/bagel-1.2.2/obj/src'
make[2]: *** [Makefile:616: all-recursive] Error 1
make[2]: Leaving directory '/users/rketkaew/src/bagel-1.2.2/obj/src'
make[1]: *** [Makefile:421: all-recursive] Error 1
make[1]: Leaving directory '/users/rketkaew/src/bagel-1.2.2/obj'
make: *** [Makefile:353: all] Error 2
Any ideas?
You are failing to link papacy/blas. If I were you I would write a small c++ program and understand how to link them on your machine. This is not an issue with Bagel. Generally the reference blas is strongly discouraged.
I understand that this error is because BLAS is not linked properly, but how was it able to compile object files and didn't fail beforehand?
it only fails at link time because these functions have external linkage. It is the correct behavior.
Ps: Probably the easiest is to use MKL and toggle MKL on at configure. I will close this issue for now.
Thank you.
Hi all,
I've been trying to compile bagel 1.2.2 on the Swiss' Piz Daint supercomputer with Intel MPI.
System:
Tools:
Here are commands I used:
Compiling each object seems to go well but I got stuck when linking. Here is the error:
Here is my
$LD_LIBRARY_PATH
:I understand that this error is because BLAS is not linked properly, but how was it able to compile object files and didn't fail beforehand?
A
config.log
is also provided: config.logAny ideas/suggestions to solve the issue?