martinus / map_benchmark

Comprehensive benchmarks of C++ maps
MIT License
299 stars 29 forks source link

Folly linking errors during building map_benchmark #6

Closed Eslam-Samir closed 5 years ago

Eslam-Samir commented 5 years ago

Hello, I'm trying to build map_benchmark. I installed all of the dependencies and folly library, but the build fails at linking folly related files. I tried ninja and make but they are both giving the same errors. This is ninja error during build:

Linking CXX executable bench_folly_F14NodeMap__folly_hasher
FAILED: bench_folly_F14NodeMap__folly_hasher 
: && /usr/bin/g++-8    -fuse-ld=gold   -rdynamic CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/app/getRSS.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/app/main.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/CtorDtor.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/Insert.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/Iterate.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/RandomDistinct.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/RandomFind.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/RandomInsertErase.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/RandomInsertEraseStrings.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/ShowHash.cpp.o CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/Strings.cpp.o  -o bench_folly_F14NodeMap__folly_hasher  external/facebook__folly/libfolly.a external/facebook__folly/libfolly.a -pthread -lboost_context -lboost_chrono -lboost_date_time -lboost_filesystem -lboost_program_options -lboost_regex -lboost_system -lboost_thread -lboost_atomic -lpthread -ldouble-conversion /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.1 -lpthread -lglog -levent -lssl -lcrypto -lz -llzma -llz4 -lzstd -lsnappy -ldwarf -Wl,-Bstatic -liberty -Wl,-Bdynamic -ldl -lunwind && :
CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/CtorDtor.cpp.o:CtorDtor.cpp:function folly::f14::detail::F14Table<folly::f14::detail::NodeContainerPolicy<int, int, folly::hasher<int, void>, void, void> >::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::{lambda()#1}::operator()() const: error: undefined reference to 'folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()'
CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/Iterate.cpp.o:Iterate.cpp:function folly::f14::detail::F14Table<folly::f14::detail::NodeContainerPolicy<unsigned long, unsigned long, folly::hasher<unsigned long, void>, void, void> >::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::{lambda()#1}::operator()() const: error: undefined reference to 'folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()'
CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/RandomInsertEraseStrings.cpp.o:RandomInsertEraseStrings.cpp:function folly::f14::detail::F14Table<folly::f14::detail::NodeContainerPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, folly::hasher<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void>, void, void> >::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::{lambda()#1}::operator()() const: error: undefined reference to 'folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()'
collect2: error: ld returned 1 exit status
[478/506] Building CXX object external/facebook__folly/folly/CMakeFiles/follybenchmark.dir/Benchmark.cpp.o
ninja: build stopped: subcommand failed.

This is make errors during build:

CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/CtorDtor.cpp.o:CtorDtor.cpp:function folly::f14::detail::F14Table<folly::f14::detail::NodeContainerPolicy<int, int, folly::hasher<int, void>, void, void> >::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::{lambda()#1}::operator()() const: error: undefined reference to 'folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()'
CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/Iterate.cpp.o:Iterate.cpp:function folly::f14::detail::F14Table<folly::f14::detail::NodeContainerPolicy<unsigned long, unsigned long, folly::hasher<unsigned long, void>, void, void> >::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::{lambda()#1}::operator()() const: error: undefined reference to 'folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()'
CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/src/benchmarks/RandomInsertEraseStrings.cpp.o:RandomInsertEraseStrings.cpp:function folly::f14::detail::F14Table<folly::f14::detail::NodeContainerPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, folly::hasher<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void>, void, void> >::rehashImpl(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)::{lambda()#1}::operator()() const: error: undefined reference to 'folly::f14::detail::F14LinkCheck<(folly::f14::detail::F14IntrinsicsMode)1>::check()'
collect2: error: ld returned 1 exit status
CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/build.make:380: recipe for target 'bench_folly_F14NodeMap__folly_hasher' failed
make[2]: *** [bench_folly_F14NodeMap__folly_hasher] Error 1
CMakeFiles/Makefile2:189: recipe for target 'CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/all' failed
make[1]: *** [CMakeFiles/bench_folly_F14NodeMap__folly_hasher.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
martinus commented 5 years ago

I had to try it, and you are right. My build instructions were out of date. The issue was that folly needs to be built with Release mode, I've now updated the README.md with an up to date description

Eslam-Samir commented 5 years ago

I tried again and it passed. Thanks alot for your help.

On Sat, Mar 30, 2019 at 11:33 PM Martin Ankerl notifications@github.com wrote:

I had to try it, and you are right. My build instructions were out of date. The issue was that folly needs to be built with Release mode, I've now updated the README.md with an up to date description

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/martinus/map_benchmark/issues/6#issuecomment-478291140, or mute the thread https://github.com/notifications/unsubscribe-auth/AKpYhw-ffFp3pH7cZ_nPaxVTAshvOwcRks5vb9gsgaJpZM4cSO3w .