1

After updating to MACOS Big Sur and trying to compile monero branch release-v0.16 i get this error:

    [ 36%] Built target ringct
Scanning dependencies of target obj_cryptonote_core
[ 37%] Building CXX object src/cryptonote_core/CMakeFiles/obj_cryptonote_core.dir/blockchain.cpp.o
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:39:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.h:35:
/usr/local/include/boost/serialization/list.hpp:53:33: error: no type named 'library_version_type' in namespace 'boost::serialization'; did you mean 'item_version_type'?
    const boost::serialization::library_version_type library_version(
          ~~~~~~~~~~~~~~~~~~~~~~^
/usr/local/include/boost/serialization/item_version_type.hpp:25:7: note: 'item_version_type' declared here
class item_version_type {
      ^
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:39:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.h:35:
/usr/local/include/boost/serialization/list.hpp:60:30: error: no member named 'library_version_type' in namespace 'boost::serialization'
    if(boost::serialization::library_version_type(3) < library_version){
       ~~~~~~~~~~~~~~~~~~~~~~^
/Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:1183:21: warning: loop variable 'bei' of type 'const cryptonote::Blockchain::block_extended_info'
      creates a copy from type 'const cryptonote::Blockchain::block_extended_info' [-Wrange-loop-analysis]
    for (const auto bei: boost::adaptors::reverse(alt_chain))
                    ^
/Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:1183:10: note: use reference type 'const cryptonote::Blockchain::block_extended_info &' to
      prevent copying
    for (const auto bei: boost::adaptors::reverse(alt_chain))
         ^~~~~~~~~~~~~~~
                    &
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:37:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_basic/cryptonote_basic_impl.h:33:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_basic/cryptonote_basic.h:41:
/Users/myuser/Projects/myproject/monero-16/src/serialization/binary_archive.h:195:28: warning: shift count >= width of type [-Wshift-count-overflow]
      if (1 < sizeof(T)) v >>= 8;
                           ^   ~
/Users/myuser/Projects/myproject/monero-16/src/serialization/binary_archive.h:188:5: note: in instantiation of function template specialization
      'binary_archive<true>::serialize_uint<unsigned char>' requested here
    serialize_uint(static_cast<typename boost::make_unsigned<T>::type>(v));
    ^
/Users/myuser/Projects/myproject/monero-16/src/serialization/binary_archive.h:228:5: note: in instantiation of function template specialization
      'binary_archive<true>::serialize_int<unsigned char>' requested here
    serialize_int(t);
    ^
2 warnings and 2 errors generated.
make[3]: *** [src/cryptonote_core/CMakeFiles/obj_cryptonote_core.dir/blockchain.cpp.o] Error 1
make[2]: *** [src/cryptonote_core/CMakeFiles/obj_cryptonote_core.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [release-all] Error 2
IvRRimUm
  • 1,724
  • 3
  • 21
  • 40

1 Answers1

2

Looks like there is a missing include - which I can't reproduce on Linux, using the 18.04 distro package (1.65.1, compiles cleanly¹ from scratch).

There's a related fix in github: https://github.com/boostorg/serialization/commit/f72b9fc8d953a5dd39615535b5c6bab5b8be42fe

commit f72b9fc8d953a5dd39615535b5c6bab5b8be42fe
Author: Robert Ramey <ramey@rrsd.com>
Date:   Sat Sep 26 22:55:18 2020 -0700

    included library_version.hpp in all appropriate places.
    This should permit any header to be compiled without including any other headers.

This has been merged to master, but that was AFTER 1.74.0 so it doesn't exist yet.

Obviously it should be easy to include the header where necessary:

 #include <boost/serialization/library_version_type.hpp>

¹ well, with 4 unrelated warnings

sehe
  • 374,641
  • 47
  • 450
  • 633
  • My boost version is Boost version: 1_74 tho – IvRRimUm Dec 07 '20 at 18:28
  • "tho"? That's precisely an indicator why 1.75/76 might help (Note, 1.75.0 beta already exists without the fix). Also, the real point is that it likely means you have to the add the include where the error originates – sehe Dec 07 '20 at 18:44
  • Just noticed that monero upstream has already applied the related workaround: https://github.com/monero-project/monero/commit/07442a60593a662161139947f6fbf29265fc8a5f (Aug 16th) – sehe Dec 08 '20 at 00:25