building Clang instructions
Posted: Mon Mar 18, 2013 2:37 am
(CL git head @ Debian Wheezy x64)
I was in the middle of trying to replace gcc with Clang when I realized LLVM's svn trunk will fetch the in-progress version 3.3, which also has renamed headers:
Since CL ships with Clang 3.2 headers, is that the version one should get?
Building Clang/Linux with cmake has a few caveats:
- requires "libxml2-dev" or barfs with "Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)"
- without specifying an architecture it builds ALL possible targets (Windows only does x86 by default)
- the default for -DCLLVM_ENABLE_THREADS is 1, not sure if it's the intended goal
I think the vanilla ../configure+make instructions build faster than with cmake, maybe because the following default to 1
LLVM_BUILD_TOOLS
LLVM_INCLUDE_TOOLS
LLVM_INCLUDE_EXAMPLES
LLVM_INCLUDE_TESTS
LLVM_ENABLE_WARNINGS
LLVM_ENABLE_PEDANTIC
any guidance about which are actually needed?
if using LLVM trunk, after copying the Clang lib over to CL, should the Clang headers be copied over too?
Btw according to llvm.org docs, its git mirror (http://llvm.org/git/llvm.git) contains only trunk, not previous releases.
thx!
-- p
I was in the middle of trying to replace gcc with Clang when I realized LLVM's svn trunk will fetch the in-progress version 3.3, which also has renamed headers:
Code: Select all
./llvm/build-release/Release/lib/clang/3.3/include/
Code: Select all
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_32/final llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_32/final clang
- requires "libxml2-dev" or barfs with "Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)"
- without specifying an architecture it builds ALL possible targets (Windows only does x86 by default)
- the default for -DCLLVM_ENABLE_THREADS is 1, not sure if it's the intended goal
Code: Select all
cd ..
mkdir build-release
cd build-release
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" ..
LLVM_BUILD_TOOLS
LLVM_INCLUDE_TOOLS
LLVM_INCLUDE_EXAMPLES
LLVM_INCLUDE_TESTS
LLVM_ENABLE_WARNINGS
LLVM_ENABLE_PEDANTIC
any guidance about which are actually needed?
if using LLVM trunk, after copying the Clang lib over to CL, should the Clang headers be copied over too?
Code: Select all
rm -r (...)codelitegit/sdk/clang/Linux/<i386 | x86_64>/lib/clang
cp -r (...)llvm/build-release/Release/lib/clang (...)/codelitegit/sdk/clang/Linux/<i386 | x86_64>/lib/
thx!
-- p