iovisor / iovisor/bcc

BCC source setup make error on Debian Bookworm

Open
#5,015 6 comments 6 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

I'm trying to compile BCC from source in a debian bookworm container (specs listed below) on my Ubuntu Jammy system.

It compiles perfectly on my Ubuntu system, however, when I followed the setup steps on Debian (configuring sid, downloading the build tools) I was faced with a make error when running `make` in the bcc/build directory. It threw the following error:
`
make[2]: *** No rule to make target '/usr/lib/llvm-16/lib/libPolly.a', needed by 'src/cc/libbcc.so.0.30.0'. Stop.
make[1]: *** [CMakeFiles/Makefile2:780: src/cc/CMakeFiles/bcc-shared.dir/all] Error 2
`
At around 20% on the first time I ran the command and 14% on subsequent runs. The Makefile seems to be missing a rule to build a the /usr/lib/llvm-16/lib/libPolly.a file while trying to build CXX object src/cc/CMakeFiles/bcc-shared.dir/common.cc.o

To simply test and hack a solution, I created an empty /usr/lib/llvm-16/lib/libPolly.a file and kept on going with the build process. Right, after, I received another error:
`
make[2]: *** No rule to make target '/usr/lib/llvm-16/lib/libPollyISL.a', needed by 'src/cc/libbcc.so.0.30.0'. Stop.
make[1]: *** [CMakeFiles/Makefile2:780: src/cc/CMakeFiles/bcc-shared.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
`
![image](https://github.com/iovisor/bcc/assets/43936294/d92dcc77-2920-4e0b-aaed-7c813db98d50)

I touched and created another empty file by the name of '/usr/lib/llvm-16/lib/libPollyISL.a' to keep on going ahead with the build process. I'm then faced with another error (as expected) at around 38%:
![image](https://github.com/iovisor/bcc/assets/43936294/b4e4aafa-8733-4293-954f-b4f3dc3433a2)
Here's the trace:
``
/usr/bin/ld: /usr/lib/llvm-16/lib/libclangCodeGen.a(BackendUtil.cpp.o): in function `(anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr >&, std::unique_ptr >&)':
(.text._ZN12_GLOBAL__N_118EmitAssemblyHelper23RunOptimizationPipelineEN5clang13BackendActionERSt10unique_ptrIN4llvm17raw_pwrite_streamESt14default_deleteIS5_EERS3_INS4_14ToolOutputFileES6_ISA_EE+0x14ad): undefined reference to `getPollyPluginInfo()'
/usr/bin/ld: /usr/lib/llvm-16/lib/libLLVMLTO.a(LTOBackend.cpp.o): in function `llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector > const&)':
(.text._ZN4llvm3lto3optERKNS0_6ConfigEPNS_13TargetMachineEjRNS_6ModuleEbPNS_18ModuleSummaryIndexEPKS8_RKSt6vectorIhSaIhEE+0x8e5): undefined reference to `getPollyPluginInfo()'
/usr/bin/ld: /usr/lib/llvm-16/lib/libLLVMExtensions.a(Extensions.cpp.o): in function `llvm::details::extensions_anchor()':
(.text._ZN4llvm7details17extensions_anchorEv+0x1a): undefined reference to `getPollyPluginInfo()'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/cpp/CMakeFiles/CGroupTest.dir/build.make:184: examples/cpp/CGroupTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:1127: examples/cpp/CMakeFiles/CGroupTest.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
``

Could someone please help me fix this problem as I need to build this tool in Debian to test it out on a machine that runs on Debian. Let me know if more information is required. Here are the specs of my image:
![image](https://github.com/iovisor/bcc/assets/43936294/e6b84490-52cf-456c-85ed-93f7ce8d9eca)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.