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

v4.0.0: make error on example routine RFTutorial.cpp #261

Open axiqia opened 5 years ago

axiqia commented 5 years ago

I installed shark 3.0 and trained Random forest, but it is really slow for me when the dataset is large. And [issue252] (https://github.com/Shark-ML/Shark/issues/252) suggested me to try shark 4.0.

So I installed shark 4.0 follow the installation, and every step worked fine.

But when I compiled the routine RFTutorial.cpp as bellow, I got a lot of errors. Is there something I missed ?Thank you.

cmake "-DShark_DIR=~/sxue/Shark-4.0/Shark/build" ..
make all -j16 

CMakeList.txt

cmake_minimum_required(VERSION 2.8)                                         

# This project is designed to be built outside the Shark source tree.
# set Shark_DIR to the proper location
 project(RFtrain)

# Find the Shark libraries and includes
find_package(Shark REQUIRED)
include(${SHARK_USE_FILE})

 # Executable
add_executable(RFtrain RFTutorial.cpp)
target_link_libraries(RFtrain ${SHARK_LIBRARIES})

from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/Iterators.h:175:3: error: expected ‘{’ before ‘::’ token
  >::type
   ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/Iterators.h:176:1: error: expected initializer before ‘>’ token
 >{
 ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:39:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:42:15: error: ‘mt19937’ in namespace ‘std’ does not name a type
  typedef std::mt19937 rng_type;
               ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:44:29: error: ‘rng_type’ does not name a type
  SHARK_EXPORT_SYMBOL extern rng_type globalRng;
                             ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h: In function ‘bool shark::random::coinToss(RngType&, double)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:49:3: error: ‘bernoulli_distribution’ is not a member of ‘std’
   std::bernoulli_distribution dist(pHeads);
   ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h: In function ‘double shark::random::uni(RngType&, double, double)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:56:3: error: ‘uniform_real_distribution’ is not a member of ‘std’
   std::uniform_real_distribution<double> dist(lower,upper);
   ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:56:34: error: expected primary-expression before ‘double’
   std::uniform_real_distribution<double> dist(lower,upper);
                                  ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h: In function ‘T shark::random::discrete(RngType&, T, T)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:63:3: error: ‘uniform_int_distribution’ is not a member of ‘std’
   std::uniform_int_distribution<T> dist(low, high);
   ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:63:34: error: expected primary-expression before ‘>’ token
   std::uniform_int_distribution<T> dist(low, high);
                                  ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h: In function ‘double shark::random::gauss(RngType&, double, double)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:70:3: error: ‘normal_distribution’ is not a member of ‘std’
   std::normal_distribution<double> dist(mean,std::sqrt(variance));
   ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Random.h:70:28: error: expected primary-expression before ‘double’
   std::normal_distribution<double> dist(mean,std::sqrt(variance));
                            ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h: In function ‘void shark::partial_shuffle(RandomAccessIterator, RandomAccessIterator, RandomAccessIterator)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:72:35: error: ‘globalRng’ is not a member of ‘shark::random’
  partial_shuffle(begin,middle,end,random::globalRng);
                                   ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h: In function ‘typename boost::range_iterator<C>::type shark::median_element(Range&)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:83:7: error: ‘medianIter’ does not name a type
  auto medianIter = boost::begin(range)+medianPos;
       ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:85:33: error: ‘medianIter’ was not declared in this scope
  std::nth_element(range.begin(),medianIter, range.end());
                                 ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h: In function ‘typename boost::range_iterator<C>::type shark::partitionEqually(Range&)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:106:7: error: ‘begin’ does not name a type
  auto begin = range.begin();
       ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:107:7: error: ‘end’ does not name a type
  auto end = range.end();
       ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:108:7: error: ‘medianIter’ does not name a type
  auto medianIter = median_element(range);
       ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:112:7: error: ‘median’ does not name a type
  auto median = *medianIter;
       ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:114:7: error: ‘left’ does not name a type
  auto left = std::partition(begin,medianIter,[&](const_ref elem){return elem < 
       ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:114:88: error: expected primary-expression before ‘)’ token
  = std::partition(begin,medianIter,[&](const_ref elem){return elem < median;});
                                                                              ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:115:7: error: ‘right’ does not name a type
  auto right = std::partition(medianIter,end,[&](const_ref elem){return elem == 
       ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:115:88: error: expected primary-expression before ‘)’ token
 t = std::partition(medianIter,end,[&](const_ref elem){return elem == median;});
                                                                              ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:118:5: error: ‘left’ was not declared in this scope
  if(left == begin){
     ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:118:5: note: suggested alternative:
In file included from /usr/include/c++/5/ios:42:0,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iterator:64,
                 from /usr/include/boost/detail/iterator.hpp:11,
                 from /usr/include/boost/iterator/iterator_traits.hpp:8,
                 from /usr/include/boost/range/mutable_iterator.hpp:23,
                 from /usr/include/boost/range/iterator.hpp:20,
                 from /usr/include/boost/range/begin.hpp:24,
                 from /usr/include/boost/assign/list_inserter.hpp:22,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/c++/5/bits/ios_base.h:999:3: note:   ‘std::left’
   left(ios_base& __base)
   ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:118:13: error: ‘begin’ was not declared in this scope
  if(left == begin){
             ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:118:13: note: suggested alternatives:
In file included from /usr/include/boost/assign/list_inserter.hpp:22:0,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/aux_/at_impl.hpp:17,
                 from /usr/include/boost/mpl/at.hpp:18,
                 from /usr/include/boost/multi_index_container.hpp:24,
                 from /usr/include/boost/property_tree/ptree.hpp:21,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:42,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/mpl/begin_end_fwd.hpp:22:38: note:   ‘boost::mpl::begin’
 template< typename Sequence > struct begin;
                                      ^
In file included from /usr/include/boost/assign/list_inserter.hpp:22:0,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:119:10: error: ‘right’ was not declared in this scope
   return right;
          ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:119:10: note: suggested alternative:
In file included from /usr/include/c++/5/ios:42:0,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iterator:64,
                 from /usr/include/boost/detail/iterator.hpp:11,
                 from /usr/include/boost/iterator/iterator_traits.hpp:8,
                 from /usr/include/boost/range/mutable_iterator.hpp:23,
                 from /usr/include/boost/range/iterator.hpp:20,
                 from /usr/include/boost/range/begin.hpp:24,
                 from /usr/include/boost/assign/list_inserter.hpp:22,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/c++/5/bits/ios_base.h:1007:3: note:   ‘std::right’
   right(ios_base& __base)
   ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:6: error: ‘left’ was not declared in this scope
  if (left - begin >= end - right)
      ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:6: note: suggested alternative:
In file included from /usr/include/c++/5/ios:42:0,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iterator:64,
                 from /usr/include/boost/detail/iterator.hpp:11,
                 from /usr/include/boost/iterator/iterator_traits.hpp:8,
                 from /usr/include/boost/range/mutable_iterator.hpp:23,
                 from /usr/include/boost/range/iterator.hpp:20,
                 from /usr/include/boost/range/begin.hpp:24,
                 from /usr/include/boost/assign/list_inserter.hpp:22,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/c++/5/bits/ios_base.h:999:3: note:   ‘std::left’
   left(ios_base& __base)
   ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:13: error: ‘begin’ was not declared in this scope
  if (left - begin >= end - right)
             ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:13: note: suggested alternatives:
In file included from /usr/include/boost/assign/list_inserter.hpp:22:0,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/aux_/at_impl.hpp:17,
                 from /usr/include/boost/mpl/at.hpp:18,
                 from /usr/include/boost/multi_index_container.hpp:24,
                 from /usr/include/boost/property_tree/ptree.hpp:21,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:42,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/mpl/begin_end_fwd.hpp:22:38: note:   ‘boost::mpl::begin’
 template< typename Sequence > struct begin;
                                      ^
In file included from /usr/include/boost/assign/list_inserter.hpp:22:0,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:22: error: ‘end’ was not declared in this scope
  if (left - begin >= end - right)
                      ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:22: note: suggested alternatives:
In file included from /usr/include/boost/assign/list_inserter.hpp:23:0,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/aux_/at_impl.hpp:17,
                 from /usr/include/boost/mpl/at.hpp:18,
                 from /usr/include/boost/multi_index_container.hpp:24,
                 from /usr/include/boost/property_tree/ptree.hpp:21,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:42,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/mpl/begin_end_fwd.hpp:23:38: note:   ‘boost::mpl::end’
 template< typename Sequence > struct end;
                                      ^
In file included from /usr/include/boost/assign/list_inserter.hpp:23:0,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:52:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:28: error: ‘right’ was not declared in this scope
  if (left - begin >= end - right)
                            ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/utility/functional.h:123:28: note: suggested alternative:
In file included from /usr/include/c++/5/ios:42:0,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iterator:64,
                 from /usr/include/boost/detail/iterator.hpp:11,
                 from /usr/include/boost/iterator/iterator_traits.hpp:8,
                 from /usr/include/boost/range/mutable_iterator.hpp:23,
                 from /usr/include/boost/range/iterator.hpp:20,
                 from /usr/include/boost/range/begin.hpp:24,
                 from /usr/include/boost/assign/list_inserter.hpp:22,
                 from /usr/include/boost/assign/std/vector.hpp:18,
                 from /usr/include/boost/assign/std.hpp:18,
                 from /usr/include/boost/assign.hpp:19,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/include/shark/Core/Shark.h:40,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/DLLSupport.h:39,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:45,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/usr/include/c++/5/bits/ios_base.h:1007:3: note:   ‘std::right’
   right(ios_base& __base)
   ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:55:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Shape.h: At global scope:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Shape.h:71:29: error: expected ‘)’ before ‘<’ token
  Shape(std::initializer_list<std::size_t> dims): m_dims(dims){
                             ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:954:17: error: expected ‘}’ before end of line
  SHARK_PARALLEL_FOR(int i = 0; i < batches; ++i)
                 ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:55:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Shape.h: In constructor ‘shark::Shape::Shape()’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Shape.h:69:11: error: class ‘shark::Shape’ does not have any field named ‘m_numElements’
  Shape(): m_numElements(1){}
           ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Shape.h: In constructor ‘shark::Shape::Shape(std::size_t)’:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Shape.h:70:27: error: class ‘shark::Shape’ does not have any field named ‘m_dims’
  Shape(std::size_t size): m_dims(1,size), m_numElements(size){}
                           ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Core/Shape.h:70:43: error: class ‘shark::Shape’ does not have any field named ‘m_numElements’
  Shape(std::size_t size): m_dims(1,size), m_numElements(size){}
                                           ^
In file included from /home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Csv.h:46:0,
                 from /home/gpuhuawei/sxue/Shark-4.0/Shark/build/examples/Supervised/RFTutorial.cpp:38:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h: At global scope:
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:954:17: error: expected unqualified-id before end of line
  SHARK_PARALLEL_FOR(int i = 0; i < batches; ++i)
                 ^
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:954:17: error: expected ‘}’ before end of line
/home/gpuhuawei/sxue/Shark-4.0/Shark/include/shark/Data/Dataset.h:954:17: error: expected declaration before end of line
CMakeFiles/RFtrain.dir/build.make:62: recipe for target 'CMakeFiles/RFtrain.dir/RFTutorial.cpp.o' failed
make[2]: *** [CMakeFiles/RFtrain.dir/RFTutorial.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RFtrain.dir/all' failed
make[1]: *** [CMakeFiles/RFtrain.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
yenhongcheah commented 3 years ago

I think i have the similar problem with u, did u solve your error?