LLVM Discussion Forums

LLVM build dependencies

Hi,

I’m trying to build the LLVM project and have a little trouble installing the package dependencies.

The build instructions online just show very little information. Once you run CMake you get a list of packages/libraries not found for features. But They don’t give you a propper name so you know which packages to install, and I couldn’t find a list anywhere.

So I was hoping to get one here. Since I don’t believe that I’m the only one who would like that list it would be nice to know what feature each package is needed for.

Btw I’m doing this in Ubuntu (19.10). I would like a list I can use later to create a docker image. It might also be a good idea if someone would e.g. add a shell script to the project that you can run to install the dependencies.

Regards

Thorsten

LLVM does not have much dependencies beyond a working C++14 toolchain (some minimal versions are documented). Without more info on the CMake failure it is hard to advise here.

Since you mention Docker, there are few DockerFiles in tree that may be helpful as a starting point:

https://github.com/llvm/llvm-project/tree/master/llvm/utils/docker
https://github.com/llvm/llvm-project/tree/master/libcxx/utils/docker/debian9
https://github.com/llvm/llvm-project/tree/master/libc/utils/buildbot

I will look at these DockerFiles.

I didn’t mean requirements. I’m not getting an error. But If you go through the configuration you get lot’s of lines like this:

-- Could NOT find LIBOMPTARGET_DEP_LIBFFI (missing: LIBOMPTARGET_DEP_LIBFFI_LIBRARIES LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIRS) 
-- Could NOT find LIBOMPTARGET_DEP_CUDA_DRIVER (missing: LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES) 
-- LIBOMPTARGET: Building offloading runtime library libomptarget.
-- LIBOMPTARGET: Not building aarch64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building CUDA offloading plugin: libelf dependency not found.
-- LIBOMPTARGET: Not building PPC64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building PPC64le offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building x86_64 offloading plugin: libelf dependency not found.
-- LIBOMPTARGET: Not building CUDA offloading device RTL: CUDA tools not found in the system.

Packages like libz3-dev and libxml2-dev are not mentioned in the guides.

Oh you’re building the OpenMP runtime library, I am not very knowledgeable about this. It is not unusual that such runtime library is looking on what is available on the system to enable/disable some of the functionality (for instance here CUDA support depends on CUDA being installed).
I never installed z3 myself, not that the doc states:

LLVM_ENABLE_Z3_SOLVER:BOOL
If enabled, the Z3 constraint solver is activated for the Clang static analyzer. A recent version of the z3 library needs to be available on the system.

LibXML is apparently only used for c-index-test and the option was added to disable the detection of it: https://reviews.llvm.org/D45234

As you can see you can ignore most of these in general.