bcc installation from the source fails at Ubuntu 24.04.2, LLVM 19.
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
I'm currently experiencing a problem installing the `bcc` package, as the installation guide (https://github.com/iovisor/bcc/blob/master/INSTALL.md#libbpf-submodule) suggests.
Here is the context of my environment.
- Software environment
- OS: Ubuntu 24.04.2 LTS x86_64
- Kernel: 6.11.0-28-generic
- cmake version: 3.28.3 (required >= 3.1)
- GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 (required >= 4.7)
- flex* version: 2.6.4
- bison* version: (GNU Bison) 3.8.2
- LLVM version: 19
- *: In my memory, I haven't manually installed them. I think they were already installed basically...? (Not sure about those two packages.)
- Procedures I tried to install `bcc` on my computer
- Since my Ubuntu version is 24.04, according to the given installation guide, I installed the following required apt packages:
```bash
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
libllvm18 llvm-18-dev libclang-18-dev python3 zlib1g-dev libelf-dev libfl-dev python3-setuptools \
liblzma-dev libdebuginfod-dev arping netperf iperf libpolly-18-dev
```
- And I execute the following commands sequentially.
```bash
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake ..
make
```
- Especially, when I execute the `cmake ..` command, which is described right above, the cmake output is as follows:
```text
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Latest recognized Git tag is v0.35.0
-- Git HEAD is 2f3361c6fd361bc5e7424df21671d728e98d55c3
-- Revision is 0.35.0+2f3361c6 (major 0, minor 35, patch 0)
-- Performing Test HAVE_NO_PIE_FLAG
-- Performing Test HAVE_NO_PIE_FLAG - Success
-- Performing Test HAVE_REALLOCARRAY_SUPPORT
-- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success
-- Kernel release: 6.11.0-28-generic
-- Kernel headers: /usr/src/linux-headers-6.11.0-28-generic
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib/x86_64-linux-gnu/libffi.so
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Found LibEdit: /usr/include (found version "2.11")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3")
-- Found zstd: /usr/lib/x86_64-linux-gnu/libzstd.so
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.14")
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
-- Found LLVM: /usr/lib/llvm-19/include 19.1.7 (Use LLVM_ROOT envronment variable for another version of LLVM)
-- Found BISON: /usr/bin/bison (found version "3.8.2")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found LibElf: /usr/lib/x86_64-linux-gnu/libelf.so
-- Performing Test ELF_GETSHDRSTRNDX
-- Performing Test ELF_GETSHDRSTRNDX - Success
-- Found LibDebuginfod: /usr/lib/x86_64-linux-gnu/libdebuginfod.so
-- Found LibLzma: /usr/lib/x86_64-linux-gnu/liblzma.so
-- Using static-libstdc++
-- Could NOT find LuaJIT (missing: LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
-- Configuring done (1.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/paff/ghrepo/bcc/build
```
- When I hit `make`, it suddenly stops with the following error:
```text
... (abbreviated) ...
[ 18%] Building C object src/cc/CMakeFiles/bcc-shared.dir/bcc_proc.c.o
[ 18%] Building C object src/cc/CMakeFiles/bcc-shared.dir/bcc_zip.c.o
[ 18%] Building CXX object src/cc/CMakeFiles/bcc-shared.dir/common.cc.o
make[2]: *** No rule to make target '/usr/lib/llvm-19/lib/libPolly.a', needed by 'src/cc/libbcc.so.0.35.0'. Stop.
make[1]: *** [CMakeFiles/Makefile2:836: src/cc/CMakeFiles/bcc-shared.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
```
Even though I searched for other error cases related to the installation on Google or GitHub issues, to the best of my ability, I couldn't resolve the installation failure on my own, so I'm leaving an issue now to get some help.
Thanks in advance!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with INSTALL.md's Ubuntu 24.04 instructions and reproduce the failure using the reported CMake and make commands. Inspect the build configuration around LLVM and the missing /usr/lib/llvm-19/lib/libPolly.a; done means the documented source build completes successfully on the reported environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake, linux, ubuntu
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 40/100