configure error on OSX: No working boost sleep implementation found #3003

issue ghost opened this issue on September 16, 2013
  1. ghost commented at 7:06 PM on September 16, 2013: none

    Trying to compile git head on OSX 10.7.5 with ./configure --without-qt --disable-tests --disable-debug, it fails with:

    checking whether the Boost::Chrono library is available... yes
    checking for exit in -lboost_chrono-mt... yes
    configure: error: No working boost sleep implementation found
    

    I have boost installed with MacPorts:

    > port installed | grep boost
    boost [@1](/bitcoin-bitcoin/contributor/1/).54.0_0+no_single+no_static+python27 (active)
    
  2. jonasschnelli commented at 7:11 PM on September 16, 2013: contributor

    I remember having the same issues some days ago. While looking at my config.log, i just saw that i gave the --libdir. Try ./configure --without-qt --disable-tests --disable-debug --libdir=/opt/local/lib/

  3. ghost commented at 7:20 PM on September 16, 2013: none

    That didn't fix anything. I think libdir would only help if it couldn't find any of the macports libs, but you can see from the previous line in the error that it did indeed find libboost_chrono-mt.

  4. jonasschnelli commented at 7:46 PM on September 16, 2013: contributor

    hmm... just freshly checkout the master and runned into the same issue. Played arround with add/remove --disable-tests --disable-debug and --with-qt and it disappeared somehow...

  5. theuni commented at 7:55 PM on September 16, 2013: member

    Please paste a copy of your config.log on pastebin (it'll be way too big for here) and we'll have a look.

  6. jonasschnelli commented at 7:57 PM on September 16, 2013: contributor
  7. theuni commented at 8:00 PM on September 16, 2013: member

    Ok. Your problem is that you're using --disable-debug. That has a special meaning in OSX (force i386). We're currently discussing how to fix that, as it's pretty broken behavior.

    Until we get the debug/release stuff straightened out in the next few days, just don't use --disable-debug.

  8. ghost commented at 8:00 PM on September 16, 2013: none
  9. ghost commented at 8:00 PM on September 16, 2013: none

    cool beans. thanks

  10. theuni commented at 8:01 PM on September 16, 2013: member

    @BugAndNewsReporter yep, your log shows the same.

  11. mikehearn commented at 4:53 PM on October 27, 2013: contributor

    Nope. I'm not using that flag, and I see the same error. All I have is ./configure --without-qt

    This is OS X Mavericks. The problem appears to be that the custom AC_TRY_LINK stuff for boost sleep isn't include BOOST_INCLUDES so it can't find the header files.

  12. theuni commented at 6:35 PM on October 27, 2013: member

    The first problem was with linking. If yours is with includes, could you please paste the config.log?

    I'm not updating to Mavericks on my dev macbook so that I can still have a 10.6 install to reference.

  13. WyseNynja commented at 8:10 PM on November 10, 2013: none

    Does boost maybe name the library differently in OSX/windows? For example, "boost_thread" is "boost_thread-mt" in osx. I see that this is checking for "boost_chrono-mt" so maybe its something related to that?

  14. mikehearn commented at 8:17 PM on November 10, 2013: contributor

    config.log of the failed run:

    http://pastebin.com/Y1PzbcNj

  15. theuni commented at 9:06 PM on November 11, 2013: member

    Yep, the m4's find the path and store it, but we don't use it when doing our own checks. Exactly as @mikehearn said.

    Fix is to store the good cppflags before the chrono check and add boost's includes:

    TEMP_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
    

    and reset it after the sleep implementation is set:

    CPPFLAGS="$TEMP_CPPFLAGS"
    
  16. fryx commented at 9:46 AM on November 17, 2013: none

    I was having this issue with boost 1.53, turns out that the issue was libpthread not getting linked in. added -lpthread to CXX_FLAGS flags fixed it for me. @mikehearn

    your error is conftest.cpp:35:12: fatal error: 'boost/version.hpp' file not found your issue is that it can't find the boost headers in the path. you might be able to fix it by running ./configure CXXFLAGS="-I /path/to/boost/headers"

  17. mikehearn commented at 5:02 PM on November 17, 2013: contributor

    No, the issue is well understood by now. theuni - are you planning to submit a pull req for this or should I?

  18. theuni commented at 8:08 PM on November 17, 2013: member

    @mikehearn I will push up a branch today. If you wouldn't mind verifying that it works as intended, I'll PR it after that. @fryx: lpthread is a different issue. Autoconf should be linking in any necessary threading lib automatically. If it's not, it's a bug. Would you mind opening another ticket for it and linking a config.log demonstrating the problem?

  19. kzaher commented at 12:36 PM on November 19, 2013: none

    This was a solution for the same problem for me ./configure CXXFLAGS="-I /path/to/boost/headers". Thnx fryx. Using Mavericks.

  20. theuni referenced this in commit 5a531982a5 on Nov 19, 2013
  21. theuni commented at 5:46 PM on November 19, 2013: member
  22. kzaher commented at 7:47 PM on November 19, 2013: none

    Doesn't work for me.

  23. theuni commented at 8:22 PM on November 19, 2013: member

    Did you remember to re-run autogen.sh ?

  24. kzaher commented at 10:19 PM on November 19, 2013: none

    Yep, but it's ok. This works for me ./configure CXXFLAGS="-I /usr/local/include". Other things I had problems with is that I had different boost libraries in /usr/local/lib then the ones from homebrew, so that's why my linker failed later. Solution was to

    rm /usr/local/lib/libboost_* brew link boost

    Now I can compile everything.

  25. mikehearn commented at 5:31 PM on November 20, 2013: contributor

    Yes it works, thanks, although I then hit a different build error later (for some reason it can't find x86_64 versions of STL symbols). A pull req for that would be great.

  26. Abdullah114 commented at 5:50 PM on December 25, 2013: none

    Hey, when I tried to build bitcoin-qt using Qt Creator, I got this error (missing boost sleep implementation) which occurs in util.h, any idea on how to fix it? I tried what you suggested here but nth worked with me.

    P.S. I'm running Ubuntu 12.04

    inline void MilliSleep(int64_t n) { // Boost's sleep_for was uninterruptable when backed by nanosleep from 1.50 // until fixed in 1.52. Use the deprecated sleep method for the broken case. // See: https://svn.boost.org/trac/boost/ticket/7238 #if defined(HAVE_WORKING_BOOST_SLEEP_FOR) boost::this_thread::sleep_for(boost::chrono::milliseconds(n)); #elif defined(HAVE_WORKING_BOOST_SLEEP) boost::this_thread::sleep(boost::posix_time::milliseconds(n)); #else //should never get here #error missing boost sleep implementation #endif }

  27. WyseNynja commented at 7:42 PM on December 25, 2013: none

    @NurMasdar, this ticket is about OSX. I'm guessing your issue is something else.

    Additionally, I think this ticket can be closed. This appears to have been an issue with boost not being properly linked.

  28. laanwj commented at 7:59 AM on December 26, 2013: member

    @NurMasdar you must be missing some boost dependency, have you installed all of the packages suggested in build-unix.md?

  29. kthxbai2u commented at 7:24 PM on April 3, 2014: none

    None of those work for me... Still says sleep missing error.

  30. laanwj commented at 6:45 AM on April 4, 2014: member

    @kthxbai2u can you pastebin your config.log somewhere?

  31. leofidus referenced this in commit 30053cfaa3 on Apr 5, 2014
  32. voidref commented at 12:19 AM on April 6, 2014: none

    I've found the issue must be a bug in the configure, as removing the step and forcing -DHAVE_WORKING_BOOST_SLEEP_FOR=1 in my compile works just fine. Of course, I am also linking against static boost (and other) libs and have a patched boost header set. If anyone cares there's a .xcodeproj for dogecoind, some precompiled static libs, and a script to patch the boost headers over in https://github.com/dogecoin/dogecoin/tree/1.7-dev/contrib/macbuild

  33. theuni commented at 5:54 PM on April 7, 2014: member

    To those with this issue, could you please confirm that you're actually building bitcoin and not something else? Also, please confirm exactly which revision you're building, with which OS version, and where your dependencies came from. This isn't going anywhere until we can determine the actual problem.

  34. kthxbai2u commented at 5:33 PM on April 8, 2014: none

    The problem is that you are using OSX and not Debian. The script was coded for Debian.

    Date: Sat, 5 Apr 2014 17:20:26 -0700 From: notifications@github.com To: bitcoin@noreply.github.com CC: shawnread@hotmail.ca Subject: Re: [bitcoin] configure error on OSX: No working boost sleep implementation found (#3003)

    I've found the issue must be a bug in the configure, as removing the step and forcing -DHAVE_WORKING_BOOST_SLEEP_FOR=1 in my compile works just fine. Of course, I am also linking against static boost (and other) libs and have a patched boost header set. If anyone cares there's a .xcodeproj for dogecoind, some precompiled static libs, and a script to patch the boost headers over in https://github.com/dogecoin/dogecoin/tree/1.7-dev/contrib/macbuild

    — Reply to this email directly or view it on GitHub.

  35. CodeChief commented at 10:26 AM on June 28, 2014: none

    Doesn't work with current Ubuntu 14.04 libboost-all-dev (v1.54). The problem is not just to do with OSX then. Do I have to fix the configure then? Seems much more difficult than it should be. It's got 10s of 1000s of lines with no comments!

    Anyone ever thought of splitting this file into separate parts so it can be maintained? I'd expect to see either clearly marked test/configure sections or one main file importing the other parts, again with comments.

    Anyway, for now I'd appreciate any tips how to get this working quickly before I have to go and learn the whole autoconf and configure mechanisms. I get the point it's generating small "main" C++ files to test linkage. Pretty straightforward, but written in an extremely complex way (one large template file with one test running straight into the next).

    Rather than a workaround, I'd like to know how can we correct it work on all systems with current boost libraries? The sleep function seems pretty simple to cause so much trouble. The other boost libraries (up to that point in configure) worked fine.

  36. CodeChief commented at 10:28 PM on June 28, 2014: none

    I found out that there were some inconsistencies with libboost on the system. To fix this I ran:

    sudo apt-get remove libboost*
    sudo apt-get autoclean
    sudo apt-get install libboost-all-dev
    

    Then the usual bitcoin autogen.sh, configure, make clean then make.

  37. laanwj commented at 5:51 AM on June 29, 2014: member

    You shouldn't edit the configure file. It's auto-generated from configure.ac as well as src/m4/*.

    Currently all the boost libs need to be in one directory for auto-detection to work, otherwise you need to provide --with-boost-libdir. See also #3219

  38. fanquake commented at 1:08 PM on January 3, 2015: member

    @laanwj Fixes for this were pulled. Discussion tailed away from OSX towards Ubuntu and #4704 should have taken care of that. /close

  39. laanwj closed this on Jan 10, 2015

  40. Azulan commented at 1:08 PM on January 17, 2015: none

    Just got this error on Elementary OS using the 10rc3 source tarball. Installing libboost-all-dev to see if it fixes it.

  41. Azulan commented at 1:21 PM on January 17, 2015: none

    It did.

  42. pdxrod commented at 1:53 PM on November 26, 2017: none

    Having done

    git clone https://github.com/bitcoin/bitcoin.git

    cd bitcoin

    and

    brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java

    then

    ./autogen.sh

    I found

    brew install boost

    enabled

    ./configure

    to finish successfully.

  43. Bushstar referenced this in commit 63424fb26a on Apr 8, 2020
  44. Bushstar referenced this in commit 0410259dd5 on Apr 8, 2020
  45. 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-17 15:15 UTC

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