-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Building from source fails on Debian Stretch #2272
Comments
This is triggered by src/cmake/FindCompilerFlag.cmake
If the compilation failed, it should set HAVE_REALLOCARRAY_SUPPORT to FALSE and cmake should proceed. Could you help check why this is not the case? |
I found that this was failing because the build scripts couldn't find the clang libraries. Starting with a clean working directory, I deleted I deleted diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94aac856..fc66b5d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,7 @@ find_package(LibElf REQUIRED)
# clang is linked as a library, but the library path searching is
# primitively supported, unlike libLLVM
-set(CLANG_SEARCH "/opt/local/llvm/lib;/usr/lib/llvm-3.7/lib;${LLVM_LIBRARY_DIRS}")
+set(CLANG_SEARCH "/opt/local/llvm/lib;/usr/lib/llvm-3.7/lib;/usr/lib/llvm-3.8/lib;/usr/lib/llvm-3.9/lib;${LLVM_LIBRARY_DIRS}")
find_library(libclangAnalysis NAMES clangAnalysis HINTS ${CLANG_SEARCH})
find_library(libclangAST NAMES clangAST HINTS ${CLANG_SEARCH})
find_library(libclangBasic NAMES clangBasic HINTS ${CLANG_SEARCH}) On Debian stretch, clang-3.7 is not available for installation, but clang-3.8 and clang-3.9 are. Their library directories are as shown above. I don't know how execution order in cmake works, but it seems the change I made further down in CMakeLists.txt fixes the issue I ran into in cmake/FindCompilerFlag.cmake, which was included earlier. The full build process, |
I fixed my problem with include directories. My system already had llvm-3.8-dev, libclang-3.9-dev, and llvm-3.9-dev installed, but not libclang-3.9-dev. Edit: For posterity, |
I am running "testing". Whereas I was able to build binaries with cmake/make, |
@ymartin59 could you submit a patch for this? Thanks! |
Still on testing and discovered that Debian package is named |
I had a similar problem of clang not being found. My problem was due to several llvm installations. Turns out that there some problems with aptitude version of LLVM versions >= 10 which I honestly do not understand, but for example see this and this so I'll leave my solution in case anyone needs it. Running on
You can either build the whole llvm suite with versions >= 10 from source, or the simpler way out is to use the packages specified in INSTALL.md:
Then, modify the
This solved the issue for me, hopefully other will find it useful. |
By my side I have follow the install.md with llvm 14 without happen any errors on my Ubuntu |
From my side I am running e.g. |
I tried building bcc from source per the instructions in INSTALL.md, but I got the error below.
The text was updated successfully, but these errors were encountered: