Can't build on macOS Sierra: likely a boost c++11 error? #12009

issue fernandezpablo85 opened this issue on December 24, 2017
  1. fernandezpablo85 commented at 3:47 PM on December 24, 2017: contributor

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    <!--- What behavior did you expect? -->

    Expected: make to compile and build OK

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    What happens: Make fails to build the miner:

    Making all in src
      CXX      libbitcoin_server_a-miner.o
    In file included from miner.cpp:6:
    In file included from ./miner.h:10:
    In file included from ./txmempool.h:25:
    In file included from /usr/local/include/boost/multi_index/ordered_index.hpp:17:
    /usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:1181:10: error: no matching function for call to object of type
          'const key_compare' (aka 'const CompareModifiedEntry')
          if(comp_(key(v),key(y->value())))return false;
             ^~~~~
    /usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:825:9: note: in instantiation of member function
          'boost::multi_index::detail::ordered_index_impl<boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry,
          boost::multi_index::detail::nth_layer<2, CTxMemPoolModifiedEntry,
          boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter, CompareCTxMemPoolIter, mpl_::na>,
          boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, std::__1::allocator<CTxMemPoolModifiedEntry> >, boost::mpl::v_item<ancestor_score, boost::mpl::vector0<mpl_::na>, 0>,
          boost::multi_index::detail::ordered_non_unique_tag, boost::multi_index::detail::null_augment_policy>::in_place' requested here
          b=in_place(x->value(),x,Category());
            ^
    /usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:860:18: note: in instantiation of member function
          'boost::multi_index::detail::ordered_index_impl<boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry,
          boost::multi_index::detail::nth_layer<2, CTxMemPoolModifiedEntry,
          boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter, CompareCTxMemPoolIter, mpl_::na>,
          boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, std::__1::allocator<CTxMemPoolModifiedEntry> >, boost::mpl::v_item<ancestor_score, boost::mpl::vector0<mpl_::na>, 0>,
          boost::multi_index::detail::ordered_non_unique_tag, boost::multi_index::detail::null_augment_policy>::modify_' requested here
          if(!super::modify_(x)){
                     ^
    /usr/local/include/boost/multi_index_container.hpp:823:18: note: in instantiation of member function
          'boost::multi_index::detail::ordered_index_impl<modifiedentry_iter, CompareCTxMemPoolIter, boost::multi_index::detail::nth_layer<1,
          CTxMemPoolModifiedEntry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter, CompareCTxMemPoolIter,
          mpl_::na>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na>, boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na>, std::__1::allocator<CTxMemPoolModifiedEntry> >, boost::mpl::vector0<mpl_::na>,
          boost::multi_index::detail::ordered_unique_tag, boost::multi_index::detail::null_augment_policy>::modify_' requested here
          if(!super::modify_(x)){
                     ^
    /usr/local/include/boost/multi_index/detail/index_base.hpp:278:21: note: in instantiation of function template specialization
          'boost::multi_index::multi_index_container<CTxMemPoolModifiedEntry,
          boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter, CompareCTxMemPoolIter, mpl_::na>,
          boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, std::__1::allocator<CTxMemPoolModifiedEntry> >::modify_<update_for_parent_inclusion>' requested here
        {return final().modify_(mod,x);}
                        ^
    /usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:418:18: note: in instantiation of function template specialization
          'boost::multi_index::detail::index_base<CTxMemPoolModifiedEntry,
          boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter, CompareCTxMemPoolIter, mpl_::na>,
          boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na>, std::__1::allocator<CTxMemPoolModifiedEntry> >::final_modify_<update_for_parent_inclusion>' requested here
        return this->final_modify_(
                     ^
    miner.cpp:269:31: note: in instantiation of function template specialization
          'boost::multi_index::detail::ordered_index_impl<modifiedentry_iter, CompareCTxMemPoolIter, boost::multi_index::detail::nth_layer<1,
          CTxMemPoolModifiedEntry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter, CompareCTxMemPoolIter,
          mpl_::na>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na>, boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
          mpl_::na, mpl_::na>, std::__1::allocator<CTxMemPoolModifiedEntry> >, boost::mpl::vector0<mpl_::na>,
          boost::multi_index::detail::ordered_unique_tag, boost::multi_index::detail::null_augment_policy>::modify<update_for_parent_inclusion>'
          requested here
                    mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
                                  ^
    ./miner.h:74:10: note: candidate function not viable: 'this' argument has type 'const key_compare' (aka 'const CompareModifiedEntry'), but
          method is not marked const
        bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b)
             ^
    In file included from miner.cpp:6:
    In file included from ./miner.h:10:
    In file included from ./txmempool.h:25:
    In file included from /usr/local/include/boost/multi_index/ordered_index.hpp:17:
    /usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:1186:26: error: no matching function for call to object of type
          'const key_compare' (aka 'const CompareModifiedEntry')
        return y==header()||!comp_(key(y->value()),key(v));
                             ^~~~~
    ./miner.h:74:10: note: candidate function not viable: 'this' argument has type 'const key_compare' (aka 'const CompareModifiedEntry'), but
          method is not marked const
        bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b)
             ^
    2 errors generated.
    make[2]: *** [libbitcoin_server_a-miner.o] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all-recursive] Error 1
    

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    How to reproduce: Follow the OSX install instructions readme

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    Version of core: v0.15.1 (7b57bc998)

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    Type of machine: MacbookAir 2015

    <!-- Any extra information that might be useful in the debugging process. -->

    Extra information: Seems like an issue with boost:

    /usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:1186:26: error: no matching function for call to object of type
          'const key_compare' (aka 'const CompareModifiedEntry')
        return y==header()||!comp_(key(y->value()),key(v));
    

    Note that running brew install boost --c++11 as indicated in the OSX install readme throws the following warning:

    Warning: boost: this formula has no --c++11 option so it will be ignored!

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. hyperrealist commented at 12:21 AM on December 25, 2017: none

    I can confirm that I can reproduce the same error.

    macOS High Sierra 10.13.1 MacBook Pro Mid 2014

  3. fanquake commented at 1:23 AM on December 25, 2017: member

    This is the same as #11837 and was fixed in #11847.

    The boost c++11 option could be dropped from the docs if it is no longer required.

  4. fanquake added the label MacOSX on Dec 25, 2017
  5. ryanosten commented at 9:01 PM on December 25, 2017: none

    Getting same error w MacOS High Sierra. Should it be working after #11847?

  6. MarcoFalke added this to the milestone 0.15.2 on Dec 26, 2017
  7. fernandezpablo85 commented at 5:25 PM on December 26, 2017: contributor

    @fanquake created this to update the OSX install instructions: https://github.com/bitcoin/bitcoin/pull/12027

  8. fanquake commented at 7:01 AM on December 27, 2017: member

    I've opened #12032 to backport the required fix to the 0.15 branch.

  9. laanwj referenced this in commit cb7ef312ff on Jan 3, 2018
  10. MarcoFalke closed this on Jan 15, 2018

  11. stephenie commented at 11:24 PM on April 14, 2018: none

    I removed boost --c++11 ,and brew install boost again ,but it does not work.my mac pro os is MacOS High Sierra.Anyone else can help me? thanks for your answers.

  12. victoryeo commented at 7:54 AM on April 24, 2018: none

    i have the error when building bitcoin core 0.15.1, i use mac os version 10.13.3

    In file included from /usr/local/include/boost/multi_index/ordered_index.hpp:17: /usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:1199:26: error: no matching function for call to object of type 'const boost::multi_index::detail::ordered_index_impl<boost::multi_index::identity<CTxMemPoolModifiedEntry>, CompareModifiedEntry,

  13. fanquake commented at 11:36 AM on April 26, 2018: member

    @victoryeo The fix for that issue has been backported to the 0.15 branch. Try building using that rather than the 0.15.1 tag.

  14. DrahtBot 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-14 18:15 UTC

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