Closed lifengxiang1025 closed 1 year ago
When I run: bazel run --config=opt fleetbench/tcmalloc:empirical_driver --config=clang. It causes error like
bazel run --config=opt fleetbench/tcmalloc:empirical_driver --config=clang
ld.lld:_ error: undefined symbol: std::filesystem::cxx11::directory_iterator::directory_iterator(std::filesystem::cxx11::path const&, std::filesystem::directory_options, std::error_code*) >>> referenced by common.cc >>> bazel-out/k8-opt-clang/bin/fleetbench/common/_objs/common/common.o:(fleetbench::GetMatchingFiles[abi:cxx11](std::basic_string_view<char, std::char_traits>, std::basic_string_view<char, `std::char_traits>))
It seems to need to add ldflags -lstdc++fs
-lstdc++fs
You likely need to install a more recent version of clang. Fleetbench recommends LLVM 14 or higher.
When I run:
bazel run --config=opt fleetbench/tcmalloc:empirical_driver --config=clang
. It causes error likeld.lld:_ error: undefined symbol: std::filesystem::cxx11::directory_iterator::directory_iterator(std::filesystem::cxx11::path const&, std::filesystem::directory_options, std::error_code*) >>> referenced by common.cc >>> bazel-out/k8-opt-clang/bin/fleetbench/common/_objs/common/common.o:(fleetbench::GetMatchingFiles[abi:cxx11](std::basic_string_view<char, std::char_traits>, std::basic_string_view<char, `std::char_traits>))
It seems to need to add ldflags
-lstdc++fs