Created
August 26, 2014 09:44
-
-
Save palmerc/26cad67b65a551e5aef2 to your computer and use it in GitHub Desktop.
Setup libomp for the Mac dependent on the llvm-omp environment
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 | |
LLVM_SRC_DIR=${BUILD_DIR}/llvm | |
LLVM_BUILD_DIR=${BUILD_DIR}/llvm-build | |
LIBOMP_SRC_DIR=${BUILD_DIR}/libomp_oss | |
INTEL_OPENMP_LATEST_BUILD_LINK=https://www.openmprtl.org/sites/default/files/libomp_20131209_oss.tgz | |
OPENMP_INCLUDE=${LIBOMP_SRC_DIR}/exports/common/include | |
OPENMP_LIB=${LIBOMP_SRC_DIR}/exports/mac_32e/lib.thin | |
echo "Downloading OpenMP Runtime Library source code" | |
if [ ! -d "${LIBOMP_SRC_DIR}" ]; then | |
mkdir -p ${LIBOMP_SRC_DIR} | |
LIBOMP_TGZ=${BUILD_DIR}/libomp_oss_temp.tgz | |
cd ${BUILD_DIR} | |
curl ${INTEL_OPENMP_LATEST_BUILD_LINK} -o ${LIBOMP_TGZ} | |
gunzip -c ${LIBOMP_TGZ} | tar --strip-components 2 -xopf - -C ${LIBOMP_SRC_DIR} | |
rm -rf ${LIBOMP_TGZ} | |
fi | |
cd ${LIBOMP_SRC_DIR} | |
echo "If you do not have GCC installed, you must comment out lines 450-451 in libomp_oss/tools/check-tools.pl. Have you done this or want to compile anyway?" | |
select yn in "Yes" "No"; do | |
case $yn in | |
Yes ) make compiler=clang; break;; | |
No ) exit;; | |
esac | |
done | |
echo "OpenMP Runtime Include Path : " ${OPENMP_INCLUDE} | |
echo "OpenMP Runtime Lib Path : " ${OPENMP_LIB} | |
(echo 'export PATH='${CLANG_BIN}':$PATH'; | |
echo 'export C_INCLUDE_PATH='${OPENMP_INCLUDE}':${C_INCLUDE_PATH}'; | |
echo 'export CPLUS_INCLUDE_PATH='${OPENMP_INCLUDE}':${CPLUS_INCLUDE_PATH}'; | |
echo 'export LIBRARY_PATH='${OPENMP_LIB}':${LIBRARY_PATH}'; | |
echo 'export DYLD_LIBRARY_PATH='${OPENMP_LIB}':${DYLD_LIBRARY_PATH}') >> ${ROOT_DIR}/libomp_bash_profile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment