mlpack / models

models built with mlpack
https://models.mlpack.org/docs
BSD 3-Clause "New" or "Revised" License
33 stars 42 forks source link

Error while building on M1 macbook #48

Closed RishabhGarg108 closed 3 years ago

RishabhGarg108 commented 3 years ago

I am getting the following error while building from source on M1 macbook air.

Scanning dependencies of target models_test
[ 16%] Building CXX object tests/CMakeFiles/models_test.dir/augmentation_tests.cpp.o
[ 33%] Building CXX object tests/CMakeFiles/models_test.dir/ffn_model_tests.cpp.o
[ 50%] Building CXX object tests/CMakeFiles/models_test.dir/dataloader_tests.cpp.o
[ 66%] Building CXX object tests/CMakeFiles/models_test.dir/preprocessor_tests.cpp.o
[ 83%] Building CXX object tests/CMakeFiles/models_test.dir/utils_tests.cpp.o
[100%] Linking CXX executable ../bin/models_test
ld: warning: ignoring file /opt/homebrew/lib/libboost_filesystem-mt.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/lib/libboost_unit_test_framework-mt.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/lib/libboost_system-mt.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/lib/libboost_serialization-mt.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/lib/libboost_regex-mt.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "boost::filesystem::detail::current_path(boost::system::error_code*)", referenced from:
      boost::filesystem::current_path() in dataloader_tests.cpp.o
      boost::filesystem::current_path() in utils_tests.cpp.o
  "boost::filesystem::detail::dir_itr_close(void*&, void*&)", referenced from:
      boost::filesystem::detail::dir_itr_imp::~dir_itr_imp() in dataloader_tests.cpp.o
  "boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, unsigned int, boost::system::error_code*)", referenced from:
      boost::filesystem::directory_iterator::directory_iterator(boost::filesystem::path const&, boost::filesystem::directory_options) in dataloader_tests.cpp.o
  "boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*)", referenced from:
      boost::filesystem::directory_iterator::increment() in dataloader_tests.cpp.o
  "boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)", referenced from:
      boost::filesystem::is_regular_file(boost::filesystem::path const&) in dataloader_tests.cpp.o
      boost::filesystem::is_directory(boost::filesystem::path const&) in dataloader_tests.cpp.o
  "boost::test_tools::tt_detail::print_log_value<bool>::operator()(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& boost::test_tools::tt_detail::operator<<<bool>(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, boost::test_tools::tt_detail::print_helper_t<bool> const&) in utils_tests.cpp.o
  "boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)", referenced from:
      bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long long, int>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long long const&, char const*, int const&, char const*) in augmentation_tests.cpp.o
      bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long long, int>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long long const&, char const*, int const&, char const*) in ffn_model_tests.cpp.o
      DataLoadersTest::CSVDataLoaderTest::test_method() in dataloader_tests.cpp.o
      bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long long, int>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long long const&, char const*, int const&, char const*) in dataloader_tests.cpp.o
      bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long, int>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long const&, char const*, int const&, char const*) in dataloader_tests.cpp.o
      bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::check_is_close_t, double, double, boost::math::fpc::percent_tolerance_t<double> >(boost::test_tools::check_is_close_t, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, double const&, char const*, double const&, char const*, boost::math::fpc::percent_tolerance_t<double> const&, char const*) in preprocessor_tests.cpp.o
      bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::check_is_small_t, double, double>(boost::test_tools::check_is_small_t, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, double const&, char const*, double const&, char const*) in preprocessor_tests.cpp.o
      ...
  "boost::regex_error::regex_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::regex_constants::error_type, long)", referenced from:
      boost::re_detail_107500::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail_107500::re_syntax_base*) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail_107500::re_syntax_base*) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail_107500::re_syntax_base*, unsigned char*, unsigned int*, unsigned char) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in dataloader_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail_107500::re_syntax_base*) in dataloader_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail_107500::re_syntax_base*) in dataloader_tests.cpp.o
      ...
  "boost::regex_error::~regex_error()", referenced from:
      boost::re_detail_107500::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail_107500::re_syntax_base*) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail_107500::re_syntax_base*) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail_107500::re_syntax_base*, unsigned char*, unsigned int*, unsigned char) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in dataloader_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail_107500::re_syntax_base*) in dataloader_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail_107500::re_syntax_base*) in dataloader_tests.cpp.o
      ...
  "boost::re_detail_107500::raw_storage::insert(unsigned long, unsigned long)", referenced from:
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::insert_state(long, boost::re_detail_107500::syntax_element_type, unsigned long) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::insert_state(long, boost::re_detail_107500::syntax_element_type, unsigned long) in dataloader_tests.cpp.o
  "boost::re_detail_107500::raw_storage::resize(unsigned long)", referenced from:
      boost::re_detail_107500::raw_storage::extend(unsigned long) in augmentation_tests.cpp.o
      boost::re_detail_107500::raw_storage::extend(unsigned long) in dataloader_tests.cpp.o
  "boost::re_detail_107500::get_mem_block()", referenced from:
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack() in augmentation_tests.cpp.o
      boost::re_detail_107500::save_state_init::save_state_init(boost::re_detail_107500::saved_state**, boost::re_detail_107500::saved_state**) in augmentation_tests.cpp.o
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack() in dataloader_tests.cpp.o
      boost::re_detail_107500::save_state_init::save_state_init(boost::re_detail_107500::saved_state**, boost::re_detail_107500::saved_state**) in dataloader_tests.cpp.o
  "boost::re_detail_107500::put_mem_block(void*)", referenced from:
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool) in augmentation_tests.cpp.o
      boost::re_detail_107500::save_state_init::~save_state_init() in augmentation_tests.cpp.o
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool) in dataloader_tests.cpp.o
      boost::re_detail_107500::save_state_init::~save_state_init() in dataloader_tests.cpp.o
  "boost::re_detail_107500::verify_options(unsigned int, boost::regex_constants::_match_flags)", referenced from:
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp() in augmentation_tests.cpp.o
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp() in dataloader_tests.cpp.o
  "boost::re_detail_107500::raise_runtime_error(std::runtime_error const&)", referenced from:
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::init() in augmentation_tests.cpp.o
      void boost::re_detail_107500::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type) in augmentation_tests.cpp.o
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::init() in dataloader_tests.cpp.o
      void boost::re_detail_107500::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type) in dataloader_tests.cpp.o
  "boost::re_detail_107500::get_default_error_string(boost::regex_constants::error_type)", referenced from:
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::init() in augmentation_tests.cpp.o
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const in augmentation_tests.cpp.o
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::init() in dataloader_tests.cpp.o
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const in dataloader_tests.cpp.o
  "boost::re_detail_107500::cpp_regex_traits_char_layer<char>::init()", referenced from:
      boost::re_detail_107500::cpp_regex_traits_char_layer<char>::cpp_regex_traits_char_layer(boost::re_detail_107500::cpp_regex_traits_base<char> const&) in augmentation_tests.cpp.o
      boost::re_detail_107500::cpp_regex_traits_char_layer<char>::cpp_regex_traits_char_layer(boost::re_detail_107500::cpp_regex_traits_base<char> const&) in dataloader_tests.cpp.o
  "boost::re_detail_107500::lookup_default_collate_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in augmentation_tests.cpp.o
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in dataloader_tests.cpp.o
  "boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)", referenced from:
      boost::object_cache<boost::re_detail_107500::cpp_regex_traits_base<char>, boost::re_detail_107500::cpp_regex_traits_implementation<char> >::get(boost::re_detail_107500::cpp_regex_traits_base<char> const&, unsigned long) in augmentation_tests.cpp.o
      boost::cpp_regex_traits<char>::get_catalog_name() in augmentation_tests.cpp.o
      boost::object_cache<boost::re_detail_107500::cpp_regex_traits_base<char>, boost::re_detail_107500::cpp_regex_traits_implementation<char> >::get(boost::re_detail_107500::cpp_regex_traits_base<char> const&, unsigned long) in dataloader_tests.cpp.o
      boost::cpp_regex_traits<char>::get_catalog_name() in dataloader_tests.cpp.o
  "boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()", referenced from:
      boost::object_cache<boost::re_detail_107500::cpp_regex_traits_base<char>, boost::re_detail_107500::cpp_regex_traits_implementation<char> >::get(boost::re_detail_107500::cpp_regex_traits_base<char> const&, unsigned long) in augmentation_tests.cpp.o
      boost::cpp_regex_traits<char>::get_catalog_name() in augmentation_tests.cpp.o
      boost::object_cache<boost::re_detail_107500::cpp_regex_traits_base<char>, boost::re_detail_107500::cpp_regex_traits_implementation<char> >::get(boost::re_detail_107500::cpp_regex_traits_base<char> const&, unsigned long) in dataloader_tests.cpp.o
      boost::cpp_regex_traits<char>::get_catalog_name() in dataloader_tests.cpp.o
  "boost::unit_test::lazy_ostream::inst", referenced from:
      boost::unit_test::lazy_ostream::instance() in augmentation_tests.cpp.o
      boost::unit_test::lazy_ostream::instance() in ffn_model_tests.cpp.o
      boost::unit_test::lazy_ostream::instance() in dataloader_tests.cpp.o
      boost::unit_test::lazy_ostream::instance() in preprocessor_tests.cpp.o
      boost::unit_test::lazy_ostream::instance() in utils_tests.cpp.o
  "boost::unit_test::unit_test_main(bool (*)(), int, char**)", referenced from:
      _main in dataloader_tests.cpp.o
  "boost::unit_test::unit_test_log_t::set_checkpoint(boost::unit_test::basic_cstring<char const>, unsigned long, boost::unit_test::basic_cstring<char const>)", referenced from:
      AugmentationTest::ResizeAugmentationTest_invoker() in augmentation_tests.cpp.o
      AugmentationTest::ResizeAugmentationTest::test_method() in augmentation_tests.cpp.o
      FFNModelsTests::DarknetModelTest_invoker() in ffn_model_tests.cpp.o
      FFNModelsTests::DarknetModelTest::test_method() in ffn_model_tests.cpp.o
      FFNModelsTests::YOLOV1ModelTest_invoker() in ffn_model_tests.cpp.o
      FFNModelsTests::YOLOV1ModelTest::test_method() in ffn_model_tests.cpp.o
      DataLoadersTest::CSVDataLoaderTest_invoker() in dataloader_tests.cpp.o
      ...
  "boost::unit_test::unit_test_log_t::instance()", referenced from:
      ___cxx_global_var_init in augmentation_tests.cpp.o
      ___cxx_global_var_init.44 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.42 in dataloader_tests.cpp.o
      ___cxx_global_var_init.42 in preprocessor_tests.cpp.o
      ___cxx_global_var_init.40 in utils_tests.cpp.o
  "boost::unit_test::decorator::collector_t::instance()", referenced from:
      ___cxx_global_var_init.36 in augmentation_tests.cpp.o
      ___cxx_global_var_init.39 in augmentation_tests.cpp.o
      ___cxx_global_var_init.45 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.48 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.56 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.43 in dataloader_tests.cpp.o
      ___cxx_global_var_init.46 in dataloader_tests.cpp.o
      ...
  "boost::unit_test::test_case::test_case(boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long, boost::function<void ()> const&)", referenced from:
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in augmentation_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in ffn_model_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in dataloader_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in preprocessor_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in utils_tests.cpp.o
  "boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long, boost::unit_test::decorator::collector_t&)", referenced from:
      ___cxx_global_var_init.36 in augmentation_tests.cpp.o
      ___cxx_global_var_init.45 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.43 in dataloader_tests.cpp.o
      ___cxx_global_var_init.43 in preprocessor_tests.cpp.o
      ___cxx_global_var_init.41 in utils_tests.cpp.o
  "boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, boost::unit_test::decorator::collector_t&, unsigned long)", referenced from:
      ___cxx_global_var_init.39 in augmentation_tests.cpp.o
      ___cxx_global_var_init.48 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.56 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.46 in dataloader_tests.cpp.o
      ___cxx_global_var_init.68 in dataloader_tests.cpp.o
      ___cxx_global_var_init.91 in dataloader_tests.cpp.o
      ___cxx_global_var_init.143 in dataloader_tests.cpp.o
      ...
  "boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(int)", referenced from:
      ___cxx_global_var_init.50 in augmentation_tests.cpp.o
      ___cxx_global_var_init.60 in ffn_model_tests.cpp.o
      ___cxx_global_var_init.156 in dataloader_tests.cpp.o
      ___cxx_global_var_init.58 in preprocessor_tests.cpp.o
      ___cxx_global_var_init.88 in utils_tests.cpp.o
  "boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char const>)", referenced from:
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in augmentation_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in ffn_model_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in dataloader_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in preprocessor_tests.cpp.o
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in utils_tests.cpp.o
  "boost::filesystem::path::compare(boost::filesystem::path const&) const", referenced from:
      boost::filesystem::operator<(boost::filesystem::path const&, boost::filesystem::path const&) in dataloader_tests.cpp.o
  "boost::filesystem::path::filename() const", referenced from:
      Utils::ListDir(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<boost::filesystem::path, std::__1::allocator<boost::filesystem::path> >&, bool)::'lambda'(boost::filesystem::path)::operator()(boost::filesystem::path) const in dataloader_tests.cpp.o
  "boost::filesystem::path::extension() const", referenced from:
      DataLoader<arma::Mat<double>, arma::Mat<double>, mlpack::data::MinMaxScaler>::LoadAllImagesFromDirectory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, arma::Mat<double>&, arma::Mat<double>&, unsigned long, unsigned long, unsigned long, unsigned long) in dataloader_tests.cpp.o
  "boost::regex_error::raise() const", referenced from:
      boost::re_detail_107500::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail_107500::re_syntax_base*) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail_107500::re_syntax_base*) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail_107500::re_syntax_base*, unsigned char*, unsigned int*, unsigned char) in augmentation_tests.cpp.o
      boost::re_detail_107500::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in dataloader_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail_107500::re_syntax_base*) in dataloader_tests.cpp.o
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail_107500::re_syntax_base*) in dataloader_tests.cpp.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/models_test] Error 1
make[1]: *** [tests/CMakeFiles/models_test.dir/all] Error 2
make: *** [all] Error 2

Please help me figure out this error.

shrit commented 3 years ago

Why it is trying to use x86_64 linker on arm64 machine?

RishabhGarg108 commented 3 years ago

I have absolutely no clue. It was also strange for me. I tried adding arch -arm64 prefix to make command but still got no luck :(

shrit commented 3 years ago

Are you building mlpack? what is model_test? Can you print the cmake?

RishabhGarg108 commented 3 years ago

Are you building mlpack? what is model_test? I am building the "models" repository. Mlpack is already built on my system. Can you print the cmake?


ishanki@Ishankis-MacBook-Air build % cmake -D DEBUG=ON ../  
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Armadillo: /usr/local/lib/libarmadillo.dylib (found suitable version "10.2.0", minimum required is "8.400.0") 
-- Found MLPACK: /usr/local/lib/libmlpack.dylib  
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.19.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
The package name passed to `find_package_handle_standard_args` (ensmallen)
does not match the name of the calling package (Ensmallen).  This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
CMake/FindEnsmallen.cmake:55 (find_package_handle_standard_args)
CMakeLists.txt:116 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find ensmallen (missing: ENSMALLEN_INCLUDE_DIR) -- [download 1% complete] -- [download 2% complete] -- [download 4% complete] -- [download 5% complete] -- [download 7% complete] -- [download 9% complete] -- [download 10% complete] -- [download 11% complete] -- [download 12% complete] -- [download 13% complete] -- [download 14% complete] -- [download 15% complete] -- [download 16% complete] -- [download 17% complete] -- [download 18% complete] -- [download 19% complete] -- [download 20% complete] -- [download 21% complete] -- [download 22% complete] -- [download 23% complete] -- [download 24% complete] -- [download 26% complete] -- [download 27% complete] -- [download 28% complete] -- [download 30% complete] -- [download 31% complete] -- [download 33% complete] -- [download 34% complete] -- [download 36% complete] -- [download 37% complete] -- [download 39% complete] -- [download 40% complete] -- [download 41% complete] -- [download 42% complete] -- [download 43% complete] -- [download 45% complete] -- [download 46% complete] -- [download 48% complete] -- [download 49% complete] -- [download 50% complete] -- [download 51% complete] -- [download 52% complete] -- [download 54% complete] -- [download 56% complete] -- [download 57% complete] -- [download 58% complete] -- [download 59% complete] -- [download 60% complete] -- [download 61% complete] -- [download 63% complete] -- [download 64% complete] -- [download 65% complete] -- [download 66% complete] -- [download 67% complete] -- [download 69% complete] -- [download 70% complete] -- [download 71% complete] -- [download 73% complete] -- [download 74% complete] -- [download 75% complete] -- [download 76% complete] -- [download 78% complete] -- [download 79% complete] -- [download 80% complete] -- [download 81% complete] -- [download 82% complete] -- [download 83% complete] -- [download 84% complete] -- [download 85% complete] -- [download 86% complete] -- [download 87% complete] -- [download 88% complete] -- [download 89% complete] -- [download 91% complete] -- [download 92% complete] -- [download 93% complete] -- [download 94% complete] -- [download 96% complete] -- [download 97% complete] -- [download 98% complete] -- [download 99% complete] -- [download 100% complete]

shrit commented 3 years ago

@RishabhGarg108 Sorry, I meant the source code

shrit commented 3 years ago

Also looking at the first notice it shows that you are trying to build for x86_64, please, have a look here: building for macOS-x86_64 but attempting to link with file built for macOS-arm64

RishabhGarg108 commented 3 years ago

I am building the latest mlpack/models. So you can look at the cmake source here

Also looking at the first notice it shows that you are trying to build for x86_64, please, have a look here: building for macOS-x86_64 but attempting to link with file built for macOS-arm64

I simply followed the build instructions from the README and did nothing fancy. Thats why I was confused why it was building for x86_64.

RishabhGarg108 commented 3 years ago

I am guessing that it is having some issue with the boost libraries.

shrit commented 3 years ago

I will give a closer look at the cmake file. Is boost still required for these models? I think in the meanwhile you can start by removing the unnecessary boost libraries.

RishabhGarg108 commented 3 years ago

Actually I am new to this project so I don't know much. Maybe @kartikdutt18 could give you better insights.

kartikdutt18 commented 3 years ago

The tests currently use boost so to remove it, we would have to transfer them to catch. I am trying to fix the build right now...after that I will raise a PR or an issue for shifting to catch as well. Also the repo uses boost regex (will also need to transfer that).

shrit commented 3 years ago

Even if we remove all boost, this will not resolve the issue, Actually, the message says that it is not able to link with boost libraries since they are built for arm64. If I understand the issue right your cmake is trying to build for x86_64.

RishabhGarg108 commented 3 years ago

Even if we remove all boost, this will not resolve the issue, Actually, the message says that it is not able to link with boost libraries since they are built for arm64. If I understand the issue right your cmake is trying to build for x86_64.

I am not a cmake expert, but while looking at it, I found this block of code. Here, it is handling for MacOSX, and lower versions. But there is nothing for MacOS 11. Could this be a potential cause ?

shrit commented 3 years ago

I have never used clang or macOS, I think you need to check if this block is executing, if not I do not see how it might affect the build. Also, it seems that cmake is able to find the compiler and the entire toolchain, I do not understand why it is trying to cross-compile into a different architecture Try to comment things out inside the CMake file, delete the entire build directory and restart the process.

RishabhGarg108 commented 3 years ago

@shrit , I dug a bit deeper and found out something.

This issue arose after I updated my cmake. My cmake version is 3.19.5. So, starting from version 3.19.2, cmake has provided CMAKE_APPLE_SILICON_PROCESSOR environment variable that can be used to explicitly specify the architecture.

I also faced an error similar to what I am facing here while compiling the mlpack main repository. But there I was able to get around by using set(CMAKE_APPLE_SILICON_PROCESSOR "arm64"). But, two more things came up after this: -

  1. This is not working for this models repo(although it worked just fine for mlpack main repo)
  2. This will probably break the existing build for intel based macbooks.

I am not at all good with cmake. So, can you please try to find some solution to this. I am putting up some references which I found on internet. Hopefully you can make more sense out of then and it might save you some time looking online :-)

https://cmake.org/cmake/help/latest/variable/CMAKE_APPLE_SILICON_PROCESSOR.html#variable:CMAKE_APPLE_SILICON_PROCESSOR https://gitlab.kitware.com/cmake/cmake/-/issues/20989 https://discourse.cmake.org/t/how-to-determine-which-architectures-are-available-apple-m1/2401 https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html

I am not 100% sure about my findings. Could you please take a closer look at it. Thanks!

heisenbuug commented 3 years ago

The tests currently use boost so to remove it, we would have to transfer them to catch. I am trying to fix the build right now...after that I will raise a PR or an issue for shifting to catch as well. Also the repo uses boost regex (will also need to transfer that).

I can start working on migrating tests to catch, I even looked at catch... @kartikdutt18 I want to confirm whether we want to use catch v3 or catch v2?

zoq commented 3 years ago

The tests currently use boost so to remove it, we would have to transfer them to catch. I am trying to fix the build right now...after that I will raise a PR or an issue for shifting to catch as well. Also the repo uses boost regex (will also need to transfer that).

I can start working on migrating tests to catch, I even looked at catch... @kartikdutt18 I want to confirm whether we want to use catch v3 or catch v2?

Is there a catch version 3, I think there is only https://github.com/catchorg/Catch2, maybe I'm missing something.

RishabhGarg108 commented 3 years ago

Hello, did anyone found the root of this problem ? I am still not able to figure out why it is happening :(

shrit commented 3 years ago

@RishabhGarg108 it might worth it that you compile a hello world program in C++ using CMake and clang. Then use file ./hello_world in order to see what is the type of binaries. Let me know about the results.

RishabhGarg108 commented 3 years ago

@shrit I will try to do that and will share the results 👍

mlpack-bot[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! :+1:

mlpack-bot[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! :+1:

KishenSharma6 commented 2 years ago

@RishabhGarg108 were you able to resolve this? I'm running into a similar issue with my m1 Mac where cmake is building for macOS-x86_64 but attempting to link with file built for macOS-arm64

KishenSharma6 commented 2 years ago

Nvm resolved, just needed to set the following in CMAKE for arm64

set(CMAKE_REQUIRED_LINK_OPTIONS "-arch;arm64")