Dukales

build clang++-libc++ from git on Ubuntu

Feb 14th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.26 KB | None | 0 0
  1. export CC=clang
  2. export CXX=clang++
  3. export CXXFLAGS="-stldib=libc++"
  4. cd
  5. export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/home/user/llvm/projects/libcxxabi/include"
  6. export LDFLAGS="-lc++abi"
  7.  
  8. cd
  9. git clone --single-branch --branch master --depth=1 http://llvm.org/git/llvm
  10. cd llvm/projects/
  11. git clone --single-branch --branch master --depth=1 http://llvm.org/git/libcxxabi
  12. git clone --single-branch --branch master --depth=1 http://llvm.org/git/libcxx
  13. git clone --single-branch --branch master --depth=1 http://llvm.org/git/compiler-rt
  14. cd ../tools
  15. git clone --single-branch --branch master --depth=1 http://llvm.org/git/clang
  16. git clone --single-branch --branch master --depth=1 http://llvm.org/git/clang-tools-extra extra
  17. git clone --single-branch --branch master --depth=1 http://llvm.org/git/lld
  18. git clone --single-branch --branch master --depth=1 http://llvm.org/git/lldb
  19. git clone --single-branch --branch master --depth=1 http://llvm.org/git/polly
  20.  
  21. sudo apt-get install libgmp3-dev dh-autoreconf libunwind8 libunwind8-dev
  22.  
  23. cd
  24. cd llvm/tools/polly/utils
  25. mkdir -p ~/build-cloog
  26. bash checkout_cloog.sh ~/build-cloog
  27. mkdir -p ~/build-isl
  28. bash checkout_isl.sh ~/build-isl
  29. cd ~/build-isl/
  30. ./configure
  31. make
  32. sudo make install
  33. cd ~/build-cloog/
  34. ./configure --with-isl=system
  35. make
  36. sudo make install
  37.  
  38. sudo apt-get install python-dev libedit-dev libncurses-dev swig libgmp-dev
  39.  
  40. cd
  41. mkdir build-llvm
  42. cd build-llvm
  43. #  --enable-debug-runtime
  44. bash ../llvm/configure --enable-optimized --disable-assertions --enable-libcpp --enable-jit --with-intel-jitevents --enable-targets=x86,x86_64 --enable-polly --enable-cxx1y --with-gmp=/usr/local --with-isl=/usr/local --with-cloog=/usr/local --with-binutils-include=/usr/include
  45. make -j5
  46. #mv /usr/local/clang /usr/local/clang1
  47. sudo make install
  48.  
  49. sudo apt-get install cmake
  50. cd
  51. mkdir build-profile-rt
  52. cd build-profile-rt
  53. cmake ../llvm/projects/compiler-rt -DLLVM_CONFIG_PATH=/usr/local/bin/llvm-config
  54. make
  55. sudo make install
  56.  
  57. #cd
  58. #git clone --single-branch --branch master --depth=1 http://llvm.org/git/libclc
  59. #cd libclc
  60. #./configure.py --with-llvm-config=/usr/local/bin/llvm-config
  61.  
  62. #clang++ -O3 -Xclang -load -Xclang LLVMPolly.so -mllvm -polly -mllvm -polly-vectorizer=polly -mllvm -enable-polly-openmp -lgomp file.cpp
Advertisement
Add Comment
Please, Sign In to add comment