-
-
Save WhiteBlue/5b25b7b61093d0f2ce48c316d8dcd84e to your computer and use it in GitHub Desktop.
Revisions
-
zchee revised this gist
May 3, 2016 . 1 changed file with 25 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,16 +41,22 @@ else fi # define Python Frameworks path if [[ $3 != "System" ]]; then PYTHON_CONFIG=python$3-config PYTHON_EXECUTABLE=$(which python"$3") else PYTHON_CONFIG=/usr/bin/python-config PYTHON_EXECUTABLE=/usr/bin/python fi PYTHON_INCLUDE_DIR=$(find $("$PYTHON_CONFIG" --prefix)/include -name 'python*' -type d -maxdepth 1) PYTHON_LIBRARY=$(find $("$PYTHON_CONFIG" --prefix)/lib -name 'libpython*' -maxdepth 1) ENVIRONMENT_VARIABLE="\ \$SRC_DIR: $1 \$DST_DIR: $DST_DIR \$PYTHON_EXECUTABLE: $PYTHON_EXECUTABLE \$PYTHON_INCLUDE_DIR: $PYTHON_INCLUDE_DIR \$PYTHON_LIBRARY: $PYTHON_LIBRARY" # Usage usage() { @@ -72,13 +78,8 @@ Unix Makefiles Sublime Text 2 - Unix Makefiles" USAGE_PYTHON_VERSION="\ 2 3 Sytem" echo "error: No build tool as arguments" echo "" @@ -91,7 +92,7 @@ Unix Makefiles echo " $USAGE_PYTHON_VERSION" echo "" echo "Environment variable:" echo " $ENVIRONMENT_VARIABLE" exit 1 } @@ -100,7 +101,6 @@ if [[ ! -n $3 ]]; then usage fi # define dependencies packages PYTHON="\ -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \ @@ -126,6 +126,14 @@ fi # export CXX="ccache $CXX" # fi echo "CMake Generators" echo " $2" echo "Python Version" echo " $3" echo "Environment variable:" echo " $ENVIRONMENT_VARIABLE" echo "" command cmake $1 -G $2 \ \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -
zchee revised this gist
May 3, 2016 . 1 changed file with 16 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,8 +41,8 @@ else fi # define Python Frameworks path PYTHON_PREFIX=$(/usr/local/bin/python"$3"-config --prefix) PYTHON_SELECT_VERSION=$(/usr/local/bin/python"$3"-config --prefix | awk -F / '{print $NF}') PYTHON_EXECUTABLE=$(which python"$3") PYTHON_INCLUDE_DIR=$PYTHON_PREFIX/include/python$PYTHON_SELECT_VERSION @@ -121,6 +121,10 @@ if ! [[ $(readlink -f .) == *build* ]]; then exit 1 fi # if hash ccache 2>/dev/null; then # export CC="ccache $CC" # export CXX="ccache $CXX" # fi command cmake $1 -G $2 \ \ @@ -149,11 +153,9 @@ command cmake $1 -G $2 \ -DCURSES_NCURSES_LIBRARY:FILEPATH=/usr/local/lib/libncurses.dylib \ -DCURSES_PANEL_LIBRARY:FILEPATH=/usr/local/lib/libpanel.dylib \ \ -DLIBCLANG_BUILD_STATIC:BOOL=ON \ -DLIBCXX_ABI_UNSTABLE:BOOL=ON \ -DLIBCXX_CONFIGURE_IDE:BOOL=ON \ -DLIBCXXABI_ENABLE_ASSERTIONS:BOOL=OFF \ -DLIBCXXABI_SYSROOT:STRING="$(xcrun --show-sdk-path)" \ -DLIBCXXABI_USE_LLVM_UNWINDER:BOOL=OFF \ @@ -167,23 +169,18 @@ command cmake $1 -G $2 \ \ -DLLDB_EXPORT_ALL_SYMBOLS:BOOL=ON \ \ -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \ -DLLVM_BUILD_GLOBAL_ISEL:BOOL=ON \ -DLLVM_BUILD_LLVM_C_DYLIB:BOOL=ON \ -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ -DLLVM_CREATE_XCODE_TOOLCHAIN:BOOL=OFF \ -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \ -DLLVM_ENABLE_CXX1Y:BOOL=ON \ -DLLVM_ENABLE_FFI:BOOL=OFF \ -DLLVM_ENABLE_LIBCXX:BOOL=ON \ -DLLVM_ENABLE_LIBCXXABI:BOOL=ON \ -DLLVM_ENABLE_SPHINX:BOOL=OFF \ -DLLVM_EXTERNALIZE_DEBUGINFO:BOOL=OFF \ -DLLVM_INCLUDE_DOCS:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=OFF \ -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \ @@ -192,18 +189,21 @@ command cmake $1 -G $2 \ -DLLVM_TARGET_ARCH:STRING=host \ -DLLVM_TARGETS_TO_BUILD:STRING=X86 \ -DLLVM_TOOL_DSYMUTIL_BUILD:BOOL=ON \ -DLLVM_USE_SPLIT_DWARF:BOOL=OFF \ \ -DPOLLY_ENABLE_GPGPU_CODEGEN:BOOL=ON \ \ -Wno-dev \ \ $(echo $PYTHON) \ $(echo $LIBXML2) \ \ -DLLVM_ENABLE_LTO:STRING=OFF \ -DLLVM_TOOL_LTO_BUILD:BOOL=OFF # -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING= \ # $(echo $LIBFFI) \ # \ # -DC_INCLUDE_DIRS:STRING="$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/include:/usr/include" \ # Disable sanitizer (workaround) @@ -213,6 +213,6 @@ if hash ag 2>/dev/null; then elif hash grep 2>/dev/null; then grep -l " -fno-sanitize=all" $PWD | xargs sed -i 's/ -fno-sanitize=all//' else echo "Disable sanitizer required " exit 1 fi -
zchee revised this gist
Mar 25, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -149,7 +149,7 @@ command cmake $1 -G $2 \ -DCURSES_NCURSES_LIBRARY:FILEPATH=/usr/local/lib/libncurses.dylib \ -DCURSES_PANEL_LIBRARY:FILEPATH=/usr/local/lib/libpanel.dylib \ \ -DC_INCLUDE_DIRS:STRING="$(xcode-select -p)"/Toolchains/XcodeDefault.xctoolchain/usr/include:/usr/include \ \ -DLIBCLANG_BUILD_STATIC:BOOL=ON \ -DLIBCXX_ABI_UNSTABLE:BOOL=OFF \ -
zchee revised this gist
Mar 25, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -213,6 +213,6 @@ if hash ag 2>/dev/null; then elif hash grep 2>/dev/null; then grep -l " -fno-sanitize=all" $PWD | xargs sed -i 's/ -fno-sanitize=all//' else echo "Disable sanitizer required ag or grep" exit 1 fi -
zchee created this gist
Mar 25, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,218 @@ #!/bin/bash set -e # Building LLVM on OSX CMake setup script # # Required: # - clang by Xcode6 or later # - cmake # - ninja # # Usage: # build-llvm.bash <LLVM SOURCES ROOT> <CMAKE GENERATORS> <PYTHON VERSION> [DIST_DIR] # # CMake Generators: Unix Makefiles, Ninja, Xcode (Recommend is Ninja) # # Python Version: 2 or 3 # - for LLDB dylib # # Tested version: # Apple LLVM version 7.3.0 (clang-703.0.28) # Target: x86_64-apple-darwin15.4.0 # # # References: # - llvm 3.8 currently requires Xcode 7(OS X 10.10 or 10.11) Build the new tsan support in compiler-rt or using # - -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON # - Ref: https://groups.google.com/forum/m/#!topic/llvm-dev/Uxb1o83qTMI # - Building with Clan Address Sanitizer(ASan) # - https://trac.webkit.org/wiki/ASanWebKit # - Not build llvm-dsymutil # - When LLVM_ENABLE_LTO, link for llvm-dsymutil too slow... # - github.com/apple/apple-llvm instead of # - -DLLVM_TOOL_DSYMUTIL_BUILD:BOOL=OFF # define install directory if [[ $4 ]]; then DST_DIR=$4 else DST_DIR=/opt/llvm fi # define Python Frameworks path PYTHON_PREFIX=$(python"$3"-config --prefix) PYTHON_SELECT_VERSION=$(python"$3"-config --prefix | awk -F / '{print $NF}') PYTHON_EXECUTABLE=$(which python"$3") PYTHON_INCLUDE_DIR=$PYTHON_PREFIX/include/python$PYTHON_SELECT_VERSION if [[ $3 == 3 ]]; then PYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR$(python$3-config --abiflags) fi PYTHON_LIBRARY=$PYTHON_PREFIX/lib/libpython$PYTHON_SELECT_VERSION.dylib # Usage usage() { USAGE_CMAKE_GENERATORS="\ Unix Makefiles Ninja Xcode CodeBlocks - Ninja CodeBlocks - Unix Makefiles CodeLite - Ninja CodeLite - Unix Makefiles Eclipse CDT4 - Ninja Eclipse CDT4 - Unix Makefiles KDevelop3 KDevelop3 - Unix Makefiles Kate - Ninja Kate - Unix Makefiles Sublime Text 2 - Ninja Sublime Text 2 - Unix Makefiles" USAGE_PYTHON_VERSION="\ 2 3" USAGE_ENVIRONMENT_VARIABLE="\ \$SRC_DIR $SRC_DIR \$DST_DIR $DST_DIR \$PYTHON_EXECUTABLE $PYTHON_EXECUTABLE \$PYTHON_INCLUDE_DIR $PYTHON_INCLUDE_DIR \$PYTHON_LIBRARY $PYTHON_LIBRARY" echo "error: No build tool as arguments" echo "" echo "Usage: $0 <LLVM SOURCES ROOT> <CMake Generators> <Python Version> [\$DIST_DIR]" echo "" echo "CMake Generators" echo " $USAGE_CMAKE_GENERATORS" echo "" echo "Python Version" echo " $USAGE_PYTHON_VERSION" echo "" echo "Environment variable:" echo " $USAGE_ENVIRONMENT_VARIABLE" exit 1 } # Check len(args) if [[ ! -n $3 ]]; then usage fi # define dependencies packages PYTHON="\ -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \ -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR \ -DPYTHON_LIBRARY=$PYTHON_LIBRARY" LIBXML2="\ -DLIBXML2_INCLUDE_DIR=/usr/local/opt/libxml2/include/libxml2 \ -DLIBXML2_LIBRARIES=/usr/local/opt/libxml2/lib/libxml2.dylib \ -DLIBXML2_XMLLINT_EXECUTABLE=/usr/local/opt/libxml2/bin/xmllint" LIBFFI="\ -DFFI_INCLUDE_DIR=/usr/local/opt/libffi/lib/libffi-3.0.13/include \ -DFFI_LIBRARY_DIR=/usr/local/opt/libffi/lib/libffi.dylib" # Warning for have not '*build*' in current dir name if ! [[ $(readlink -f .) == *build* ]]; then echo "Current dir needs build* name" exit 1 fi command cmake $1 -G $2 \ \ -DBUILD_SHARED_LIBS:BOOL=OFF \ \ -DCMAKE_ASM_FLAGS:STRING='-march=native' \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_CXX_FLAGS:STRING='-march=native' \ -DCMAKE_C_FLAGS:STRING='-march=native' \ -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \ -DCMAKE_FIND_FRAMEWORK=LAST \ -DCMAKE_INSTALL_PREFIX:PATH=$DST_DIR \ -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 \ -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.11 \ -DCMAKE_OSX_SYSROOT:STRING="$(xcrun --show-sdk-path)" \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=NO \ -DCMAKE_SKIP_RPATH:BOOL=NO \ \ -DCLANG_DEFAULT_CXX_STDLIB:STRING=libc++ \ -DCLANG_INCLUDE_DOCS:BOOL=ON \ -DCLANG_INCLUDE_TESTS:BOOL=ON \ \ -DCURSES_CURSES_LIBRARY:FILEPATH=/usr/local/lib/libcurses.dylib \ -DCURSES_FORM_LIBRARY:FILEPATH=/usr/local/lib/libform.dylib \ -DCURSES_INCLUDE_PATH:PATH=/usr/local/include \ -DCURSES_NCURSES_LIBRARY:FILEPATH=/usr/local/lib/libncurses.dylib \ -DCURSES_PANEL_LIBRARY:FILEPATH=/usr/local/lib/libpanel.dylib \ \ -DC_INCLUDE_DIRS:STRING="$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/include:/usr/include" \ \ -DLIBCLANG_BUILD_STATIC:BOOL=ON \ -DLIBCXX_ABI_UNSTABLE:BOOL=OFF \ -DLIBCXX_CONFIGURE_IDE:BOOL=OFF \ -DLIBCXXABI_ENABLE_ASSERTIONS:BOOL=OFF \ -DLIBCXXABI_SYSROOT:STRING="$(xcrun --show-sdk-path)" \ -DLIBCXXABI_USE_LLVM_UNWINDER:BOOL=OFF \ \ -DLIBCXX_ENABLE_ASSERTIONS:BOOL=OFF \ -DLIBCXX_OVERRIDE_DARWIN_INSTALL:BOOL=ON \ -DLIBCXX_SYSROOT:STRING="$(xcrun --show-sdk-path)" \ \ -DLIBOMP_OSX_ARCHITECTURES:STRING=x86_64 \ -DLIBOMP_USE_HWLOC:BOOL=ON \ \ -DLLDB_EXPORT_ALL_SYMBOLS:BOOL=ON \ \ -DLLD_USE_VTUNE:BOOL=ON \ \ -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \ -DLLVM_BUILD_GLOBAL_ISEL:BOOL=ON \ -DLLVM_BUILD_INSTRUMENTED:BOOL=ON \ -DLLVM_BUILD_LLVM_C_DYLIB:BOOL=ON \ -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ -DLLVM_CREATE_XCODE_TOOLCHAIN:BOOL=OFF \ -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \ -DLLVM_ENABLE_CXX1Y:BOOL=ON \ -DLLVM_ENABLE_FFI:BOOL=ON \ -DLLVM_ENABLE_LIBCXX:BOOL=ON \ -DLLVM_ENABLE_LIBCXXABI:BOOL=ON \ -DLLVM_ENABLE_LTO:STRING=OFF \ -DLLVM_ENABLE_SPHINX:BOOL=OFF \ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING= \ -DLLVM_EXTERNALIZE_DEBUGINFO:BOOL=ON \ -DLLVM_INCLUDE_DOCS:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=OFF \ -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \ -DLLVM_PARALLEL_COMPILE_JOBS:STRING=8 \ -DLLVM_PARALLEL_LINK_JOBS:STRING=8 \ -DLLVM_TARGET_ARCH:STRING=host \ -DLLVM_TARGETS_TO_BUILD:STRING=X86 \ -DLLVM_TOOL_DSYMUTIL_BUILD:BOOL=ON \ -DLLVM_USE_SPLIT_DWARF:BOOL=ON \ \ -DPOLLY_ENABLE_GPGPU_CODEGEN:BOOL=ON \ \ \ -Wno-dev \ \ $(echo $PYTHON) \ $(echo $LIBXML2) \ \ -DLLVM_TOOL_LTO_BUILD:BOOL=OFF # $(echo $LIBFFI) \ # Disable sanitizer (workaround) # - clang: error: unsupported argument 'all' to option 'fno-sanitize=' if hash ag 2>/dev/null; then ag -l " -fno-sanitize=all" | xargs sed -i 's/ -fno-sanitize=all//' elif hash grep 2>/dev/null; then grep -l " -fno-sanitize=all" $PWD | xargs sed -i 's/ -fno-sanitize=all//' else echo "Disable sanitizer required " exit 1 fi This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ #!/bin/bash set -e if hash nproc 2>/dev/null; then CUPS=$(($(nproc) + 1)) else CUPS=$(($(sysctl -n hw.ncpu) + 1)) fi if [[ -d "llvm" ]]; then cd llvm git fetch else git clone --depth=1 http://llvm.org/git/llvm.git cd llvm fi if hash parallel 2>/dev/null; then parallel -j $CUPS $1 'git submodule add --force --depth=1' http://llvm.org/git/{/}.git {.} ::: \ tools/clang \ projects/compiler-rt projects/libclc projects/libcxx projects/libcxxabi projects/openmp \ tools/lld tools/lldb tools/polly else git submodule add --force --depth=1 http://llvm.org/git/clang.git tools/clang git submodule add --force --depth=1 http://llvm.org/git/compiler-rt.git projects/compiler-rt git submodule add --force --depth=1 http://llvm.org/git/libclc.git projects/libclc git submodule add --force --depth=1 http://llvm.org/git/libcxx.git projects/libcxx git submodule add --force --depth=1 http://llvm.org/git/libcxxabi.git projects/libcxxabi git submodule add --force --depth=1 http://llvm.org/git/openmp.git projects/openmp git submodule add --force --depth=1 http://llvm.org/git/lld.git tools/lld git submodule add --force --depth=1 http://llvm.org/git/lldb.git tools/lldb git submodule add --force --depth=1 http://llvm.org/git/polly.git tools/polly fi cd tools/clang/tools git submodule add --force --depth=1 http://llvm.org/git/clang-tools-extra.git extra This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/bash set -e if ! [[ -n $1 ]]; then DIRECTORY=$(readlink -f .) else DIRECTORY=$1 fi repository=$(find $DIRECTORY -type d -depth 1 \( ! -iname "build*" \)) echo 'Update repository' for r in $repository do echo " $r" done for d in $repository do cd $d BRANCH=$(git name-rev --name-only --no-undefined --always HEAD) git pull origin $BRANCH done