Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When you build llvm from source, how do you install it to your system?

When reading through this:

https://www.llvm.org/docs/CMake.html

It tells you how to install to a target, but it doesn't tell you how to install to the system.

cmake --build . --target install

I am not sure what the target is in this case, nor how to properly configure it so it appears as a standard installation into my ubuntu system, insofar as it would be functionally the same as if I installed the development debian packages, and have it picked up by any other build looking to see if the libraries are installed.

Hence, how do I install all the projects under the llvm suite, from source, into Linux?

like image 517
Anon Avatar asked Dec 31 '25 07:12

Anon


1 Answers

That command will install LLVM and all the configured projects (via LLVM_ENABLE_PROJECTS) to whatever location you specified in the first step with the CMAKE_INSTALL_PREFIX variable.

If you did not set it, it takes on a platform-dependent value, most likely /usr/local on Linux. This is an appropriate place to put it. I would discourage you from trespassing on the package manager's territory. Untold misery is likely to result.

A "target" in CMake (and many other build systems) is just "something that must be done". Usually it's "compile something to a file with a corresponding name", but it can also be "run an installation script". CMake creates an install target for that purpose in every project. It's also a popular convention in Make/autotools based build systems.

like image 90
Alex Reinking Avatar answered Jan 06 '26 12:01

Alex Reinking



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!