Created
August 26, 2014 09:45
-
-
Save palmerc/438d42152e86756f844a to your computer and use it in GitHub Desktop.
Setup the LLVM compiler with the OpenMP extensions
This file contains 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 characters
ROOT_DIR=${PWD} | |
BUILD_DIR=${ROOT_DIR}/omp-src | |
INSTALL_DIR=/usr/local/llvm-omp | |
LLVM_SRC_DIR=${BUILD_DIR}/llvm | |
LLVM_BUILD_DIR=${BUILD_DIR}/llvm-build | |
CLANG_INCLUDE=${LLVM_SRC_DIR}/include | |
CLANG_BIN=${LLVM_BUILD_DIR}/Release+Asserts/bin | |
CLANG_LIB=${LLVM_BUILD_DIR}/Release+Asserts/lib | |
echo "Checking out LLVM with OpenMP support source code" | |
mkdir -p ${BUILD_DIR} | |
cd ${BUILD_DIR} | |
if [ ! -d "${LLVM_SRC_DIR}" ]; then | |
git clone https://github.com/clang-omp/llvm ${LLVM_SRC_DIR} | |
git clone https://github.com/clang-omp/compiler-rt ${LLVM_SRC_DIR}/projects/compiler-rt | |
git clone -b clang-omp https://github.com/clang-omp/clang ${LLVM_SRC_DIR}/tools/clang | |
fi | |
echo "Compiling LLVM with OpenMP support" | |
mkdir -p ${LLVM_BUILD_DIR} | |
cd ${LLVM_BUILD_DIR} | |
../llvm/configure --enable-optimized --prefix=${INSTALL_DIR} | |
make -j2 | |
#echo "Installing LLVM with OpenMP support to ${INSTALL_DIR}" | |
#make install | |
echo "LLVM+Clang Include Path : " ${CLANG_INCLUDE} | |
echo "LLVM+Clang Bin Path : " ${CLANG_BIN} | |
echo "LLVM+Clang Lib Path : " ${CLANG_LIB} | |
(echo 'export PATH='${CLANG_BIN}':${PATH}'; | |
echo 'export C_INCLUDE_PATH='${CLANG_INCLUDE}':${C_INCLUDE_PATH}'; | |
echo 'export CPLUS_INCLUDE_PATH='${CLANG_INCLUDE}':${CPLUS_INCLUDE_PATH}'; | |
echo 'export LIBRARY_PATH='${CLANG_LIB}':${LIBRARY_PATH}'; | |
echo 'export DYLD_LIBRARY_PATH='${CLANG_LIB}':${DYLD_LIBRARY_PATH}') >> ${ROOT_DIR}/llvm_bash_profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment