Open gitcoder6 opened 1 year ago
I encounter the same issue on a new OpenSuse Tumbleweed installation
I noticed that I can replace llvm16 with llvm14:
sudo zypper install llvm14 llvm14-devel
However, doing so will lead to different errors:
CMake Error at CMakeLists.txt:169 (message):
Unable to find clang libraries
Maybe you can refer this: https://gitlab.archlinux.org/archlinux/packaging/packages/bcc/-/blob/main/PKGBUILD
export CFLAGS+=" -ffat-lto-objects"
export CXXFLAGS+=" -ffat-lto-objects"
cmake .. -DENABLE_LLVM_SHARED=1
Works for me on Arch Linux
EDIT:
I think the key point is -DENABLE_LLVM_SHARED=1
https://github.com/iovisor/bcc/pull/4232 https://github.com/iovisor/bcc/issues/3333 https://github.com/iovisor/bcc/issues/1181
Calling cmake
with -DENABLE_LLVM_SHARED=1
fixed the build in Arch Linux for me.
I started to simply edit INSTALL.md
and suggest that all Arch Linux users should use -DENABLE_LLVM_SHARED=1
, but I can't shake the feeling that this is just a hack. We should fix the actual root of the build problem, not avoid it, especially for distributions with newer LLVM versions; that is, instead of giving up and linking the shared library version, we should fix the bug which is causing LLVM to not be able to link statically.
After a bit of research, it seems that most major distributions (e.g. Arch, Debian (+Ubuntu), only provide the shared (e.g. libLLVM-15.so
) library.
If that's the case, why does BCC default ENABLE_LLVM_SHARED
to false? Don't want to tear down a Chesterton fence here.
Hi,
I am new here. When to compile bcc from source in my sles VM, I got a line at the first step.
-- Found LLVM: /usr/include 13.0.1 (Use LLVM_ROOT envronment variable for another version of LLVM) -- Could NOT find LibDebuginfod (missing: LIBDEBUGINFOD_LIBRARIES LIBDEBUGINFOD_INCLUDE_DIRS) CMake Error at /usr/lib64/cmake/llvm/LLVM-Config.cmake:311 (message): unknown component LLVMBitWriter Call Stack (most recent call first): /usr/lib64/cmake/llvm/LLVM-Config.cmake:333 (expand_topologically) cmake/clang_libs.cmake:33 (llvm_expand_dependencies) src/cc/CMakeLists.txt:132 (include)
-- Configuring incomplete, errors occurred! See also "/root/bcc/build/CMakeFiles/CMakeOutput.log".
I googled a lot without any info.
From other mails, I think i can ignore LibDebuginfod msg, but probably "LLVMBitWriter" is making it fail. Kindly help me resolving this error.