bitcoin-abc
bitcoin-abc copied to clipboard
Centos 7 Compile failure src/leveldb/db/version_set.cc:1267
Describe the issue
compiling v0.17.0 is hitting an error on centos 7. v0.16.2 compiled and running successfully.
Can you reliably reproduce the issue?
yes
If so, please list the steps to reproduce below:
install all dependencies (v0.16.2 was compiled and running already so I know this is good) git clone https://github.com/Bitcoin-ABC/bitcoin-abc cd bitcoin-abc git checkout v0.17.0 vi src/amount.h ### comment out line 123 because of can't initialize friend function 'operator*' error ./autogen.sh ./configure --without-gui --without-miniupnpc make
Expected behaviour
compile successfully
Actual behaviour
compiling ends early with:
CXX crypto/crypto_libbitcoin_crypto_a-sha512.o
CXX crypto/crypto_libbitcoin_crypto_a-sha256_sse4.o
AR crypto/libbitcoin_crypto.a
CXXLD bitcoind
univalue/.libs/libunivalue.a(libunivalue_la-univalue.o): In function std::vectr<UniValue, std::allocator<UniValue> >::_M_range_check(unsigned long) const':
/opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/bits/stl_vector.h:803: undefine reference tostd::throw_out_of_range_fmt(char const*, ...)'
/opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/bits/stl_vector.h:803: undefine reference to std::throw_out_of_range_fmt(char const, ...)' /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/bits/stl_vector.h:803: undefine reference to
std::__throw_out_of_range_fmt(char const, ...)'
/opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/bits/stl_vector.h:803: undefine reference to std::__throw_out_of_range_fmt(char const*, ...)'
univalue/.libs/libunivalue.a(libunivalue_la-univalue_write.o): In functionstd:vector<UniValue, std::allocator<UniValue> >::_M_range_check(unsigned long) cont':
/opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/bits/stl_vector.h:803: undefine reference to std::__throw_out_of_range_fmt(char const*, ...)'
leveldb/libleveldb.a(leveldb_libleveldb_a-version_set.o): In functionleveldb:VersionSet::MakeInputIterator(leveldb::Compaction*)':
/var/www/bitcoin-abc/src/leveldb/db/version_set.cc:1267: undefined reference to__cxa_throw_bad_array_new_length'
collect2: error: ld returned 1 exit status
make[2]: *** [bitcoind] Error 1
make[2]: Leaving directory/home/www/bitcoin-abc/src'
make[1]: [all-recursive] Error 1
make[1]: Leaving directory `/home/www/bitcoin-abc/src'
make: [all-recursive] Error 1
What version of GCC are you using? From reading some other issues, it looks like this is due to using a version of GCC less than 4.9
I was using an updated gcc through devtoolset-7. It was gcc version 7.2.1
Are you sure you selected that compiler when configuring the build? It looks like it's using devtoolset-3
: "/opt/rh/devtoolset-3/root/usr/include/c++/4.9.2". Although I don't know RedHat very well.
I tried compiling on 2 different centos machines with three different gcc versions. Both machines had compiled the prior bitcoin-abc version without errors. The gcc versions I tried were 4.8.5, 4.9.2, and 7.2.1. I guess it must be related to the compiler or one of the other dependencies. I switched to pre-compiled binaries so this is not urgent for me, although I am curious if anyone else is compiling on centos without a problem.