bcc: Could NOT find LibDebuginfod

Hi,

I am new here. When to compile bcc from source in ubuntu 20.04, I got a line at the first step. Could NOT find LibDebuginfod (missing: LIBDEBUGINFOD_LIBRARIES LIBDEBUGINFOD_INCLUDE_DIRS)

But I googled a lot without any info.

Please help. Which package includes this lib? Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 13
  • Comments: 26 (2 by maintainers)

Most upvoted comments

solved by : sudo apt-get install libclang-10-dev

Need to install the clang dev package.

sudo apt install libdebuginfod-dev

This does not work.

I had a similar problem:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

// https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---source
$ git clone https://github.com/iovisor/bcc.git
$ mkdir bcc/build; cd bcc/build
$ cmake ..            
...                                                                                                                                                       
Latest recognized Git tag is v0.23.0                                                                                                                                                               -- Git HEAD is 3e8eb8b62f6e92aef332b2eab48305220705dfae
-- Revision is 0.23.0-3e8eb8b6
-- Found LLVM: /usr/lib/llvm-10/include 10.0.0 (Use LLVM_ROOT envronment variable for another version of LLVM)                                                                                        
-- Could NOT find LibDebuginfod (missing: LIBDEBUGINFOD_LIBRARIES LIBDEBUGINFOD_INCLUDE_DIRS)
CMake Error at CMakeLists.txt:110 (message):
  Unable to find clang libraries

-- Configuring incomplete, errors occurred!

But, it was solved by setting LLVM_ROOT=/usr/lib/llvm-7 environment variable:

$ export LLVM_ROOT=/usr/lib/llvm-7
$ cmake ..
...
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.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.23.0
-- Git HEAD is 3e8eb8b62f6e92aef332b2eab48305220705dfae
-- Revision is 0.23.0-3e8eb8b6
-- Performing Test HAVE_NO_PIE_FLAG
-- Performing Test HAVE_NO_PIE_FLAG - Success
-- Performing Test HAVE_REALLOCARRAY_SUPPORT
-- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success
-- Found LLVM: /usr/lib/llvm-7/include 7.0.1 (Use LLVM_ROOT envronment variable for another version of LLVM)
-- Found BISON: /usr/bin/bison (found version "3.5.1")
-- 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
-- Could NOT find LibDebuginfod (missing: LIBDEBUGINFOD_LIBRARIES LIBDEBUGINFOD_INCLUDE_DIRS)
-- Using static-libstdc++
-- Could NOT find LuaJIT (missing: LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
CMake Warning at tests/python/CMakeLists.txt:6 (message):
  Recommended test program 'arping' not found

CMake Warning at tests/python/CMakeLists.txt:10 (message):
  Recommended test program 'netperf' not found

CMake Warning at tests/python/CMakeLists.txt:16 (message):
  Recommended test program 'iperf' or 'iperf3' not found

-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/bcc/build

I solved the problem by following the instruction from https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---source

╰─➤  lsb_release -a                                                                             
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal

╰─➤  sudo apt install -y bison build-essential cmake flex git libedit-dev \
  libllvm7 llvm-7-dev libclang-7-dev python zlib1g-dev libelf-dev libfl-dev python3-distutils

╰─➤  rm build -rf  
╰─➤  cmake -H. -Bbuild                                                     
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.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.23.0
-- Git HEAD is 67f59ee80fcf5deedaacba1436d9fa09d32a16a0
-- Revision is 0.23.0-67f59ee8
-- Performing Test HAVE_NO_PIE_FLAG
-- Performing Test HAVE_NO_PIE_FLAG - Success
-- Performing Test HAVE_REALLOCARRAY_SUPPORT
-- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success
-- Found LLVM: /usr/lib/llvm-7/include 7.0.1
-- Found BISON: /usr/bin/bison (found version "3.5.1") 
-- 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
-- Could NOT find LibDebuginfod (missing: LIBDEBUGINFOD_LIBRARIES LIBDEBUGINFOD_INCLUDE_DIRS) 
-- Using static-libstdc++
-- Could NOT find LuaJIT (missing: LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR) 
CMake Warning at tests/python/CMakeLists.txt:6 (message):
  Recommended test program 'arping' not found


CMake Warning at tests/python/CMakeLists.txt:10 (message):
  Recommended test program 'netperf' not found


CMake Warning at tests/python/CMakeLists.txt:16 (message):
  Recommended test program 'iperf' or 'iperf3' not found


-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/sbin/bcc/build

I fix this issue by using different llvm version at cmake.

cmake … -DCMAKE_PREFIX_PATH=/usr/lib/llvm-12

I had a similar issue on Ubuntu 18.04. Botch clang 9.0 and 6.0 were installed. I removed 6.0 and was able to compile bcc.

I have both llvm10 and llvm12 on Ubuntu 20.04. Uninstall llvm10 solve the problem.

sudo apt remove llvm-10-dev
sudo apt remove libllvm10

https://github.com/iovisor/bcc/pull/3393

Maybe you need elfutils installed.

sudo apt install libdebuginfod-dev

Checkout to a stable commit or tag like:

git checkout v0.24.0