System Ubuntu64 bit Clang4.0
Reference:
1 https://github.com/yangyangwithgnu/use_vim_as_ide#0.1
The 7th chapter of the tool chain integration
2. http://clang.llvm.org/get_started.html
where Release Clang Versions
3. http://libcxxabi.llvm.org/
Where get it and get involved!
Start with a separate compilation of CLANG/LLVM and corresponding libraries in 1, and compile the libcxx and Libcxxabi libraries separately, where Libcxxabi compile times is wrong: clang-4.0 link Error
In 3, Libcxx and Libcxxabi libraries can be integrated or compiled separately, so the Libcxxabi library is directly included in the Llvm/projects in 2 and the final integration compiles the entire project.
Finally compile the file with clang++.
Compile the source file as follows:
New_feature.cpp#include <iostream> #include <string>class myclass{public : std::string s = " Hello, world\n "; Non-static data member Initializer};int main () { std::cout << MyClass (). S;}
The compile command is as follows
clang++-std=c++11-stdlib=libc++-werror-weverything-wno-disabled-macro-expansion-wno-float-equal-wno-c++98- Compat-wno-c++98-compat-pedantic-wno-global-constructors-wno-exit-time-destructors-wno-missing-prototypes- Wno-padded-wno-old-style-cast-lc++-lc++abi New_feature.cpp
The resulting a.out file appears
./a.out:error while loading shared libraries:libc++abi.so.1:cannot open Shared object file:no such file or directory
Finally, in the compilation file, several libraries are added to the/usr/lib inside to produce the output.
The Library files are:
Note: It may be necessary to manually copy the header files from the include included in build to/usr/include/c++/v1/, in order to find the directory for libc++ and Libc++abi header files.
The specific commands are as follows:
- Get the required tools.
- See Getting Started with the LLVM system-requirements.
- Note also that Python was needed for running the test suite. Get it At:http://www.python.org/download
- Standard build process uses CMake. Get it At:http://www.cmake.org/download
- Check out LLVM:
- Change directory to where you want the LLVM directory placed.
- SVN Co http://llvm.org/svn/llvm-project/llvm/trunk LLVM
- Check out Clang:
- CD Llvm/tools
- SVN Co http://llvm.org/svn/llvm-project/cfe/trunk clang
- Cd.. /..
- Check out extra Clang tools: (optional)
- CD Llvm/tools/clang/tools
- SVN Co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
- Cd.. /.. /.. /..
- Check out Compiler-rt (optional):
- CD llvm/projects
- SVN Co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
- Cd.. /..
- Check out Libcxx: (Required-to-build and run Compiler-rt tests on OS X, optional otherwise)
- CD ll Vm/projects
- SVN co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
- Span style= "Background-color: #ff0000;" >
SVN co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi
-
Cd.. /..
- Build LLVM and Clang:
- mkdir Build (In-tree build is not supported)
- CD Build
- Cmake-g "Unix makefiles". /llvm
- Make
- This builds both LLVM and Clang for debug mode.
- Note:for subsequent Clang development, you can just run make Clang.
- CMake allows generate project files for several ides:xcode, Eclipse CDT4, Codeblocks, Qt-creator (Use the Codebloc KS generator), KDEVELOP3. For more details see Building LLVM with CMake page.
Clang and Libc++abi Library installation