VowpalWabbit / vowpal_wabbit

Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.
https://vowpalwabbit.org
Other
8.47k stars 1.93k forks source link

Cannot build on FreeBSD 13.3 #4694

Closed Peter2121 closed 3 months ago

Peter2121 commented 3 months ago

Describe the bug

There are several issues building VowpalWabbit on FreeBSD.

  1. In /vowpalwabbit/core/src/parser.cc the header <sys/socket.h> is needed
  2. Building with CLANG is failed, gcc13 is needed
  3. There are problems linking fmt library (build is failed)

cmake command is:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DFMT_SYS_DEP:BOOL="ON" -DRAPIDJSON_SYS_DEP:BOOL="ON" -DSPDLOG_SYS_DEP:BOOL="ON" -DVW_BOOST_MATH_SYS_DEP:BOOL="ON" -DVW_ZLIB_SYS_DEP:BOOL="ON" -DBUILD_TESTING:BOOL="OFF"

Build command is:

cmake --build build

Link error is:

[1/9] Linking CXX executable vowpalwabbit/spanning_tree_bin/spanning_tree
FAILED: vowpalwabbit/spanning_tree_bin/spanning_tree
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt vowpalwabbit/spanning_tree_bin/CMakeFiles/vw_spanning_tree_bin.dir/src/spanning_tree_main.cc.o -o vowpalwabbit/spanning_tree_bin/spanning_tree  -Wl,-rpath,/usr/local/lib  vowpalwabbit/spanning_tree/libvw_spanning_tree.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  -pthread  /usr/local/lib/libfmt.so.10.2.1 && :
/usr/local/bin/ld: vowpalwabbit/config/libvw_config.a(cli_help_formatter.cc.o): in function `one_of_string[abi:cxx11](VW::config::base_option&)::extractor::visit(VW::config::typed_option<unsigned long>&)':cli_help_formatter.cc:(.text+0x25d): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/config/libvw_config.a(cli_help_formatter.cc.o): in function `one_of_string[abi:cxx11](VW::config::base_option&)::extractor::visit(VW::config::typed_option<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&)':cli_help_formatter.cc:(.text+0x46d): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/config/libvw_config.a(cli_help_formatter.cc.o): in function `one_of_string[abi:cxx11](VW::config::base_option&)::extractor::visit(VW::config::typed_option<int>&)':cli_help_formatter.cc:(.text+0x67d): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/config/libvw_config.a(cli_help_formatter.cc.o): in function `one_of_string[abi:cxx11](VW::config::base_option&)::extractor::visit(VW::config::typed_option<unsigned int>&)':cli_help_formatter.cc:(.text+0x88d): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/config/libvw_config.a(cli_help_formatter.cc.o): in function `one_of_string[abi:cxx11](VW::config::base_option&)::extractor::visit(VW::config::typed_option<long>&)':cli_help_formatter.cc:(.text+0xa9d): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/config/libvw_config.a(cli_help_formatter.cc.o):cli_help_formatter.cc:(.text+0xdb4): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[2/9] Linking CXX executable library/gd_mf_weights
FAILED: library/gd_mf_weights
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt library/CMakeFiles/gd_mf_weights.dir/gd_mf_weights.cc.o -o library/gd_mf_weights  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/allreduce/libvw_allreduce.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::compile_limits(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::array<unsigned int, 256ul>&, bool, VW::io::logger&)':global_data.cc:(.text+0x236): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x347): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x3d8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `print_raw_text_by_ref(VW::io::writer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x3ae8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::print_result_by_ref(VW::io::writer*, float, float, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x418b): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(learner.cc.o):learner.cc:(.text+0x119f): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[3/9] Linking CXX executable utl/dump_options/vw-dump-options
FAILED: utl/dump_options/vw-dump-options
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt utl/dump_options/CMakeFiles/vw-dump-options.dir/main.cc.o -o utl/dump_options/vw-dump-options  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/allreduce/libvw_allreduce.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::compile_limits(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::array<unsigned int, 256ul>&, bool, VW::io::logger&)':global_data.cc:(.text+0x236): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x347): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x3d8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `print_raw_text_by_ref(VW::io::writer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x3ae8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::print_result_by_ref(VW::io::writer*, float, float, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x418b): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(learner.cc.o):learner.cc:(.text+0x119f): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[4/9] Linking CXX executable vowpalwabbit/cli/vw
FAILED: vowpalwabbit/cli/vw
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt vowpalwabbit/cli/CMakeFiles/vw_cli_bin.dir/src/main.cc.o -o vowpalwabbit/cli/vw  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/allreduce/libvw_allreduce.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/cli/CMakeFiles/vw_cli_bin.dir/src/main.cc.o: in function `main.cold':main.cc:(.text.unlikely+0x3af): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: main.cc:(.text.unlikely+0x446): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/cli/CMakeFiles/vw_cli_bin.dir/src/main.cc.o: in function `void VW::io::logger::err_critical<>(fmt::v10::basic_format_string<char>)':main.cc:(.text._ZN2VW2io6logger12err_criticalIJEEEvN3fmt3v1019basic_format_stringIcJDpNS4_13type_identityIT_E4typeEEEEDpOS7_[_ZN2VW2io6logger12err_criticalIJEEEvN3fmt3v1019basic_format_stringIcJDpNS4_13type_identityIT_E4typeEEEEDpOS7_]+0x1f): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::compile_limits(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::array<unsigned int, 256ul>&, bool, VW::io::logger&)':global_data.cc:(.text+0x236): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x347): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o):global_data.cc:(.text+0x3d8): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[5/9] Linking CXX executable library/library_example
FAILED: library/library_example
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt library/CMakeFiles/library_example.dir/library_example.cc.o -o library/library_example  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/allreduce/libvw_allreduce.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::compile_limits(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::array<unsigned int, 256ul>&, bool, VW::io::logger&)':global_data.cc:(.text+0x236): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x347): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x3d8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `print_raw_text_by_ref(VW::io::writer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x3ae8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::print_result_by_ref(VW::io::writer*, float, float, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x418b): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(learner.cc.o):learner.cc:(.text+0x119f): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[6/9] Linking CXX executable library/search_generate
FAILED: library/search_generate
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt library/CMakeFiles/search_generate.dir/search_generate.cc.o -o library/search_generate  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/allreduce/libvw_allreduce.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::compile_limits(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::array<unsigned int, 256ul>&, bool, VW::io::logger&)':global_data.cc:(.text+0x236): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x347): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x3d8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `print_raw_text_by_ref(VW::io::writer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x3ae8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::print_result_by_ref(VW::io::writer*, float, float, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x418b): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(learner.cc.o):learner.cc:(.text+0x119f): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[7/9] Linking CXX executable library/recommend
FAILED: library/recommend
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt library/CMakeFiles/recommend.dir/recommend.cc.o -o library/recommend  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/allreduce/libvw_allreduce.avowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::compile_limits(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::array<unsigned int, 256ul>&, bool, VW::io::logger&)':global_data.cc:(.text+0x236): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x347): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x3d8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `print_raw_text_by_ref(VW::io::writer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x3ae8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::print_result_by_ref(VW::io::writer*, float, float, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x418b): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(learner.cc.o):learner.cc:(.text+0x119f): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[8/9] Linking CXX executable library/test_search
FAILED: library/test_search
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt library/CMakeFiles/test_search.dir/test_search.cc.o -o library/test_search  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.avowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/allreduce/libvw_allreduce.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::compile_limits(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::array<unsigned int, 256ul>&, bool, VW::io::logger&)':global_data.cc:(.text+0x236): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x347): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: global_data.cc:(.text+0x3d8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `print_raw_text_by_ref(VW::io::writer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x3ae8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(global_data.cc.o): in function `VW::details::print_result_by_ref(VW::io::writer*, float, float, VW::v_array<char, void> const&, VW::io::logger&)':global_data.cc:(.text+0x418b): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/core/libvw_core.a(learner.cc.o):learner.cc:(.text+0x119f): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
[9/9] Linking CXX executable vowpalwabbit/model_merger/vw-merge
FAILED: vowpalwabbit/model_merger/vw-merge
: && /usr/local/bin/g++13 -O3 -DNDEBUG -lfmt vowpalwabbit/model_merger/CMakeFiles/vw_model_merger_bin.dir/src/main.cc.o -o vowpalwabbit/model_merger/vw-merge  -Wl,-rpath,/usr/local/lib  vowpalwabbit/core/libvw_core.a  vowpalwabbit/io/libvw_io.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/core/libvw_core.a  vowpalwabbit/cache_parser/libvw_cache_parser.a  vowpalwabbit/text_parser/libvw_text_parser.a  vowpalwabbit/json_parser/libvw_json_parser.a  vowpalwabbit/config/libvw_config.a  vowpalwabbit/allreduce/libvw_allreduce.a  vowpalwabbit/io/libvw_io.a  /usr/lib/libz.so  /usr/local/lib/libfmt.so.10.2.1  -pthread && :
/usr/local/bin/ld: vowpalwabbit/model_merger/CMakeFiles/vw_model_merger_bin.dir/src/main.cc.o: in function `void VW::io::logger::info<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>(fmt::v10::basic_format_string<char, fmt::v10::type_identity<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>::type>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) [clone .isra.0]':main.cc:(.text+0x33): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/model_merger/CMakeFiles/vw_model_merger_bin.dir/src/main.cc.o: in function `logger_output_func(void*, VW::io::log_level, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':main.cc:(.text+0xfde): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: main.cc:(.text+0x10e8): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: main.cc:(.text+0x117a): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: main.cc:(.text+0x120a): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: vowpalwabbit/model_merger/CMakeFiles/vw_model_merger_bin.dir/src/main.cc.o:main.cc:(.text.unlikely+0x96a): more undefined references to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)' followcollect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

The fmt library is installed from package:

file /usr/local/lib/libfmt.so.10.2.1
/usr/local/lib/libfmt.so.10.2.1: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 13.2, stripped

How to reproduce

Follow Build instructions with Option 3: Using system dependencies

The following leaf packages are installed (in jail):

boost-libs-1.84.0
cmake-3.28.3
flatbuffers-24.3.25,1
git-lite-2.45.1
llvm-devel-lite-19.0.d20240415
llvm18-lite-18.1.4
micro-2.0.13_6
nano-7.2_1
ninja-1.11.1,2
py39-matplotlib-3.8.0
py39-pandas-2.0.3_1,1
py39-plotly-4.14.3
py39-scikit-learn-1.4.0
rapidjson-1.1.0.709
spdlog-1.13.0

Version

commit f204897f2f020f3102a8080e3cef0b0531a2ee0a (git clone)

OS

FreeBSD 13.3

Language

C++

Additional context

No response

Peter2121 commented 3 months ago

Symbols exported by the fmt library:

nm -gDC /usr/local/lib/libfmt.so.10.2.1
                 w _Jv_RegisterClasses
                 U _Unwind_Resume
0000000000027380 V fmt::v10::format_facet<std::__1::locale>::id
0000000000023b10 T fmt::v10::buffered_file::close()
0000000000023a40 T fmt::v10::buffered_file::buffered_file(fmt::v10::basic_cstring_view<char>, fmt::v10::basic_cstring_view<char>)
0000000000023a40 T fmt::v10::buffered_file::buffered_file(fmt::v10::basic_cstring_view<char>, fmt::v10::basic_cstring_view<char>)
0000000000023a00 T fmt::v10::buffered_file::~buffered_file()
0000000000023a00 T fmt::v10::buffered_file::~buffered_file()
000000000000bc20 T fmt::v10::vsystem_error(int, fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)
000000000000bfb0 T fmt::v10::format_system_error(fmt::v10::detail::buffer<char>&, int, char const*)
000000000000c090 T fmt::v10::report_system_error(int, char const*)
00000000000240d0 T fmt::v10::file::dup(int)
0000000000024180 T fmt::v10::file::dup2(int)
0000000000024250 T fmt::v10::file::dup2(int, std::__1::error_code&)
00000000000242c0 T fmt::v10::file::pipe(fmt::v10::file&, fmt::v10::file&)
0000000000023f30 T fmt::v10::file::read(void*, unsigned long)
0000000000023d80 T fmt::v10::file::close()
0000000000024000 T fmt::v10::file::write(void const*, unsigned long)
00000000000243e0 T fmt::v10::file::fdopen(char const*)
0000000000023c60 T fmt::v10::file::file(fmt::v10::basic_cstring_view<char>, int)
0000000000023c60 T fmt::v10::file::file(fmt::v10::basic_cstring_view<char>, int)
0000000000023d40 T fmt::v10::file::~file()
0000000000023d40 T fmt::v10::file::~file()
000000000000d6b0 W _ZN3fmt3v106detail10locale_refC1INSt3__16localeEEERKT_
000000000000d6b0 W _ZN3fmt3v106detail10locale_refC2INSt3__16localeEEERKT_
000000000000ca40 W void fmt::v10::detail::vformat_to<char>(fmt::v10::detail::buffer<char>&, fmt::v10::basic_string_view<char>, fmt::v10::detail::vformat_args<char>::type, fmt::v10::detail::locale_ref)
000000000000b760 T fmt::v10::detail::assert_fail(char const*, int, char const*)
0000000000024530 T fmt::v10::detail::file_buffer::grow(unsigned long)
0000000000024570 T fmt::v10::detail::file_buffer::file_buffer(fmt::v10::basic_cstring_view<char>, fmt::v10::detail::ostream_params const&)
00000000000245e0 T fmt::v10::detail::file_buffer::file_buffer(fmt::v10::detail::file_buffer&&)
0000000000024570 T fmt::v10::detail::file_buffer::file_buffer(fmt::v10::basic_cstring_view<char>, fmt::v10::detail::ostream_params const&)
00000000000245e0 T fmt::v10::detail::file_buffer::file_buffer(fmt::v10::detail::file_buffer&&)
0000000000024620 T fmt::v10::detail::file_buffer::~file_buffer()
0000000000024620 T fmt::v10::detail::file_buffer::~file_buffer()
000000000000c2e0 T fmt::v10::detail::is_printable(unsigned int)
000000000000b8d0 T fmt::v10::detail::report_error(void (*)(fmt::v10::detail::buffer<char>&, int, char*), int, void (*)(fmt::v10::detail::buffer<char>&, int, char*))
000000000000be30 T fmt::v10::detail::utf8_to_utf16::utf8_to_utf16(fmt::v10::basic_string_view<char>)
000000000000be30 T fmt::v10::detail::utf8_to_utf16::utf8_to_utf16(fmt::v10::basic_string_view<char>)
000000000000c0c0 T fmt::v10::detail::write_console(__sFILE*, fmt::v10::basic_string_view<char>)
000000000000c0b0 T fmt::v10::detail::write_console(int, fmt::v10::basic_string_view<char>)
000000000000b7e0 T fmt::v10::detail::format_error_code(fmt::v10::detail::buffer<char>&, int, fmt::v10::basic_string_view<char>)
000000000000d7a0 W char fmt::v10::detail::decimal_point_impl<char>(fmt::v10::detail::locale_ref)
000000000000dbd0 W wchar_t fmt::v10::detail::decimal_point_impl<wchar_t>(fmt::v10::detail::locale_ref)
000000000000d6c0 W fmt::v10::detail::thousands_sep_result<char> fmt::v10::detail::thousands_sep_impl<char>(fmt::v10::detail::locale_ref)
000000000000daf0 W fmt::v10::detail::thousands_sep_result<wchar_t> fmt::v10::detail::thousands_sep_impl<wchar_t>(fmt::v10::detail::locale_ref)
000000000000b790 T fmt::v10::detail::throw_format_error(char const*)
000000000000c0d0 T fmt::v10::detail::print(__sFILE*, fmt::v10::basic_string_view<char>)
000000000000d830 W void fmt::v10::detail::buffer<char>::append<char>(char const*, char const*)
000000000000dc60 W void fmt::v10::detail::buffer<wchar_t>::append<wchar_t>(wchar_t const*, wchar_t const*)
000000000000d230 W fmt::v10::detail::dragonbox::decimal_fp<double> fmt::v10::detail::dragonbox::to_decimal<double>(double)
000000000000cf60 W fmt::v10::detail::dragonbox::decimal_fp<float> fmt::v10::detail::dragonbox::to_decimal<float>(float)
000000000000be00 T fmt::v10::detail::dragonbox::get_cached_power(int)
000000000000b9a0 T fmt::v10::detail::write_loc(fmt::v10::appender, fmt::v10::loc_value, fmt::v10::format_specs<char> const&, fmt::v10::detail::locale_ref)
000000000000c210 T fmt::v10::vprint(fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)
000000000000c150 T fmt::v10::vprint(__sFILE*, fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)
0000000000024680 T fmt::v10::ostream::~ostream()
0000000000024680 T fmt::v10::ostream::~ostream()
000000000000bce0 T fmt::v10::vformat(fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)
000000000000bb20 T fmt::v10::format_facet<std::__1::locale>::do_put(fmt::v10::appender, fmt::v10::loc_value, fmt::v10::format_specs<char> const&) const
0000000000023bc0 T fmt::v10::buffered_file::descriptor() const
0000000000023e30 T fmt::v10::file::size() const
000000000000c780 W std::__1::locale fmt::v10::detail::locale_ref::get<std::__1::locale>() const
                 U std::runtime_error::what() const
                 U std::__1::locale::has_facet(std::__1::locale::id&) const
                 U std::__1::locale::use_facet(std::__1::locale::id&) const
                 U std::runtime_error::runtime_error(char const*)
                 U std::runtime_error::runtime_error(char const*)
                 U std::runtime_error::~runtime_error()
                 U std::runtime_error::~runtime_error()
                 U std::bad_array_new_length::bad_array_new_length()
                 U std::bad_array_new_length::~bad_array_new_length()
                 U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(unsigned long, char)
                 U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
                 U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
                 U std::__1::system_error::system_error(std::__1::error_code, char const*)
                 U std::__1::system_error::system_error(std::__1::error_code, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
                 U std::__1::system_error::~system_error()
                 U std::__1::generic_category()
                 U std::__1::locale::facet::__on_zero_shared()
                 U std::__1::locale::facet::~facet()
                 U std::__1::locale::locale(std::__1::locale const&)
                 U std::__1::locale::locale()
                 U std::__1::locale::~locale()
                 U std::__1::numpunct<char>::id
                 U std::__1::numpunct<wchar_t>::id
                 U std::terminate()
0000000000025cb0 V typeinfo for fmt::v10::format_error
                 U typeinfo for std::__1::system_error
                 U typeinfo for std::__1::locale::facet
                 U typeinfo for std::runtime_error
                 U typeinfo for std::bad_array_new_length
0000000000004aac V typeinfo name for fmt::v10::format_error
                 U vtable for __cxxabiv1::__class_type_info
                 U vtable for __cxxabiv1::__si_class_type_info
                 U vtable for __cxxabiv1::__vmi_class_type_info
0000000000025cc8 V vtable for fmt::v10::format_error                                                                                                                   [25/1436]
                 U operator delete [](void*)
                 U operator delete(void*)
                 U operator new [](unsigned long)
                 U operator new(unsigned long)
                 U __cxa_allocate_exception
                 U __cxa_begin_catch
                 U __cxa_end_catch
                 w __cxa_finalize
                 U __cxa_free_exception
                 U __cxa_throw
                 U __error
                 U __gxx_personality_v0
                 U __stack_chk_fail
                 U __stack_chk_guard
                 U __stderrp
                 U __stdoutp
00000000000247dc T _fini
00000000000247cc T _init
                 U bcmp
                 U close
                 U dup
                 U dup2
                 U fclose
                 U fdopen
                 U fileno
                 U fopen
                 U fprintf
                 U fputc
                 U fstat
                 U fwrite
                 U memchr
                 U memcpy
                 U memset
                 U open
                 U pipe
                 U read
                 U strlen
                 U sysconf
                 U write
Peter2121 commented 3 months ago

After some digging, I could build it:

  1. Remove system fmt package
  2. Build fmt from sources using gcc13 and defining CXXFLAGS=-fPIC
  3. Install fmt built from sources
  4. Rebuild VowpalWabbit

Probably, some build files of VowpalWabbit need to be adjusted. Unfortunately, I'm not so strong in cmake to prepare a PR.

JohnLangford commented 3 months ago

Unfortunately, none of us have FreeBSD and we can't quite tell from the above what's going on. If someone can figure out how to smooth this process, a patch is welcome.