Shark-ML / Shark

The Shark Machine Leaning Library. See more:
http://shark-ml.github.io/Shark/
GNU Lesser General Public License v3.0
493 stars 130 forks source link

Problem with boost - tried a few things (Not solved yet) #289

Closed mumuhamm closed 2 months ago

mumuhamm commented 3 years ago

[ 55%] Built target Trainers_EpsilonSvmTrainer Consolidate compiler generated dependencies of target Models_NeuronLayer [ 55%] Building CXX object Test/CMakeFiles/Models_NeuronLayer.dir/Models/NeuronLayer.cpp.o /Users/md/Documents/GitHub/Shark-4.0.0/Test/Models/NeuronLayer.cpp:14:21: error: no template named 'list' in namespace 'boost::mpl' typedef boost::mpl::list<TanhNeuron,LinearNeuron, LogisticNeuron, FastSigmoidNeuron, NormalizerNeuron<>, SoftmaxNeuron<> > neuron_types;


In file included from /Users/md/Documents/GitHub/Shark-4.0.0/Test/Models/NeuronLayer.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<Models_DropoutLayer::NeuronLayer_Value_invoker, int, void>,
      Models_DropoutLayer::NeuronLayer_Value_invoker> >' requested here
        mpl::for_each<TestTypesList,mpl::make_identity<mpl::_> >( single_test_gen( tc_name, tc_file, tc_line, *this ) );
             ^
/Users/md/Documents/GitHub/Shark-4.0.0/Test/Models/NeuronLayer.cpp:16:1: note: in instantiation of member function
      'boost::unit_test::ut_detail::template_test_case_gen<Models_DropoutLayer::NeuronLayer_Value_invoker, int, void>::template_test_case_gen' requested here
BOOST_AUTO_TEST_CASE_TEMPLATE(NeuronLayer_Value, Neuron,neuron_types){
^
/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 );
    ^
In file included from /Users/md/Documents/GitHub/Shark-4.0.0/Test/Models/NeuronLayer.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<Models_DropoutLayer::NeuronLayer_Derivative_invoker, int, void>,
      Models_DropoutLayer::NeuronLayer_Derivative_invoker> >' requested here
        mpl::for_each<TestTypesList,mpl::make_identity<mpl::_> >( single_test_gen( tc_name, tc_file, tc_line, *this ) );
             ^
/Users/md/Documents/GitHub/Shark-4.0.0/Test/Models/NeuronLayer.cpp:27:1: note: in instantiation of member function
      'boost::unit_test::ut_detail::template_test_case_gen<Models_DropoutLayer::NeuronLayer_Derivative_invoker, int, void>::template_test_case_gen' requested here
BOOST_AUTO_TEST_CASE_TEMPLATE(NeuronLayer_Derivative, Neuron,neuron_types) {
^
/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 );
    ^
3 errors generated.
make[2]: *** [Test/CMakeFiles/Models_NeuronLayer.dir/Models/NeuronLayer.cpp.o] Error 1
make[1]: *** [Test/CMakeFiles/Models_NeuronLayer.dir/all] Error 2
make: *** [all] Error 2
omidnabi commented 1 year ago

I'm having a similar issue. My build fails at 50%. I'm trying to build in RHEL9 using boost_1_80. Does anyone review these issues?

[ 50%] Building CXX object Test/CMakeFiles/GradDesc_Adam.dir/Algorithms/GradientDescent/Adam.cpp.o In file included from /usr/local/include/boost/math/constants/constants.hpp:10, from /home/omid.nabipour/Downloads/stillBuilding/Shark/include/shark/Core/Math.h:42, from /home/omid.nabipour/Downloads/stillBuilding/Shark/include/shark/LinAlg/Metrics.h:36, from /home/omid.nabipour/Downloads/stillBuilding/Shark/include/shark/LinAlg/Base.h:48, from /home/omid.nabipour/Downloads/stillBuilding/Shark/include/shark/ObjectiveFunctions/AbstractObjectiveFunction.h:40, from /home/omid.nabipour/Downloads/stillBuilding/Shark/include/shark/ObjectiveFunctions/Benchmarks/Ellipsoid.h:34, from /home/omid.nabipour/Downloads/stillBuilding/Shark/Test/Algorithms/GradientDescent/Adam.cpp:5: /usr/local/include/boost/math/tools/config.hpp:23:6: warning: #warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" [-Wcpp] 23 | # warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" | ^~~~~~~ In file included from /usr/local/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22, from /usr/local/include/boost/smart_ptr/detail/yield_k.hpp:23, from /usr/local/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14, from /usr/local/include/boost/smart_ptr/detail/spinlock.hpp:42, from /usr/local/include/boost/smart_ptr/detail/spinlock_pool.hpp:25, from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:29, from /usr/local/include/boost/shared_ptr.hpp:17, from /usr/local/include/boost/test/tools/assertion_result.hpp:21, from /usr/local/include/boost/test/tools/old/impl.hpp:20, from /usr/local/include/boost/test/test_tools.hpp:46, from /usr/local/include/boost/test/unit_test.hpp:18, from /home/omid.nabipour/Downloads/stillBuilding/Shark/Test/Algorithms/GradientDescent/Adam.cpp:2: /usr/local/include/boost/test/floating_point_comparison.hpp:14:1: note: ‘#pragma message: This header is deprecated. Use <boost/test/tools/floating_point_comparison.hpp> instead.’ 14 | BOOST_HEADER_DEPRECATED( "<boost/test/tools/floating_point_comparison.hpp>" ) | ^~~~~~~~~~~~~~~~~~~~~~~ /home/omid.nabipour/Downloads/stillBuilding/Shark/Test/Algorithms/GradientDescent/Adam.cpp:79:21: error: ‘list’ in namespace ‘boost::mpl’ does not name a template type 79 | typedef boost::mpl::list<RealVector, FloatVector > VectorTypes; | ^~~~ In file included from /usr/local/include/boost/test/unit_test.hpp:19, from /home/omid.nabipour/Downloads/stillBuilding/Shark/Test/Algorithms/GradientDescent/Adam.cpp:2: /home/omid.nabipour/Downloads/stillBuilding/Shark/Test/Algorithms/GradientDescent/Adam.cpp:81:54: error: ‘VectorTypes’ was not declared in this scope 81 | BOOST_AUTO_TEST_CASE_TEMPLATE(Basic_Test, VectorType,VectorTypes){ | ^~~~~~~~~~~ /home/omid.nabipour/Downloads/stillBuilding/Shark/Test/Algorithms/GradientDescent/Adam.cpp:81:1: error: template argument 2 is invalid 81 | BOOST_AUTO_TEST_CASE_TEMPLATE(Basic_Test, VectorType,VectorTypes){ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ make[2]: *** [Test/CMakeFiles/GradDesc_Adam.dir/build.make:76: Test/CMakeFiles/GradDesc_Adam.dir/Algorithms/GradientDescent/Adam.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:3639: Test/CMakeFiles/GradDesc_Adam.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

christian-igel commented 2 months ago

Fixed in the repo.