<p>I have done quite a few upgrades in the past and this has never happened before:</p>

<pre><code>$ uname -a
Linux back 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux

$ git checkout v0.13.1
$ git fetch --all
$ ./autogen.sh
...
$ ./configure LDFLAGS="-L/home/me/bitcoin/db4/lib/" CPPFLAGS="-I/home/me/bitcoin/db4/include/"
...
$ make clean  # I have had issues in the past, always solved with clean target
...
$ make
...
AR       leveldb/libmemenv.a
CXXLD    bitcoind
libbitcoin_util.a(libbitcoin_util_a-util.o): In function `GetNumCores()':
/home/me/bitcoin/src/util.cpp:796: undefined reference to `boost::thread::physical_concurrency()'
collect2: error: ld returned 1 exit status
Makefile:3336: recipe for target 'bitcoind' failed
make[2]: *** [bitcoind] Error 1
make[2]: Leaving directory '/home/me/bitcoin/src'
Makefile:8357: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/me/bitcoin/src'
Makefile:668: recipe for target 'all-recursive' failed 
make: *** [all-recursive] Error 1
</code></pre>

<p>Does anyone have any suggestion of anything I could try out to resolve this?</p>

<p><strong>EDIT</strong>: I can't even rebuild <code>v0.13.0</code>, so I have most likely messed up my system in relation to <code>boost</code>. Looking into that</p>

<p><strong>EDIT2 (RESOLVED)</strong>: cleaning up the boost install resolves the problem (<code>make check</code> passes all tests). Any Bitcoin enthusiast who still doesn't quite know what he is doing (like myself) will easily attempt to install various Bitcoin libraries and utilities (e.g. <code>libbitcoin</code> <code>bx</code> for C++) with boost dependencies and end up with various bits and pieces of the library everywhere (both <code>/usr</code> and <code>/usr/local</code> hierarchy as well as boost distribution packages on top of existing stuff in <code>/usr/lib/x86_64-linux-gnu/</code>). So I removed the distribution packages, cleaned up <code>/usr/include/boost</code> and <code>/usr/lib/libboost_*</code> (and the equivalent on <code>/usr/local</code>), left the gnu folder alone (libreoffice will break otherwise), and installed a clean copy of boost (on <code>/usr/local</code> hierarchy). One thing to remember, if anyone tries to experiment by moving around library files, you need to run <code>ldconfig</code> to update the cache for the linker I think. Things started to make sense after I did that.</p>

<p><strong>EDIT3</strong>: for the sake of completeness, if I decide to install boost in the <code>/usr/</code> hierarchy rather than <code>/usr/local/</code>, then the above build will also fail for some reason. However, replacing the line:</p>

<pre><code>$ ./configure LDFLAGS="-L/home/me/bitcoin/db4/lib/" \
              CPPFLAGS="-I/home/me/bitcoin/db4/include/"
</code></pre>

<p>by:</p>

<pre><code>$ ./configure LDFLAGS="-L/home/me/bitcoin/db4/lib/ -L/usr/lib" \
              CPPFLAGS="-I/home/me/bitcoin/db4/include/ -I/usr/include"
</code></pre>

<p>leads to a succesful build.</p>

CC BY-SA 3.0
2016-10-27T22:05:10.630Z
Try git clean -dfx (this will remove all build results and files not checked in, so you can start fresh). Also, what version of Boost do you have?
Pieter Wuille
CC BY-SA 3.0
2016-10-28T07:38:30.663Z
Thank you very much ! I tried that. I retried after reinstalling boost 1.61. Same errors. Will keep looking. Thanks anyway !!
Sven Williamson
<bitcoind><bitcoin-core><compiling><make>
Failing to build bitcoin-core v0.13.1
Sven Williamson
# Failing to build bitcoin-core v0.13.1

(Asked by: username_0 on 2016-10-27)

I have done quite a few upgrades in the past and this has never happened before:
$ uname -a
Linux back 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux

$ git checkout v0.13.1
$ git fetch --all
$ ./autogen.sh
...
$ ./configure LDFLAGS="-L/home/me/bitcoin/db4/lib/" CPPFLAGS="-I/home/me/bitcoin/db4/include/"
...
$ make clean  # I have had issues in the past, always solved with clean target
...
$ make
...
AR       leveldb/libmemenv.a
CXXLD    bitcoind
libbitcoin_util.a(libbitcoin_util_a-util.o): In function `GetNumCores()':
/home/me/bitcoin/src/util.cpp:796: undefined reference to `boost::thread::physical_concurrency()'
collect2: error: ld returned 1 exit status
Makefile:3336: recipe for target 'bitcoind' failed
make[2]: *** [bitcoind] Error 1
make[2]: Leaving directory '/home/me/bitcoin/src'
Makefile:8357: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/me/bitcoin/src'
Makefile:668: recipe for target 'all-recursive' failed 
make: *** [all-recursive] Error 1

Does anyone have any suggestion of anything I could try out to resolve this?
EDIT: I can't even rebuild v0.13.0, so I have most likely messed up my system in relation to boost. Looking into that
EDIT2 (RESOLVED): cleaning up the boost install resolves the problem (make check passes all tests). Any Bitcoin enthusiast who still doesn't quite know what he is doing (like myself) will easily attempt to install various Bitcoin libraries and utilities (e.g. libbitcoin bx for C++) with boost dependencies and end up with various bits and pieces of the library everywhere (both /usr and /usr/local hierarchy as well as boost distribution packages on top of existing stuff in /usr/lib/x86_64-linux-gnu/). So I removed the distribution packages, cleaned up /usr/include/boost and /usr/lib/libboost_* (and the equivalent on /usr/local), left the gnu folder alone (libreoffice will break otherwise), and installed a clean copy of boost (on /usr/local hierarchy). One thing to remember, if anyone tries to experiment by moving around library files, you need to run ldconfig to update the cache for the linker I think. Things started to make sense after I did that.
EDIT3: for the sake of completeness, if I decide to install boost in the /usr/ hierarchy rather than /usr/local/, then the above build will also fail for some reason. However, replacing the line:
$ ./configure LDFLAGS="-L/home/me/bitcoin/db4/lib/" \
              CPPFLAGS="-I/home/me/bitcoin/db4/include/"

by:
$ ./configure LDFLAGS="-L/home/me/bitcoin/db4/lib/ -L/usr/lib" \
              CPPFLAGS="-I/home/me/bitcoin/db4/include/ -I/usr/include"

leads to a succesful build.

**Tags:** bitcoind, bitcoin-core, compiling, make

> **Comments:**
> **username_1**: Try git clean -dfx (this will remove all build results and files not checked in, so you can start fresh). Also, what version of Boost do you have?  
> **username_0**: Thank you very much ! I tried that. I retried after reinstalling boost 1.61. Same errors. Will keep looking. Thanks anyway !!  

---

## 0 answers

