I need to explore/modify/build LLVM and Clang. In the Getting Started documentation, it is said to build it with the usual magical recipe (configure → make → make install). However, I noticed that for
Debug builds all the libraries are statically linked: this inflates the binaries size, and thus
sudo ninja -C ./build install ends up copying a lot of data, moreover in the root partition (on Linux).
My question is: what advantages does installing provide, apart from having the binaries in PATH?
Because this can be equally fized by putting in your
.bashrc (or equivalent)
Should I always install the project after compiling it? Or is the PATH export enough? Why? Can’t the IDE still access all the relevant headers for auto-completion and similar? Are the libraries affected?
The install command is useful when you want to create something shareable since the builddir is mixed with build objects and the final binaries.
But for just development, you don’t need to install it.
Ah, I see, thanks. I guess I’m going to delete everything that has been just installed
As a side note, I’ve got two curiosities:
- How can you create a shareable package by installing? Setting the install prefix?
- If I wanted to install in a portable way, IIUC it would be beneficial to use CMake, much like
cmake --build ./build is better than
cd build; make if you ever happen to change generator. To install, I read CMake accepts
cmake install <dir>, where
<dir> is (IIRC) the binaries dir. But LLVM builds also other artifacts, like libraries: if I issued
cmake install ./build/bin
would CMake understand everything it needs, much like
ninja install? Maybe using a script (
cmake -P), which, IIUC, is also what
ninja actually do?
With respect to 2: Note that CMake really does not like you moving cmake’d build directories, as the CMake config is very full of absolute paths.
I see, thanks. Do this mean it would lead to a series of recompilations?