Problem with installing shark-ml on Mac with M1 chip

70 views Asked by At

Computer: Macbook air Processor: M1, 2020 OS: Ventura 13.4.1

Install dependency:

  • I first installed boost using brew: "arch -x86_64 brew install boost". Boost version: 1.82.0_1
  • My computer already has cmake installed. cmake version: 3.26.4

Install

I cloned shark-ML through git clone https://github.com/Shark-ML/Shark/

and executed the following commands based on the instructions in their website

mkdir Shark/build/
cd Shark/build
cmake ../
make

Observation

  • cmake successfully generated the make file.
  • cmake reported that it found Boost
  • When executing make, I keep getting the following warning: "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)"
  • when building up to 46%, it gives me the following error message and stopped:
[ 46%] Linking CXX executable ../bin/DirectSearch_HypervolumeContribution
[ 46%] Built target DirectSearch_HypervolumeContribution
[ 46%] Building CXX object Test/CMakeFiles/DirectSearch_MOEAD.dir/Algorithms/DirectSearch/MOEAD.cpp.o
In file included from /Users/wb/Documents/GitHub/Shark/Test/Algorithms/DirectSearch/MOEAD.cpp:5:
In file included from /Users/wb/Documents/GitHub/Shark/include/shark/Algorithms/DirectSearch/MOEAD.h:36:
In file included from /Users/wb/Documents/GitHub/Shark/include/shark/Algorithms/AbstractMultiObjectiveOptimizer.h:35:
In file included from /Users/wb/Documents/GitHub/Shark/include/shark/Algorithms/AbstractOptimizer.h:37:
In file included from /Users/wb/Documents/GitHub/Shark/include/shark/ObjectiveFunctions/AbstractObjectiveFunction.h:40:
In file included from /Users/wb/Documents/GitHub/Shark/include/shark/LinAlg/Base.h:48:
In file included from /Users/wb/Documents/GitHub/Shark/include/shark/LinAlg/Metrics.h:36:
In file included from /Users/wb/Documents/GitHub/Shark/include/shark/Core/Math.h:42:
In file included from /usr/local/include/boost/math/constants/constants.hpp:10:
/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]
    warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)"
     ^
/Users/wb/Documents/GitHub/Shark/Test/Algorithms/DirectSearch/MOEAD.cpp:16:21: error: no template named 'list' in namespace 'boost::mpl'
typedef boost::mpl::list<DTLZ1, DTLZ2, ZDT1, ZDT2, ZDT3, ZDT4, ZDT6> obj_funs;
        ~~~~~~~~~~~~^
In file included from /Users/wb/Documents/GitHub/Shark/Test/Algorithms/DirectSearch/MOEAD.cpp:2:
In file included from /usr/local/include/boost/test/unit_test.hpp:19:
In file included from /usr/local/include/boost/test/unit_test_suite.hpp:19:
In file included from /usr/local/include/boost/test/tree/test_case_template.hpp:28:
/usr/local/include/boost/mpl/for_each.hpp:99:5: error: no matching function for call to 'assertion_failed'
    BOOST_MPL_ASSERT(( is_sequence<Sequence> ));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:299:11: note: expanded from macro 'BOOST_MPL_ASSERT'
          boost::mpl::assertion_failed<false>( \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/mpl/assert.hpp:60:58: note: expanded from macro '\
BOOST_MPL_AUX_ASSERT_CONSTANT'
   define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
                                                         ^~~~
/usr/local/include/boost/test/tree/test_case_template.hpp:162:14: note: in instantiation of function template specialization 'boost::mpl::for_each<int, boost::mpl::make_identity<mpl_::arg<-1>>, boost::unit_test::ut_detail::generate_test_case_4_type<boost::unit_test::ut_detail::template_test_case_gen<Algorithms_DirectSearch_MOEAD::Hypervolume_functions_mu10_invoker, int>, Algorithms_DirectSearch_MOEAD::Hypervolume_functions_mu10_invoker>>' requested here
        mpl::for_each<TestTypesList,mpl::make_identity<mpl::_> >( single_test_gen( tc_name, tc_file, tc_line, *this ) );
             ^
/Users/wb/Documents/GitHub/Shark/Test/Algorithms/DirectSearch/MOEAD.cpp:22:1: note: in instantiation of member function 'boost::unit_test::ut_detail::template_test_case_gen<Algorithms_DirectSearch_MOEAD::Hypervolume_functions_mu10_invoker, int>::template_test_case_gen' requested here
BOOST_AUTO_TEST_CASE_TEMPLATE(Hypervolume_functions_mu10, OF, obj_funs)
^
/usr/local/include/boost/test/unit_test_suite.hpp:265:73: note: expanded from macro 'BOOST_AUTO_TEST_CASE_TEMPLATE'
#define BOOST_AUTO_TEST_CASE_TEMPLATE( test_name, type_name, TL )       \
                                                                        ^
/usr/local/include/boost/test/unit_test_suite.hpp:252:5: note: expanded from macro '\
BOOST_FIXTURE_TEST_CASE_TEMPLATE'
    boost::unit_test::ut_detail::template_test_case_gen<                \
    ^
/usr/local/include/boost/mpl/assert.hpp:83:5: note: candidate function template not viable: no known conversion from 'mpl_::failed ************(boost::mpl::is_sequence<int>::************)' to 'typename assert<false>::type' (aka 'mpl_::assert<false>') for 1st argument
int assertion_failed( typename assert<C>::type );
    ^
1 warning and 2 errors generated.
make[2]: *** [Test/CMakeFiles/DirectSearch_MOEAD.dir/Algorithms/DirectSearch/MOEAD.cpp.o] Error 1
make[1]: *** [Test/CMakeFiles/DirectSearch_MOEAD.dir/all] Error 2
make: *** [all] Error 2

Question:

I am pretty new to C++. Could someone tell me what could go wrong and how to fix it? Thank you in advance.

My guess is the c++ standard used by the Shark-ML build system is below c++14, but I am not clear how to check that.

0

There are 0 answers