Unable to install bcc on Ubuntu 22.04

95 Views Asked by At

I am new to eBPF and setting up environment for learning. While installing bcc from source, getting the following error while running make command .

/usr/bin/ld: cannot find -lclangFrontend: No such file or directory
/usr/bin/ld: cannot find -lclangSerialization: No such file or directory
/usr/bin/ld: cannot find -lclangDriver: No such file or directory
/usr/bin/ld: cannot find -lclangASTMatchers: No such file or directory
/usr/bin/ld: cannot find -lclangParse: No such file or directory
/usr/bin/ld: cannot find -lclangSema: No such file or directory
/usr/bin/ld: cannot find -lclangCodeGen: No such file or directory
/usr/bin/ld: cannot find -lclangAnalysis: No such file or directory
/usr/bin/ld: cannot find -lclangRewrite: No such file or directory
/usr/bin/ld: cannot find -lclangEdit: No such file or directory
/usr/bin/ld: cannot find -lclangAST: No such file or directory
/usr/bin/ld: cannot find -lclangLex: No such file or directory
/usr/bin/ld: cannot find -lclangBasic: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [src/cc/CMakeFiles/bcc-shared.dir/build.make:440: src/cc/libbcc.so.0.29.1] Error 1
make[1]: *** [CMakeFiles/Makefile2:753: src/cc/CMakeFiles/bcc-shared.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I believe I installed all the required dependencies.

root@ubuntu:~# apt install -y bison build-essential cmake flex git libedit-dev \
libllvm14 llvm-14-dev libclang-14-dev python3 zlib1g-dev libelf-dev libfl-dev python3-distutils

the clang version seems to be coming correctly.

root@ip-172-31-16-64:/opt/bcc/build# clang --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Any insights will surely help me.

Thank you in advance!

0

There are 0 best solutions below