Error when compiling obj/db.o in latest GIT #2521

Closed
Zenitur opened this Issue Apr 13, 2013 · 13 comments

Comments

Projects
None yet
6 participants

Zenitur commented Apr 13, 2013

1). What OS and arch

Linux x86_64

2). What version

bitcoind latest GIT ac89a1e

3). What's wrong

Error when compiling

4). Logs

g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/obj -I/usr/include/db4.8 -DUSE_UPNP=1 -DUSE_IPV6=1 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/include -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2 -O2 -pipe -march=k8 -MMD -MF obj/txdb.d -o obj/txdb.o txdb.cpp
g++ -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/obj -I/usr/include/db4.8 -DUSE_UPNP=1 -DUSE_IPV6=1 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/include -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2 -O2 -pipe -march=k8 -o bitcoind leveldb/libleveldb.a obj/alert.o obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/rpcnet.o obj/rpcmining.o obj/rpcwallet.o obj/rpcblockchain.o obj/rpcrawtransaction.o obj/script.o obj/sync.o obj/util.o obj/wallet.o obj/walletdb.o obj/hash.o obj/bloom.o obj/noui.o obj/leveldb.o obj/txdb.o -Wl,-z,relro -Wl,-z,now -Wl,-O1 -Wl,--as-needed -Wl,-Bdynamic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx-4.8 -l ssl -l crypto -l miniupnpc -Wl,-Bdynamic -l z -l dl -l pthread /var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/libleveldb.a /var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/libmemenv.a
obj/db.o: In function void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)': db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0x73): undefined reference toboost::chrono::system_clock::now()'
db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0x7b): undefined reference to boost::chrono::steady_clock::now()' db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0xbf): undefined reference toboost::chrono::steady_clock::now()'
collect2: выполнение ld завершилось с кодом возврата 1
make: *** [bitcoind] Ошибка 1

Member

luke-jr commented Apr 13, 2013

What version of boost and USE flags?

Zenitur commented Apr 14, 2013

GCC 4.4, GLIBC 2.16, boost 1.52. USE flags: ipv6, upnp, eligius.

Member

luke-jr commented Apr 14, 2013

I meant what USE flags for boost... also note that the "eligius" USE flag is deprecated and not on any current versions, so you should sync (although I doubt that's related to your build problem)

Zenitur commented Apr 16, 2013

Still present with newest GIT. I think this is not your error. This is my error. I disable "system leveldb" patch (it doesn't work with bitcoind-9999), but:

make -j1 -f makefile.unix DEBUGFLAGS= 'CXXFLAGS=-O2 -pipe -march=k8' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed' BDB_INCLUDE_PATH=/usr/include/db4.8 BDB_LIB_SUFFIX=-4.8 USE_UPNP=1 USE_SYSTEM_LEVELDB=1 bitcoind

I will retest with USE_SYSTEM_LEVELDB=0

Zenitur commented Apr 16, 2013

Still present. Log:

g++ -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/obj -I/usr/include/db4.8 -DUSE_UPNP=1 -DUSE_IPV6=1 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/include -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2 -O2 -pipe -march=k8 -o bitcoind leveldb/libleveldb.a obj/alert.o obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/rpcnet.o obj/rpcmining.o obj/rpcwallet.o obj/rpcblockchain.o obj/rpcrawtransaction.o obj/script.o obj/sync.o obj/util.o obj/wallet.o obj/walletdb.o obj/hash.o obj/bloom.o obj/noui.o obj/leveldb.o obj/txdb.o -Wl,-z,relro -Wl,-z,now -Wl,-O1 -Wl,--as-needed -Wl,-Bdynamic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx-4.8 -l ssl -l crypto -l miniupnpc -Wl,-Bdynamic -l z -l dl -l pthread /var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/libleveldb.a /var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/libmemenv.a
obj/db.o: In function void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)': db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0x73): undefined reference toboost::chrono::system_clock::now()'
db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0x7b): undefined reference to boost::chrono::steady_clock::now()' db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0xbf): undefined reference toboost::chrono::steady_clock::now()'
collect2: выполнение ld завершилось с кодом возврата 1
make: *** [bitcoind] Ошибка 1

  • dev-libs/boost
    Latest version installed: 1.52.0-r5
  • dev-util/boost-build
    Latest version installed: 1.52.0-r1

Zenitur commented Apr 22, 2013

Still present:

remote: Counting objects: 105, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 68 (delta 46), reused 29 (delta 11)
Unpacking objects: 100% (68/68), done.
From git://github.com/bitcoin/bitcoin
fb53186..2272f8b master -> master
GIT update -->
repository: git://github.com/bitcoin/bitcoin.git
updating from commit: fb53186
to commit: 2272f8b
bitcoin-qt.pro | 6 ++-
doc/assets-attribution.txt | 8 +---
doc/build-osx.md | 12 +++++
src/main.cpp | 10 ++++-
src/makefile.unix | 6 +++
src/qt/bitcoin.cpp | 14 ++++--
src/qt/bitcoin.qrc | 3 +-
src/qt/bitcoingui.cpp | 38 +++++++---------
src/qt/clientmodel.cpp | 7 ++-
src/qt/clientmodel.h | 4 +-
src/qt/res/icons/toolbar.png | Bin 1687 -> 1787 bytes
src/qt/res/icons/toolbar_testnet.png | Bin 1727 -> 1748 bytes
src/qt/res/images/splash.png | Bin 0 -> 49338 bytes
src/qt/res/images/splash2.jpg | Bin 5816 -> 0 bytes
src/qt/res/images/splash_testnet.png | Bin 0 -> 45370 bytes
src/qt/splashscreen.cpp | 82 ++++++++++++++++++++++++++++++++++
src/qt/splashscreen.h | 16 +++++++
17 files changed, 166 insertions(+), 40 deletions(-)
branch: master
storage directory: "/ubuntu_10.04/11/egit-src/bitcoin"
checkout type: bare repository

...

g++ -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/obj -I/usr/include/db4.8 -DUSE_UPNP=1 -DUSE_IPV6=1 -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/include -I/var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2 -O2 -pipe -march=k8 -o bitcoind leveldb/libleveldb.a obj/alert.o obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/rpcnet.o obj/rpcmining.o obj/rpcwallet.o obj/rpcblockchain.o obj/rpcrawtransaction.o obj/script.o obj/sync.o obj/util.o obj/wallet.o obj/walletdb.o obj/hash.o obj/bloom.o obj/noui.o obj/leveldb.o obj/txdb.o -Wl,-z,relro -Wl,-z,now -Wl,-O1 -Wl,--as-needed -Wl,-Bdynamic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx-4.8 -l ssl -l crypto -l miniupnpc -Wl,-Bdynamic -l z -l dl -l pthread /var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/libleveldb.a /var/tmp/portage/net-p2p/bitcoind-9999/work/bitcoind-9999/src/leveldb/libmemenv.a
obj/db.o: In function void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)': db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0x73): undefined reference toboost::chrono::system_clock::now()'
db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0x7b): undefined reference to boost::chrono::steady_clock::now()' db.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)]+0xbf): undefined reference toboost::chrono::steady_clock::now()'
collect2: выполнение ld завершилось с кодом возврата 1
make: *** [bitcoind] Ошибка 1

grbgout commented Apr 24, 2013

I am experiencing the same, or a similar, problem as Zenitur with 77a1e12; Linux x86_64, as well.

It looks like this problem was introduced with commit a0a437c: the preceding commit, 1c4f021, compiles.

Compiling with: make -f makefile.unix USE_UPNP="" USE_IPV6=0 BDB_INCLUDE_PATH='/usr/include/db4.8'

boost: [ebuild R ] dev-libs/boost-1.52.0-r1003:0/1.52.0 USE="icu mpi nls python threads -c++11 -context -debug -doc -static-libs -tools" PYTHON_ABIS="2.7 3.2 -2.5 -2.6 -3.1 (-3.3) (-3.4)"

I receive more errors than reported by Zenitur, namely:

g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/home/grbgout/scm/git/bitcoin/src -I/home/grbgout/scm/git/bitcoin/src/obj -I/usr/include/db4.8 -DUSE_IPV6=0 -I/home/grbgout/scm/git/bitcoin/src/leveldb/include -I/home/grbgout/scm/git/bitcoin/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/db.d -o obj/db.o db.cpp
obj/db.o: In function `wait_for<long int, boost::ratio<1l, 1000000000l> >':
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:177: undefined reference to `boost::chrono::system_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:178: undefined reference to `boost::chrono::steady_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:181: undefined reference to `boost::chrono::steady_clock::now()'

g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/home/grbgout/scm/git/bitcoin/src -I/home/grbgout/scm/git/bitcoin/src/obj -I/usr/include/db4.8 -DUSE_IPV6=0 -I/home/grbgout/scm/git/bitcoin/src/leveldb/include -I/home/grbgout/scm/git/bitcoin/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/init.d -o obj/init.o init.cpp
obj/init.o: In function `wait_for<long int, boost::ratio<1l, 1000000000l> >':
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:177: undefined reference to `boost::chrono::system_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:178: undefined reference to `boost::chrono::steady_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:181: undefined reference to `boost::chrono::steady_clock::now()'

g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAF$ -D_FILE_OFFSET_BITS=64 -I/home/grbgout/scm/git/bitcoin/src -I/home/grbgout/scm/git/bitcoin/src/obj -I/usr/include/db4$8 -DUSE_IPV6=0 -I/home/grbgout/scm/git/bitcoin/src/leveldb/include -I/home/grbgout/scm/git/bitcoin/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF o$j/rpcwallet.d -o obj/rpcwallet.o rpcwallet.cpp
obj/rpcwallet.o: In function `wait_for<long int, boost::ratio<1l, 1000000000l> >':
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:177: undefined reference to `boost::chrono::system_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:178: undefined reference to `boost::chrono::steady_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:181: undefined reference to `boost::chrono::steady_clock::now()'

g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/home/grbgout/scm/git/bitcoin/src -I/home/grbgout/scm/git/bitcoin/src/obj -I/usr/include/db4.8 -DUSE_IPV6=0 -I/home/grbgout/scm/git/bitcoin/src/leveldb/include -I/home/grbgout/scm/git/bitcoin/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/walletdb.d -o obj/walletdb.o walletdb.cpp
obj/walletdb.o: In function `wait_for<long int, boost::ratio<1l, 1000000000l> >':
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:177: undefined reference to `boost::chrono::system_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:178: undefined reference to `boost::chrono::steady_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:181: undefined reference to `boost::chrono::steady_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:177: undefined reference to `boost::chrono::system_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:178: undefined reference to `boost::chrono::steady_clock::now()'
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:181: undefined reference to `boost::chrono::steady_clock::now()'

Apologies if this Markdown and formatting (matching the errors with their associated g++ invocations) is inconvenient.

Same errors here. Gentoo Linux, i686, GCC 4.7.2, commit 1c621e7

dev-libs/boost-1.52-r5, USE flags: nls python threads -debug -doc -icu -mpi -static-libs -tools

Diapolo commented May 2, 2013

Seems like a missing link to the Boost chrono lib somewhere in the make files perhaps?

grbgout commented May 2, 2013

Diapolo got it right.

This patch (copy-paste to ~/resolve-missing-boost-chrono-library.patch) resolved the problem for me on commit d9dd031 (currently latest):

diff --git a/src/makefile.unix b/src/makefile.unix
index 8110235..2efc83d 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -38,6 +38,7 @@ LIBS += \
    -l boost_filesystem$(BOOST_LIB_SUFFIX) \
    -l boost_program_options$(BOOST_LIB_SUFFIX) \
    -l boost_thread$(BOOST_LIB_SUFFIX) \
+   -l boost_chrono$(BOOST_LIB_SUFFIX) \
    -l db_cxx$(BDB_LIB_SUFFIX) \
    -l ssl \
    -l crypto

From within the source directory:

bitcoin/src $ git apply --stat ~/resolve-missing-boost-chrono-library.patch
 src/makefile.unix |    1 +
 1 file changed, 1 insertion(+)
bitcoin/src $ git apply ~/resolve-missing-boost-chrono-library.patch

Then follow the directions in bitcoin/doc/build-unix.txt as normal.

Alternatively, just edit the make file directly (as I did to generate the patch).

Diapolo commented May 2, 2013

If you are able to create a pull-req for this that would be a good thing I guess :). The makefile.osx also seems to be missing it, dunno if there were complaints also?

grbgout commented May 2, 2013

I'll drop by IRC and see what they think.

Owner

laanwj commented Oct 24, 2013

Refers to old build system, closing

laanwj closed this Oct 24, 2013

@ixgitserver ixgitserver pushed a commit to freenas/ports that referenced this issue Oct 30, 2013

@swills swills - Fix build when GUI is disabled
Reported by:	"Sam Fourman Jr." <sfourman@gmail.com>
Obtained from:	bitcoin/bitcoin#2521 (comment)
b3914d5

@splbio splbio pushed a commit to splbio/freebsd-ports that referenced this issue Nov 24, 2014

swills - Fix build when GUI is disabled
Reported by:	"Sam Fourman Jr." <sfourman@gmail.com>
Obtained from:	bitcoin/bitcoin#2521 (comment)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@325284 35697150-7ecd-e111-bb59-0022644237b5
a925012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment