qsimulate-open / bagel

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

Problems compilling BAGEL using Boost 1.79.0 #258

Open rdguerrerom opened 1 year ago

rdguerrerom commented 1 year ago

Hi,

On macOS, after a successful compilation, when I try to run the executable I am getting the following error message:

$ BAGEL --help
dyld[30513]: symbol not found in flat namespace (__ZN5boost7archive23basic_binary_iprimitiveINS0_15binary_iarchiveEcSt11char_traitsIcEE4initEv)
Abort trap: 6

Demangling what is in parentheses I get:

$ echo __ZN5boost7archive23basic_binary_iprimitiveINS0_15binary_iarchiveEcSt11char_traitsIcEE4initEv | c++filt -s
boost::archive::basic_binary_iprimitive<boost::archive::binary_iarchive, char, std::char_traits<char> >::init()

I am using the following version of the Boost library:

$ brew info boost
==> boost: stable 1.79.0 (bottled), HEAD
Collection of portable C++ source libraries
https://www.boost.org/
/usr/local/Cellar/boost/1.79.0_2 (15,462 files, 469MB) *
  Poured from bottle on 2022-09-25 at 09:17:30
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/boost.rb
License: BSL-1.0
==> Dependencies
Required: icu4c ✔, xz ✔, zstd ✔
==> Options
--HEAD
    Install HEAD version
==> Analytics
install: 144,598 (30 days), 411,125 (90 days), 1,133,106 (365 days)
install-on-request: 46,734 (30 days), 108,968 (90 days), 272,082 (365 days)
build-error: 35 (30 days)

Finally, BAGEL was configured using the following options:

./configure MPICC=cc CC=gcc-11 CXX=g++-11 CXXFLAGS="-std=c++17" --with-boost=/usr/local/Cellar/boost/1.79.0_2 --with-boost-serialization=boost_serialization-mt --disable-smith

Thanks in advance for your help.

shiozaki commented 1 year ago

I suggest that you compile with

--enable-static --disable-shared

It should not link due to missing symbols. I discourage the use of "--with-boost-serialization" or any other similar flags.

If you cannot identify the issue, you could write a small program related to Archive/serialization and make sure your can compile it.

PS: this function is supposed to be in boost (1.79.0) https://www.boost.org/doc/libs/1_79_0/boost/archive/basic_binary_iprimitive.hpp