[llvm-dev] llvm-6.0.0rc2: fatal error: clang/Basic/Version.h: No such file or directory

Dimitry Andric via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 15 11:45:55 PST 2018


On 15 Feb 2018, at 20:35, Andrew Kelley <superjoe30 at gmail.com> wrote:
> 
> What is the purpose of supporting this "copy directories around" sort
> of build strategy anyway?

The purpose, at least it seems to me in this particular case, is to isolate the needed headers into a build directory, without pulling in all the other headers from the source directory.

For example, both on Linux and FreeBSD, cxxabi.h is installed into the system C++ header directory.  On Debian, this is /usr/include/c++/6/cxxabi.h (as part of libstdc++), on FreeBSD it is /usr/include/c++/v1 (as part of libc++).

If you would simply add -I /usr/include/c++/6/cxxabi.h or -I /usr/include/c++/v1 to your compilation flags, you would also pull in other C++ headers, which you do not want during the build of libc++.

In the past I have also manually created some empty directory, symlinked the needed C++ ABI headers in there, and pointed the libc++ build to that directory for inclusion.  But copying is also OK, of course.

The point is, usually the system does not make the C++ ABI headers available in a nicely isolated directory, so this is why you have to work around that.


> At the end of the day, the way these packages get installed is via
> system package managers is independently, each project finding its
> dependencies with the standard prefix path.
> 
> When I compile from source it's always like this:
> 
> $ cd llvm-6.0.0rc2.src/
> $ mkdir build
> $ cd build
> $ cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local
> -DCMAKE_PREFIX_PATH=$HOME/local -DCMAKE_BUILD_TYPE=Release
> $ make install
> 
> $ cd cfe-6.0.0rc2.src/
> $ mkdir build
> $ cd build
> $ cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local
> -DCMAKE_PREFIX_PATH=$HOME/local -DCMAKE_BUILD_TYPE=Release
> $ make install
> 
> $ cd lld-6.0.0rc2.src/
> $ mkdir build
> $ cd build
> $ cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local
> -DCMAKE_PREFIX_PATH=$HOME/local -DCMAKE_BUILD_TYPE=Release
> $ make install

I never do that.  I git clone or svn checkout all the directories in their right places, and run cmake for all of them in one go, without needing to "make install" in intermediate steps.  In fact, make install only occurs at the very end, after everything has been built and tested.

This is also the way the test-release.sh script does things, btw.


> etc
> 
> This is how stuff gets installed on Debian, Ubuntu, NixOS, Arch,
> Gentoo, etc.

It seems that this is not very handy, as you will have to package up each individual component first, install it, and only then can you proceed with the build of the next component.  You also need root to do that.

Much easier to build everything in one huge sandbox, then roll packages from there, if you ask me.


> And it works for Windows too:
> 
>> mkdir C:\Users\Andy\llvm-6.0.0rc2.src\build-release
>> cd C:\Users\Andy\llvm-6.0.0rc2.src\build-release
>> "c:\Program Files\CMake\bin\cmake.exe" .. -Thost=x64 -G"Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=C:\Users\Andy\llvm+clang-6.0.0rc2-win64-msvc-release -DCMAKE_PREFIX_PATH=C:\Users\Andy\llvm+clang-6.0.0rc2-win64-msvc-release -DCMAKE_BUILD_TYPE=Release
>> msbuild -p:Configuration=Release INSTALL.vcxproj
> 
> 
> What are our use cases for the strategy where we move directories into
> llvm to build?

It looks like the source tree has always been organized this way.  Maybe it has recently become possible to build all those projects in a separated fashion, as you described earlier, but I was not aware of it.  I also do not see the advantage, and significant risk that you might mix and match incompatible versions...

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180215/76aaa9b0/attachment.sig>


More information about the llvm-dev mailing list