qsimulate-open / bagel

Brilliantly Advanced General Electronic-structure Library
GNU General Public License v3.0
92 stars 44 forks source link

Failed to compile & link bagel dynamic library #236

Closed rangsimanketkaew closed 2 years ago

rangsimanketkaew commented 2 years ago

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:

source /project/s1001/intel/mpi/2021.5.0/env/vars.sh intel64

../configure CXXFLAGS="-DNDEBUG -O3 -Wl,--no-as-needed" \
    --with-boost=/apps/daint/UES/jenkins/7.0.UP02-20.11/gpu/easybuild/software/Boost/1.70.0-CrayGNU-20.11/ \
    --with-mpi=intel  --disable-scalapack \
    --with-include="-I/opt/cray/pe/libsci/20.09.1/GNU/8.1/x86_64/include/" \
    --prefix=/project/s1001/bagel-1.2.2/

make -j 12

Compiling each object seems to go well but I got stuck when linking. Here is the error:

...
snipped out
...
/bin/sh ../libtool  --tag=CXX   --mode=link mpicxx -I../.. -I/opt/cray/pe/libsci/20.09.1/GNU/8.1/x86_64/include/ -DNDEBUG -O3 -Wl,--copy-dt-needed-entries -Wl,--no-as-needed  -L/apps/daint/UES/jenkins/7.0.UP02-20.11/gpu/easybuild/software/Boost/1.70.0-CrayGNU-20.11//lib64  -o BAGEL main.o libbagel.la opt/libbagel_opt.la multi/zcasscf/libbagel_zcasscf.la ci/zfci/libbagel_zfci.la ci/fci/libbagel_fci.la ci/ras/libbagel_ras.la response/libbagel_response.la scf/libbagel_scf.la multi/casscf/libbagel_casscf.la pt2/libbagel_pt2.la grad/libbagel_grad.la wfn/libbagel_wfn.la df/libbagel_df.la smith/libbagel_smith.la prop/libbagel_prop.la asd/libbagel_asd.la asd/dmrg/libbagel_asd_dmrg.la asd/orbital/libbagel_asd_orbital.la asd/dimer/libbagel_dimer.la asd/multisite/libbagel_multisite.la ci/ciutil/libbagel_ciutil.la mat1e/libbagel_mat1e.la integral/libbagel_integral.la molecule/libbagel_molecule.la util/io/libbagel_io.la util/libbagel_util.la util/parallel/libbagel_parallel.la util/math/libbagel_math.la util/input/libbagel_input.la -lboost_regex -lboost_unit_test_framework -lboost_serialization
libtool: link: mpicxx -I../.. -I/opt/cray/pe/libsci/20.09.1/GNU/8.1/x86_64/include/ -DNDEBUG -O3 -Wl,--copy-dt-needed-entries -Wl,--no-as-needed -o .libs/BAGEL main.o  -L/apps/daint/UES/jenkins/7.0.UP02-20.11/gpu/easybuild/software/Boost/1.70.0-CrayGNU-20.11//lib64 ./.libs/libbagel.so -L/apps/daint/UES/jenkins/7.0.UP02-20.11/gpu/easybuild/software/Boost/1.75.0-CrayGNU-20.11//lib64 opt/.libs/libbagel_opt.a multi/zcasscf/.libs/libbagel_zcasscf.a ci/zfci/.libs/libbagel_zfci.a ci/fci/.libs/libbagel_fci.a ci/ras/.libs/libbagel_ras.a response/.libs/libbagel_response.a scf/.libs/libbagel_scf.a multi/casscf/.libs/libbagel_casscf.a pt2/.libs/libbagel_pt2.a grad/.libs/libbagel_grad.a wfn/.libs/libbagel_wfn.a df/.libs/libbagel_df.a smith/.libs/libbagel_smith.a prop/.libs/libbagel_prop.a asd/.libs/libbagel_asd.a asd/dmrg/.libs/libbagel_asd_dmrg.a asd/orbital/.libs/libbagel_asd_orbital.a asd/dimer/.libs/libbagel_dimer.a asd/multisite/.libs/libbagel_multisite.a ci/ciutil/.libs/libbagel_ciutil.a mat1e/.libs/libbagel_mat1e.a integral/.libs/libbagel_integral.a molecule/.libs/libbagel_molecule.a util/io/.libs/libbagel_io.a util/.libs/libbagel_util.a util/parallel/.libs/libbagel_parallel.a /opt/gcc/9.3.0/snos/lib/../lib64/libstdc++.so util/math/.libs/libbagel_math.a util/input/.libs/libbagel_input.a /opt/gcc/10.3.0/snos/lib/../lib64/libstdc++.so -lm -lboost_regex -lboost_unit_test_framework -lboost_serialization -Wl,-rpath -Wl,/usr/local/bagel/lib -Wl,-rpath -Wl,/opt/gcc/9.3.0/snos/lib/../lib64 -Wl,-rpath -Wl,/opt/gcc/10.3.0/snos/lib/../lib64
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zgemm_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `dger_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `dsyev_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zheev_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_dscal'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_zaxpy'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zlartg_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_daxpy'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zgesv_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zscal_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_zdotc_sub'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zgerc_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_zscal'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zdotc_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zaxpy_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_zgemm'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `dgemm_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `dgesvd_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `ddot_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zgemv_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_dgemm'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zhbev_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_dgemv'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `dgesv_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zrot_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `daxpy_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zlarfg_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_ddot'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zgesvd_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `cblas_zgemv'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `dgemv_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `dscal_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `zgeru_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `ztrmv_'
/usr/bin/ld: ./.libs/libbagel.so: undefined reference to `drot_'
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

Here is my $LD_LIBRARY_PATH:

/project/s1001/intel/mpi/2021.5.0//libfabric/lib:/project/s1001/intel/mpi/2021.5.0//lib/release:/project/s1001/intel/mpi/2021.5.0//lib:/opt/cray/pe/mpt/7.7.16/gni/mpich-gnu/8.2/lib:/opt/cray/pe/perftools/20.10.0/lib64:/opt/cray/rca/2.2.20-7.0.2.1_2.93__g8e3fb5b.ari/lib64:/opt/cray/alps/6.6.59-7.0.2.1_3.85__g872a8d62.ari/lib64:/opt/cray/xpmem/2.2.20-7.0.2.1_2.72__g87eb960.ari/lib64:/opt/cray/dmapp/7.1.1-7.0.2.1_2.98__g38cf134.ari/lib64:/opt/cray/pe/pmi/5.0.17/lib64:/opt/cray/ugni/6.0.14.0-7.0.2.1_3.77__ge78e5b0.ari/lib64:/opt/cray/udreg/2.3.2-7.0.2.1_2.52__g8175d3d.ari/lib64:/opt/cray/pe/libsci/20.09.1/GNU/8.1/x86_64/lib:/apps/daint/UES/jenkins/7.0.UP02-20.11/gpu/easybuild/software/Boost/1.70.0-CrayGNU-20.11/lib:/apps/daint/UES/jenkins/7.0.UP02-20.11/gpu/easybuild/software/zlib/1.2.11-CrayGNU-20.11/lib:/apps/daint/UES/jenkins/7.0.UP02-20.11/gpu/easybuild/software/bzip2/1.0.6-CrayGNU-20.11/lib:/opt/cray/pe/papi/6.0.0.4/lib64:/opt/cray/job/2.2.4-7.0.2.1_2.86__g36b56f4.ari/lib64:/opt/gcc/10.3.0/snos/lib64:/users/rketkaew/src/eiger/plumed-2.7.1/lib/:/users/rketkaew/src/gmp-6.2.1-installed/lib/:/users/rketkaew/src/nettle-3.6-installed/lib64/:/users/rketkaew/src/eiger/plumed-2.7.1/lib/:/users/rketkaew/src/gmp-6.2.1-installed/lib/:/users/rketkaew/src/nettle-3.6-installed/lib64/:/apps/daint/UES/xalt/xalt2/software/xalt/2.8.10/lib64:/apps/daint/UES/xalt/xalt2/software/xalt/2.8.10/lib

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.log

Any ideas/suggestions to solve the issue?

rangsimanketkaew commented 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?

shiozaki commented 2 years ago

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.

shiozaki commented 2 years ago

Ps: Probably the easiest is to use MKL and toggle MKL on at configure. I will close this issue for now.

rangsimanketkaew commented 2 years ago

Thank you.