libbitcoin / libbitcoin-explorer

Bitcoin Command Line Tool
Other
598 stars 176 forks source link

building error on OS X #721

Closed MonKong closed 1 year ago

MonKong commented 1 year ago

I build it by using these commands: $ wget https://raw.githubusercontent.com/libbitcoin/libbitcoin-explorer/version3/install.sh $chmod +x install.sh $./install.sh --with-icu --prefix=/Users/.../bx-build-dir --build-dir=/Users/.../bx-build-dir/temp

ERROR LOGS:

In file included from /usr/local/include/boost/cstdfloat.hpp:18: In file included from /usr/local/include/boost/math/cstdfloat/cstdfloat_types.hpp:17: /usr/local/include/boost/math/tools/config.hpp:23:6: warning: #warning is a language extension [-Wpedantic]

warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)"

 ^

/usr/local/include/boost/math/tools/config.hpp:23:6: warning: "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" [-W#warnings] In file included from src/log/sink.cpp:32: In file included from ./include/bitcoin/system/log/file_collector_repository.hpp:27: ./include/bitcoin/system/log/file_collector.hpp:72:72: error: non-virtual member function marked 'override' hides virtual member function boost::filesystem::path const& pattern, unsigned int* counter) override; ^ /usr/local/include/boost/log/sinks/text_file_backend.hpp:149:25: note: hidden overloaded virtual function 'boost::log::sinks::file::collector::scan_for_files' declared here: different number of parameters (2 vs 3) virtual scan_result scan_for_files(scan_method method, filesystem::path const& pattern = filesystem::path()) = 0; ^ 7 warnings and 1 error generated. make: * [src/log/libbitcoin_system_la-sink.lo] Error 1 In file included from src/log/statsd_sink.cpp:36: In file included from ./include/bitcoin/system/log/file_collector_repository.hpp:27: ./include/bitcoin/system/log/file_collector.hpp:72:72: error: non-virtual member function marked 'override' hides virtual member function boost::filesystem::path const& pattern, unsigned int counter) override; ^ /usr/local/include/boost/log/sinks/text_file_backend.hpp:149:25: note: hidden overloaded virtual function 'boost::log::sinks::file::collector::scan_for_files' declared here: different number of parameters (2 vs 3) virtual scan_result scan_for_files(scan_method method, filesystem::path const& pattern = filesystem::path()) = 0; ^ 7 warnings and 1 error generated. make: [src/log/libbitcoin_system_la-statsd_sink.lo] Error 1

pmienk commented 1 year ago

@MonKong - Please examine the version of Boost provided by your environment. The maximum acceptable version of Boost for our version3 branch is listed here. My assumption is that your platform is providing greater than 1.76 and are encountering a break within Boost. The detection mechanism for the dependency does not provide a guard for maximum version which is why this is not a configuration error.

As always, let me know if any of my above assumptions are in error and I will reassess as necessary.

MonKong commented 1 year ago

@MonKong - Please examine the version of Boost provided by your environment. The maximum acceptable version of Boost for our version3 branch is listed here. My assumption is that your platform is providing greater than 1.76 and are encountering a break within Boost. The detection mechanism for the dependency does not provide a guard for maximum version which is why this is not a configuration error.

As always, let me know if any of my above assumptions are in error and I will reassess as necessary.

@pmienk Yes, you are right. I got 2 versions of boost

$ /usr/local/Cellar/boost
boost/      boost@1.76/ 

they installed before

$ brew install boost
$ brew install libbitcoin-protocol

so, I uninstall them(libbitcoin-protocol/libbitcoin/boost/boost@1.76) and execute install.sh again(--with-icu option added because of I need bip38 features) ./install.sh --with-icu --prefix=xxx --build-dir=xxx and error:

_checking for boostlib >= 1.72.0 (107200)... configure: We could not detect the boost libraries (version 1.72.0 or higher). If you have a staged boost library (still not installed) please specify $BOOSTROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation. configure: error: Boost 1.72.0 or later is required but was not found.

And I build it again with --build-boost option added ./install.sh --with-icu --build-boost --prefix=xxx --build-dir=xxx

Another errors:

Building Boost.Build engine with toolset clang... tools/build/src/engine/b2 Unicode/ICU support for Boost.Regex?... /usr/local/Cellar/icu4c/72.1 Generating Boost.Build configuration in project-config.jam for clang...

Bootstrapping is done. To build, run:

./b2

....... ....... .......

libs/iostreams/src/zlib.cpp:31:34: error: use of undeclared identifier 'Z_NO_COMPRESSION' const int no_compression = Z_NO_COMPRESSION; ^ libs/iostreams/src/zlib.cpp:32:34: error: use of undeclared identifier 'Z_BEST_SPEED' const int best_speed = Z_BEST_SPEED; ^ libs/iostreams/src/zlib.cpp:33:34: error: use of undeclared identifier 'Z_BEST_COMPRESSION' const int best_compression = Z_BEST_COMPRESSION; ^ libs/iostreams/src/zlib.cpp:34:34: error: use of undeclared identifier 'Z_DEFAULT_COMPRESSION' const int default_compression = Z_DEFAULT_COMPRESSION; ^ libs/iostreams/src/zlib.cpp:38:34: error: use of undeclared identifier 'Z_DEFLATED' const int deflated = Z_DEFLATED; ^ libs/iostreams/src/zlib.cpp:42:34: error: use of undeclared identifier 'Z_DEFAULT_STRATEGY' const int default_strategy = Z_DEFAULT_STRATEGY; ^ libs/iostreams/src/zlib.cpp:43:34: error: use of undeclared identifier 'Z_FILTERED' const int filtered = Z_FILTERED; ^ libs/iostreams/src/zlib.cpp:44:34: error: use of undeclared identifier 'Z_HUFFMAN_ONLY' const int huffman_only = Z_HUFFMAN_ONLY; ^ libs/iostreams/src/zlib.cpp:48:34: error: use of undeclared identifier 'Z_OK' const int okay = Z_OK; ^ libs/iostreams/src/zlib.cpp:49:34: error: use of undeclared identifier 'Z_STREAM_END' const int stream_end = Z_STREAM_END; ^ libs/iostreams/src/zlib.cpp:50:34: error: use of undeclared identifier 'Z_STREAM_ERROR' const int stream_error = Z_STREAM_ERROR; ^ libs/iostreams/src/zlib.cpp:51:34: error: use of undeclared identifier 'Z_VERSION_ERROR' const int version_error = Z_VERSION_ERROR; ^ libs/iostreams/src/zlib.cpp:52:34: error: use of undeclared identifier 'Z_DATA_ERROR' const int data_error = Z_DATA_ERROR; ^ libs/iostreams/src/zlib.cpp:53:34: error: use of undeclared identifier 'Z_MEM_ERROR' const int mem_error = Z_MEM_ERROR; ^ libs/iostreams/src/zlib.cpp:54:34: error: use of undeclared identifier 'Z_BUF_ERROR' const int buf_error = Z_BUF_ERROR; ^ libs/iostreams/src/zlib.cpp:58:34: error: use of undeclared identifier 'Z_FINISH' const int finish = Z_FINISH; ^ libs/iostreams/src/zlib.cpp:59:34: error: use of undeclared identifier 'Z_NO_FLUSH' const int no_flush = Z_NO_FLUSH; ^ libs/iostreams/src/zlib.cpp:60:34: error: use of undeclared identifier 'Z_SYNC_FLUSH' const int sync_flush = Z_SYNC_FLUSH; ^ libs/iostreams/src/zlib.cpp:77:10: error: use of undeclared identifier 'Z_OK' case Z_OK: ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. ...failed updating 1 target...

MonKong commented 1 year ago

@MonKong - Please examine the version of Boost provided by your environment. The maximum acceptable version of Boost for our version3 branch is listed here. My assumption is that your platform is providing greater than 1.76 and are encountering a break within Boost. The detection mechanism for the dependency does not provide a guard for maximum version which is why this is not a configuration error.

As always, let me know if any of my above assumptions are in error and I will reassess as necessary.

@pmienk I try to build it on Ubuntu and fail while building boost

./install.sh --with-icu --build-boost --prefix=xxx --build-dir=xxx

the fail log is here

pmienk commented 1 year ago

@MonKong - Thank you for the response. The initial issue appears resolved. The issue you are now encountering is related to Ubuntu 22.04/22.10 and a change in the definition of PTHREAD_STACK_MIN.

I believe resolution of this secondary issue can be accomplished either by source editing of boost or possibly by defining PTHREAD_STACK_MIN=0. I've performed the former in those environments myself, though not the latter.

pmienk commented 1 year ago

Closing as this issue no longer relates to OSX failure.

pmienk commented 1 year ago

@MonKong - On MacOS, with Cellar providing boost1.76, you may want to instead parameterize with --with-boost=<boost path> to properly hint to boost without handing over build responsibilities as was pointed out in your configuration error above. This is a feature of the provided boost detection m4 scripts.