bcc: Broken build using v0.9.0 release tar

BCC can not be build on an Arch Linux 4.20.14 system using the v0.9.0 release tar from GitHub. However, it can be build using the git repository and checking out the v0.9.0 tag. I successfully reproduced the error on another Arch machine with a different configuration. Hence, I do not think the problem is device specific. Furthermore, the previous version v0.8.0 builds fine.

I used the following commands for building

mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make

and got the following error message

bcc-0.9.0/src/cc/libbpf.c:54:10: fatal error: libbpf/src/bpf.h: No such file or directory
 #include "libbpf/src/bpf.h"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/cc/CMakeFiles/bpf-shared.dir/build.make:63: src/cc/CMakeFiles/bpf-shared.dir/libbpf.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:163: src/cc/CMakeFiles/bpf-shared.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

To be honest I am a little bit confused as to what might be the cause of the error. It might very well just me doing something wrong. Any help would be greatly appreciated.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 1
  • Comments: 25 (4 by maintainers)

Commits related to this issue

Most upvoted comments

If it’s “just another dependency” then libbpf also should have proper releases.

Thanks @Edenhofer @r4f4

So hard to solve upstream…

For now I manually check which libbpf commit is referenced in the release, downloaded it and move it to the right location. See the Arch Linux PKGBUILD. It should be pretty self-explanatory since it is plain shell code.

Good point, I will propose and tag libbpf properly. How about tag name “bcc_release_<release_num>”?

We have the following at bcc/CMakeLists.txt:

# populate submodules (libbpf)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src)
  execute_process(COMMAND git submodule update --init --recursive
                  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

Could you help check why git submodule not running?