libboost-related make error on Ubuntu 16.04 (armhf; gcc 4.9) #8479

issue unsystemizer opened this issue on August 7, 2016
  1. unsystemizer commented at 6:56 AM on August 7, 2016: contributor
    • Bitcoin 0.12.1
    • Ubuntu 16.04 (armhf)
      • libboost 1.58.0.1
      • gcc 4.9

    My configure command:

    ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" \
    --disable-install-doc --without-tests --without-gui --disable-shared \
    CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768"
    

    My gcc:

    # gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
    Target: arm-linux-gnueabihf
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.9.3-13ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
    Thread model: posix
    gcc version 4.9.3 (Ubuntu/Linaro 4.9.3-13ubuntu2)
    

    I run make (-j1) and hit this error. It's a freshly installed system (< 24h) without signs of filesystem corruption.

      CXXLD    bitcoind
    libbitcoin_server.a(libbitcoin_server_a-init.o): In function `boost::filesystem::path::path<boost::filesystem::directory_entry>(boost::filesystem::directory_entry const&, boost::enable_if<boost::filesystem::path_traits::is_pathable<boost::decay<boost::filesystem::directory_entry>::type>, void>::type*)':
    init.cpp:(.text._ZN5boost10filesystem4pathC2INS0_15directory_entryEEERKT_PNS_9enable_ifINS0_11path_traits11is_pathableINS_5decayIS4_E4typeEEEvE4typeE[_ZN5boost10filesystem4pathC5INS0_15directory_entryEEERKT_PNS_9enable_ifINS0_11path_traits11is_pathableINS_5decayIS4_E4typeEEEvE4typeE]+0x26): undefined reference to `boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)'
    libbitcoin_util.a(libbitcoin_util_a-util.o): In function `boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&, std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)':
    util.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcEC2ERSiRKSt3setISsSt4lessISsESaISsEEb[_ZN5boost15program_options6detail26basic_config_file_iteratorIcEC5ERSiRKSt3setISsSt4lessISsESaISsEEb]+0x22): undefined reference to `boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)'
    libbitcoin_util.a(libbitcoin_util_a-util.o): In function `boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&)':
    util.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERSs[_ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERSs]+0x64): undefined reference to `boost::program_options::to_internal(std::string const&)'
    collect2: error: ld returned 1 exit status
    Makefile:2801: recipe for target 'bitcoind' failed
    make[2]: *** [bitcoind] Error 1
    make[2]: Leaving directory '/blockchain/source/bitcoin-0.12.1/src'
    Makefile:6959: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/blockchain/source/bitcoin-0.12.1/src'
    Makefile:650: recipe for target 'all-recursive' failed
    make: *** [all-recursive] Error 1
    

    In similar cases (not with Bitcoin) some people missed to install libboost-program-options-dev but I installed it as per build-unix.md (for Ubuntu 14.04 as that's the closest version available).

    sudo apt-get install libboost-program-options-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libboost-program-options-dev is already the newest version (1.58.0.1ubuntu1).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    

    After this issue I successfully cross-compiled (using Ubuntu 14.04 x86_64 for armhf) from the same source and it's been working fine on the same Ubuntu 16.04 armhf system that can't built natively.

  2. jonasschnelli added the label Build system on Aug 8, 2016
  3. laanwj commented at 9:50 AM on August 10, 2016: member

    Can it build 0.13.0rc1 / master?

  4. unsystemizer commented at 1:57 AM on August 11, 2016: contributor

    Tried 0.13.0rc1 and 0.13.0rc2: same problem it seems. Below is error from my 0.13.0rc1 build attempt:

      CXXLD    bitcoind
    libbitcoin_server.a(libbitcoin_server_a-init.o): In function `boost::filesystem::path::path<boost::filesystem::directory_entry>(boost::filesystem::directory_entry const&, boost::enable_if<boost::filesystem::path_traits::is_pathable<boost::decay<boost::filesystem::directory_entry>::type>, void>::type*)':
    init.cpp:(.text._ZN5boost10filesystem4pathC2INS0_15directory_entryEEERKT_PNS_9enable_ifINS0_11path_traits11is_pathableINS_5decayIS4_E4typeEEEvE4typeE[_ZN5boost10filesystem4pathC5INS0_15directory_entryEEERKT_PNS_9enable_ifINS0_11path_traits11is_pathableINS_5decayIS4_E4typeEEEvE4typeE]+0x26): undefined reference to `boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)'
    libbitcoin_util.a(libbitcoin_util_a-util.o): In function `boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&, std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)':
    util.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcEC2ERSiRKSt3setISsSt4lessISsESaISsEEb[_ZN5boost15program_options6detail26basic_config_file_iteratorIcEC5ERSiRKSt3setISsSt4lessISsESaISsEEb]+0x22): undefined reference to `boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)'
    libbitcoin_util.a(libbitcoin_util_a-util.o): In function `boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&)':
    util.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERSs[_ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERSs]+0x64): undefined reference to `boost::program_options::to_internal(std::string const&)'
    collect2: error: ld returned 1 exit status
    
  5. theuni commented at 2:15 AM on August 11, 2016: member

    Looks like a boost abi issue. See here also: https://stackoverflow.com/questions/16540606/some-problems-when-using-boost-library-on-xcode

    I somehow doubt that you've mixed libstdc++ and libc++ on an arm machine though. Are you using the gcc/libstdc++ that game with the distro?

  6. unsystemizer commented at 6:39 AM on August 12, 2016: contributor

    @theuni I looked at the link. I understand I could rebuild libboost for clang/libc++. Thanks for the tip. But is that what we're supposed to do? Wouldn't it be easier to use gcc/libstdc++ (if I knew what packages to remove).

    To your second point, I use all original Ubuntu 16.04 packages, my libstdc++ is 4.9.3-13ubuntu2. I don't have libc++-dev and clang installed. If they get installed by default may have uninstalled them in order to have a simpler setup, before I submitted this issue. But, I just recalled this part from https://ubuntu-mate.org/raspberry-pi/ (I read this the other day and it seemed harmless): "The image is based on the regular Ubuntu armhf base, not the new Snappy Core, which means that the installation procedure for applications is the same as that for the regular desktop version, ie using apt-get. However, since Ubuntu MATE 16.04 snap packages can be installed alongside classic deb packages." I don't know if this means that there are some subtle differences between this OS and "the" distro code.

    If there's a way to grab a more detailed log of what's going on, please let me know how and I'll provide that information.

  7. theuni commented at 5:39 PM on August 12, 2016: member

    @unsystemizer I just had a look at the packages. The default for 16.04 is 5.3.1: http://packages.ubuntu.com/xenial/gcc

    I'm not sure why yours is using 4.9 by default, but I'm assuming that's where the problem is coming from. gcc5 introduced an abi change that would certainly cause issues if boost was built with 5+, and you're using 4.9 to link against it.

    Fwiw, this will be an issue for all c++ software you compile on this machine, not just bitcoin.

    Did you 'apt-get install gcc-4.9' at some point?

  8. unsystemizer commented at 10:53 AM on August 13, 2016: contributor

    Yes I did install gcc-4.9 because I had issues building with the latest version (before that, not part of this issue). I thought using an older gcc was a legit approach but as you point out it wouldn't make sense against libraries built with a diff version (and I don't want to go down that path). Okay, so I went back to the OS defaults and now it works (I tried with 0.12.1). Weird, Default packages didn't work for me before. Thanks for your help!

  9. unsystemizer closed this on Aug 13, 2016

  10. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me