Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking error with benchmark on Clang #594

Open
elshize opened this issue Dec 13, 2024 · 0 comments
Open

Linking error with benchmark on Clang #594

elshize opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@elshize
Copy link
Member

elshize commented Dec 13, 2024

CMake:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_TESTING=ON -DCMAKE_TOOLCHAIN_FILE=clang.cmake -DPISA_SANITIZERS=OFF -DPISA_BUILD_TOOLS=ON -DPISA_SYSTEM_GOOGLE_BENCHMARK=ON -DPISA_SYSTEM_BOOST=ON -DPISA_SYSTEM_GOOGLE_BENCHMARK=ON ..

Compiling:

/usr/lib64/ccache/clang++  -std=c++20 -stdlib=libc++ -march=native -Wall -Wextra -Wno-missing-braces -ggdb -fopenmp=libomp -O3 -DNDEBUG  -stdlib=libc++ -lc++abi -lc++ CMakeFiles/topk_queue_bench.dir/topk_queue_bench.cpp.o -o ../bin/topk_queue_bench  -Wl,-rpath,/home/elshize/dev/pisa/build/clang_19.1_cxx20_64_release ../libpisa.a /usr/lib64/libbenchmark_main.so.1.9.1 ../external/spdlog/libspdlog.a ../external/fmt/libfmt.a ../clang_19.1_cxx20_64_release/libtbb.so.12.10 ../external/FastPFor/libFastPFor.a ../external/libstreamvbyte.a ../external/libMaskedVByte.a ../external/libsimdcomp.a ../external/KrovetzStemmer/libKrovetzStemmer.a ../external/Porter2/libPorter2.a ../gumbo-parser/lib/libgumbo.a ../external/wapopp/libwapopp.a /usr/lib64/libbenchmark.so.1.9.1

Error:

/usr/bin/ld: CMakeFiles/topk_queue_bench.dir/topk_queue_bench.cpp.o: in function `benchmark::internal::FunctionBenchmark::FunctionBenchmark(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, void (*)(benchmark::State&))':
/usr/include/benchmark/benchmark.h:1444:(.text.startup+0x64): undefined reference to `benchmark::internal::Benchmark::Benchmark(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/bin/ld: CMakeFiles/topk_queue_bench.dir/topk_queue_bench.cpp.o: in function `_GLOBAL__sub_I_topk_queue_bench.cpp':
/home/elshize/dev/pisa/microbench/topk_queue_bench.cpp:80:(.text.startup+0xf9): undefined reference to `benchmark::internal::Benchmark::ArgNames(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)'
/usr/bin/ld: CMakeFiles/topk_queue_bench.dir/topk_queue_bench.cpp.o: in function `__cxx_global_var_init.2':
/home/elshize/dev/pisa/microbench/topk_queue_bench.cpp:81:(.text.startup+0x222): undefined reference to `benchmark::internal::Benchmark::ArgsProduct(std::__1::vector<std::__1::vector<long, std::__1::allocator<long> >, std::__1::allocator<std::__1::vector<long, std::__1::allocator<long> > > > const&)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
@elshize elshize added the bug Something isn't working label Dec 13, 2024
@elshize elshize changed the title Linking error with benchmark Linking error with benchmark on Clang Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant