Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm dependencies in ebpf backend can cause cmake problems. #1376

Closed
ChrisDodd opened this issue Jun 28, 2018 · 4 comments
Closed

llvm dependencies in ebpf backend can cause cmake problems. #1376

ChrisDodd opened this issue Jun 28, 2018 · 4 comments
Labels
fixed This topic is considered to be fixed. question This is a topic requesting clarification.

Comments

@ChrisDodd
Copy link
Contributor

Pulling the latest p4c, when I run cmake I get some errors:

CMake Warning at p4c/backends/ebpf/CMakeLists.txt:107 (MESSAGE):
  Kernel version 4.10.0 too small, expected 4.16.0.  Ignoring ebpf kernel
  tests...

CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:178 (include):
  include could not find load file:

    /usr/share/llvm/cmake/LLVMExports.cmake
Call Stack (most recent call first):
  p4c/backends/ebpf/CMakeLists.txt:114 (find_package)

CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:181 (include):
  include could not find load file:

    /usr/share/llvm/cmake/LLVM-Config.cmake
Call Stack (most recent call first):
  p4c/backends/ebpf/CMakeLists.txt:114 (find_package)

If I comment out the find_package(LLVM) line in that last cmake file, everything configures, but some stuff is disabled.

The README.md file just says that llvm 3.7.1 or later is required. Is the problem llvm 3.8?

@antoninbas
Copy link
Member

antoninbas commented Jun 28, 2018

I had the same issue, I had to run cmake with -DENABLE_EBPF to get rid of it.

@mihaibudiu
Copy link
Contributor

This seems to be a bug in the llvm package for some ubuntu versions. The makefile has a link to a stackoverflow post describing a fix. It would be nice if the find-package would not crash and would just return false...

@mihaibudiu mihaibudiu added the question This is a topic requesting clarification. label Jun 28, 2018
@mihaibudiu
Copy link
Contributor

Here is the link describing the problem and the solution:
https://stackoverflow.com/questions/38171543/error-when-using-cmake-with-llvm
It is in a pending PR.
I am not sure what to do about it in the makefile.

@fruffy
Copy link
Collaborator

fruffy commented Jul 8, 2018

BCC seems to have a similar problem. This issue discusses several more workarounds:
iovisor/bcc#492

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed This topic is considered to be fixed. question This is a topic requesting clarification.
Projects
None yet
Development

No branches or pull requests

4 participants