hosseinmoein / DataFrame

C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
https://hosseinmoein.github.io/DataFrame/
BSD 3-Clause "New" or "Revised" License
2.41k stars 306 forks source link

Can't compile benchmark #214

Closed rm-minus-r-star closed 1 year ago

rm-minus-r-star commented 1 year ago

System:

Added to benchmarks/CMakeLists.txt:

project(cpp_dataframe_performance) set(CMAKE_CXX_STANDARD 17)

me@Dunkel:~/.../DataFrame/benchmarks$ mkdir build
me@Dunkel:~/.../DataFrame/benchmarks$ cd build/
me@Dunkel:~/.../DataFrame/benchmarks/build$ cmake ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /.../DataFrame/benchmarks/build
me@Dunkel:~/.../DataFrame/benchmarks/build$ make
Scanning dependencies of target dataframe_performance_2
[ 25%] Building CXX object CMakeFiles/dataframe_performance_2.dir/dataframe_performance_2.cc.o
[ 50%] Linking CXX executable dataframe_performance_2
/usr/bin/ld: CMakeFiles/dataframe_performance_2.dir/dataframe_performance_2.cc.o: in function `std::thread::thread<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>& (hmdf::DataFrame<unsigned int, hmdf::HeteroVector>::*)(char const*, hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>&, bool), hmdf::DataFrame<unsigned int, hmdf::HeteroVector>*, char const*, std::reference_wrapper<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int> >, bool> >, hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>&>::_Async_state_impl(std::thread::_Invoker<std::tuple<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>& (hmdf::DataFrame<unsigned int, hmdf::HeteroVector>::*)(char const*, hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>&, bool), hmdf::DataFrame<unsigned int, hmdf::HeteroVector>*, char const*, std::reference_wrapper<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int> >, bool> >&&)::{lambda()#1}, , void>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>& (hmdf::DataFrame<unsigned int, hmdf::HeteroVector>::*)(char const*, hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>&, bool), hmdf::DataFrame<unsigned int, hmdf::HeteroVector>*, char const*, std::reference_wrapper<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int> >, bool> >, hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>&>::_Async_state_impl(std::thread::_Invoker<std::tuple<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>& (hmdf::DataFrame<unsigned int, hmdf::HeteroVector>::*)(char const*, hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int>&, bool), hmdf::DataFrame<unsigned int, hmdf::HeteroVector>*, char const*, std::reference_wrapper<hmdf::ExponentiallyWeightedMeanVisitor<double, unsigned int> >, bool> >&&)::{lambda()#1}&&)':
dataframe_performance_2.cc:(.text._ZNSt6threadC2IZNSt13__future_base17_Async_state_implINS_8_InvokerISt5tupleIJMN4hmdf9DataFrameIjNS5_12HeteroVectorEEEFRNS5_32ExponentiallyWeightedMeanVisitorIdjEEPKcSB_bEPS8_SD_St17reference_wrapperISA_EbEEEESB_EC4EOSK_EUlvE_JEvEEOT_DpOT0_[_ZNSt6threadC5IZNSt13__future_base17_Async_state_implINS_8_InvokerISt5tupleIJMN4hmdf9DataFrameIjNS5_12HeteroVectorEEEFRNS5_32ExponentiallyWeightedMeanVisitorIdjEEPKcSB_bEPS8_SD_St17reference_wrapperISA_EbEEEESB_EC4EOSK_EUlvE_JEvEEOT_DpOT0_]+0x33): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/dataframe_performance_2.dir/build.make:84: dataframe_performance_2] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/dataframe_performance_2.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
hosseinmoein commented 1 year ago

I am not sure how you are compiling this. But the thread library is specified in the root CMakeLists.txt file. Please follow the cmake build instructions in README which is -- starting from root repo directory

mkdir [Debug | Release]
cd [Debug | Release]
cmake -DCMAKE_BUILD_TYPE=[Debug | Release] -DHMDF_BENCHMARKS=1 -DHMDF_EXAMPLES=1 -DHMDF_TESTING=1 ..
make
rm-minus-r-star commented 1 year ago

Yup, -DHMDF_BENCHMARKS=1 -DHMDF_EXAMPLES=1 -DHMDF_TESTING=1 .. makes all the difference in following the README. It wasn't there before, so I went down the path of trying to cmake/make them manually.

make on release compiles everything successfully.

make on Debug goes fine until

Scanning dependencies of target gen_rand_tester [ 82%] Building CXX object test/CMakeFiles/gen_rand_tester.dir/gen_rand_tester.cc.o [ 85%] Linking CXX executable ../bin/gen_rand_tester [ 85%] Built target gen_rand_tester make[2]: No rule to make target '../examples/data/DT_AAPL.csv', needed by 'bin/data/DT_AAPL.csv'. Stop. make[1]: [CMakeFiles/Makefile2:907: examples/CMakeFiles/hmdf_copy_DT_AAPL.csv.dir/all] Error 2 make: *** [Makefile:141: all] Error 2

hosseinmoein commented 1 year ago

I cannot reproduce that. It is trying to build a data file which is very strange. Did you start from a clean directory?