LLVM

From mmmv_kos
Jump to: navigation, search



LLVM allalaadimine:

#!/usr/bin/env bash
#==========================================================================

S_FP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

export CC="gcc"
export CXX="g++"

S_TIMESTAMP="`date +%Y`_`date +%m`_`date +%d`"
S_TMP_0="$S_FP_DIR/vd_$S_TIMESTAMP"
S_TMP_0_SRC="_src"
S_TMP_0_INSTALLED="_installed"
S_FP_SRC="$S_TMP_0$S_TMP_0_SRC"
S_FP_INSTALLED="$S_TMP_0$S_TMP_0_INSTALLED"
mkdir -p $S_FP_SRC
mkdir -p $S_FP_INSTALLED

cd $S_FP_SRC
  svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
  cd llvm
    #--------------------------------------------
    mkdir -p ./tools
    cd ./tools
        svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
    cd ..

    cd ./tools/clang/tools
        svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
    cd ../../..

    cd ./projects
        svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
    cd ..

    cd ./projects
        svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
    cd ..
    make update

    mkdir -p build
    cd build
      CFLAGS=" -mtune=native -ftree-vectorize " CXXFLAGS=" -mtune=native -ftree-vectorize " nice -n15 ../configure --enable-optimized --enable-docs=yes --enable-pic --enable-targets=x86_64 --enable-libffi --enable-ltdl-install --disable-bindings --prefix=$S_FP_INSTALLED
    cd ..
    #--------------------------------------------
  cd .. # llvm
cd .. # $S_FP_SRC


kompileerimine:

nice -n20 make  # takes hours to complete