qsimulate-open / bagel

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

Issues compiling BAGEL in Ubuntu 20.04.4 LTS #252

Closed AleksandraLeszczyk closed 2 years ago

AleksandraLeszczyk commented 2 years ago

I am trying to compile Bagel using Installation - BAGEL Manual. I downloaded a code from the master branch.

I am using gcc compiler (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, Boost, Intel's OneAPI MKL, LAPACK, ScaLAPACK, and MPI libraries. For configuration, I used the following command:

../configure CXXFLAGS="-DNDEBUG -O3 -mavx" --enable-mkl --with-boost=$BOOST_ROOT --with-mpi=intel

The compilation (make -j4) stopped with an error. The tail of the output reads as follows.

libtool: link: mpicxx -I../.. -DNDEBUG -O3 -mavx -o .libs/BAGEL main.o  ./.libs/libbagel.so opt/.libs/libbagel_opt.so multi/zcasscf/.libs/libbagel_zcasscf.so ci/zfci/.libs/libbagel_zfci.so ci/fci/.libs/libbagel_fci.so ci/ras/.libs/libbagel_ras.so response/.libs/libbagel_response.so scf/.libs/libbagel_scf.so multi/casscf/.libs/libbagel_casscf.so pt2/.libs/libbagel_pt2.so grad/.libs/libbagel_grad.so wfn/.libs/libbagel_wfn.so df/.libs/libbagel_df.so smith/.libs/libbagel_smith.so prop/.libs/libbagel_prop.so asd/.libs/libbagel_asd.so asd/dmrg/.libs/libbagel_asd_dmrg.so asd/orbital/.libs/libbagel_asd_orbital.so asd/dimer/.libs/libbagel_dimer.so asd/multisite/.libs/libbagel_multisite.so ci/ciutil/.libs/libbagel_ciutil.so mat1e/.libs/libbagel_mat1e.so periodic/.libs/libbagel_periodic.so integral/.libs/libbagel_integral.so molecule/.libs/libbagel_molecule.so util/io/.libs/libbagel_io.so util/.libs/libbagel_util.so util/parallel/.libs/libbagel_parallel.so util/math/.libs/libbagel_math.so util/input/.libs/libbagel_input.so -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -lboost_unit_test_framework -lboost_regex -lboost_serialization -Wl,-rpath -Wl,/usr/local/bagel/lib
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::RelFCI::RelFCI(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>, int, int, std::shared_ptr<bagel::ZCoeff_Block const>, bool, bool)'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `vtable for bagel::RASCivector_impl<double>'
/usr/bin/ld: smith/.libs/libbagel_smith.so: undefined reference to `bagel::ZHarrison::read_external_rdm3(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZHarrison::rdm3(int, int) const'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::ApplyOperator::operator()(double, bagel::RASBlockVectors const&, bagel::RASBlockVectors&, std::vector<bagel::GammaSQ, std::allocator<bagel::GammaSQ> > const&, std::vector<int, std::allocator<int> > const&) const'
/usr/bin/ld: pt2/.libs/libbagel_pt2.so: undefined reference to `bagel::ZCASSecond::ZCASSecond(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>)'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZCASNoopt::ZCASNoopt(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>)'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::RASDeterminants::RASDeterminants(int, int, int, int, int, int, int, bool)'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RASCivecView_<double>::RASCivecView_(std::shared_ptr<bagel::RASDeterminants const>, double*)'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `vtable for bagel::RASCivector<double>'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::FormSigmaRAS::operator()(std::shared_ptr<bagel::Dvector_base<bagel::RASCivector<double> > const>, std::shared_ptr<bagel::MOFile const>, std::vector<int, std::allocator<int> > const&) const'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `vtable for bagel::ZHarrison'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::CIS::CIS(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>)'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::RASCivector<double>::spin() const'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RAS::spin_raise_impl(bagel::RASCivecView_<double>, bagel::RASCivecView_<double>)'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `typeinfo for bagel::ZHarrison'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::RelDvector<std::complex<double> >::extract_state(std::vector<int, std::allocator<int> >) const'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::RASCI::RASCI(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>)'
/usr/bin/ld: pt2/.libs/libbagel_pt2.so: undefined reference to `bagel::RelJop::compute_half[abi:cxx11](std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::ZMatrix const>, bool, bool)'
/usr/bin/ld: smith/.libs/libbagel_smith.so: undefined reference to `bagel::ZHarrison::read_external_rdm2(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: smith/.libs/libbagel_smith.so: undefined reference to `bagel::RelDvector<std::complex<double> >::clone() const'
/usr/bin/ld: pt2/.libs/libbagel_pt2.so: undefined reference to `bagel::ZCASSCF::conv_to_ref_(bool) const'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RASCivector_impl<double>::normalize()'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::Sparse_IJ::Sparse_IJ(std::shared_ptr<bagel::CIStringSet<bagel::RASString, void> const>, std::shared_ptr<bagel::CIStringSet<bagel::RASString, void> const>)'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RAS::DenomTask::compute()'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZCASNoopt_London::ZCASNoopt_London(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>)'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RAS::spin_lower_impl(bagel::RASCivecView_<double>, bagel::RASCivecView_<double>)'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZHarrison::rdm1(int, int) const'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::RASCivector<double>::spin_lower(std::shared_ptr<bagel::RASDeterminants const>) const'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::FCI_London::FCI_London(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>, int, int, std::shared_ptr<bagel::ZCoeff_Block const>)'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZHarrison::rdm4(int, int) const'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::ApplyOperator::operator()(double, bagel::RASCivecView_<double>, bagel::RASCivecView_<double>, std::vector<bagel::GammaSQ, std::allocator<bagel::GammaSQ> > const&, std::vector<int, std::allocator<int> > const&) const'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RASCivector_impl<double>::print(double) const'
/usr/bin/ld: pt2/.libs/libbagel_pt2.so: undefined reference to `bagel::RelJop::compute_full(std::shared_ptr<bagel::ZMatrix const>, std::__cxx11::list<std::shared_ptr<bagel::RelDFHalf>, std::allocator<std::shared_ptr<bagel::RelDFHalf> > >, bool)'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZFCI_bare::ZFCI_bare(std::shared_ptr<bagel::CIWfn_<bagel::RelDvector<std::complex<double> >, std::pair<std::shared_ptr<bagel::RelSpace const>, std::shared_ptr<bagel::RelSpace const> > > const>)'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RAS::spin_impl(bagel::RASCivecView_<double>, bagel::RASCivecView_<double>)'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZCASNoopt_base::compute()'
/usr/bin/ld: asd/dmrg/.libs/libbagel_asd_dmrg.so: undefined reference to `bagel::RASCivecView_<double>::data()'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::RASCivector<double>::RASCivector(std::shared_ptr<bagel::RASDeterminants const>)'
/usr/bin/ld: smith/.libs/libbagel_smith.so: undefined reference to `bagel::ZHarrison::read_external_rdm1(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: smith/.libs/libbagel_smith.so: undefined reference to `bagel::ZHarrison::read_external_rdm4(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::FormSigmaRAS::operator()(std::shared_ptr<bagel::Dvector_base<bagel::RASCivector<double> > const>, std::shared_ptr<bagel::Matrix const>, std::shared_ptr<bagel::Matrix const>, std::vector<int, std::allocator<int> > const&) const'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZHarrison::rdm2(int, int) const'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::RASCivector<double>::spin_raise(std::shared_ptr<bagel::RASDeterminants const>) const'
/usr/bin/ld: wfn/.libs/libbagel_wfn.so: undefined reference to `bagel::ZCASSecond_London::ZCASSecond_London(std::shared_ptr<bagel::PTree const>, std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::Reference const>)'
/usr/bin/ld: asd/.libs/libbagel_asd.so: undefined reference to `bagel::RASCivector_impl<double>::synchronize(int)'
/usr/bin/ld: smith/.libs/libbagel_smith.so: undefined reference to `bagel::ZHarrison::rdm34f(int, int, std::shared_ptr<bagel::ZMatrix const>) const'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:536: BAGEL] Error 1
make[3]: Leaving directory '/home/ola/src/bagel/bagel-1.1.1/obj/src'
make[2]: *** [Makefile:592: all-recursive] Error 1
make[2]: Leaving directory '/home/ola/src/bagel/bagel-1.1.1/obj/src'
make[1]: *** [Makefile:416: all-recursive] Error 1
make[1]: Leaving directory '/home/ola/src/bagel/bagel-1.1.1/obj'
make: *** [Makefile:348: all] Error 2

How can I solve this issue?

shiozaki commented 2 years ago

Most likely adding

--disable-shared --enable-static

would solve the issue. Could you try?

AleksandraLeszczyk commented 2 years ago

It is working. Thanks!