Skip to content

Instantly share code, notes, and snippets.

@Jiwan
Created January 16, 2017 20:23
Show Gist options
  • Save Jiwan/05c6a00c4d4864225bc497838778bb39 to your computer and use it in GitHub Desktop.
Save Jiwan/05c6a00c4d4864225bc497838778bb39 to your computer and use it in GitHub Desktop.
Compiler env.sh
if [ -z "$BH_ENV" ];
then
echo "Variable BH_ENV must be set and be the name of a folder in /opt";
else
echo "Configuring compiler environment.";
INSTALL_DIR=/opt/${BH_ENV}
THIRD_PARTY_DIR=${INSTALL_DIR}/thirdparty
export GCC_ENV_DIR=${INSTALL_DIR}
export GCC_BIN_DIR=${GCC_ENV_DIR}/bin
export CC=${GCC_BIN_DIR}/gcc
export CXX=${GCC_BIN_DIR}/g++
export CPP=${GCC_BIN_DIR}/cpp
# export LD=$GCC_BIN_DIR/gcc
export LD_PRELOAD_PATH=${GCC_ENV_DIR}/libexec:${GCC_ENV_DIR}/lib64:${GCC_ENV_DIR}/lib:${LD_PRELOAD_PATH}
export LD_LIBRARY_PATH=${LD_PRELOAD_PATH}:${LD_LIBRARY_PATH}
export LIBRARY_PATH=${GCC_ENV_DIR}/lib
export C_INCLUDE_PATH=${GCC_ENV_DIR}/include
export CPLUS_INCLUDE_PATH=${GCC_ENV_DIR}/include
export BOOST_INCLUDEDIR=${GCC_ENV_DIR}/include
# Thirdparty.
export LD_PRELOAD_PATH=$THIRD_PARTY_DIR/lib:$LD_PRELOAD_PATH
export LD_LIBRARY_PATH=$THIRD_PARTY_DIR/lib:${LD_LIBRARY_PATH}
export LIBRARY_PATH=$THIRD_PARTY_DIR/lib:${LIBRARY_PATH}
export C_INCLUDE_PATH=$THIRD_PARTY_DIR/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$THIRD_PARTY_DIR/include:$CPLUS_INCLUDE_PATH
# R-plugins folder-
export R_LIBS=$GCC_ENV_DIR/thirdparty/lib
export PATH=$GCC_BIN_DIR:$THIRD_PARTY_DIR/bin:$PATH
# Cmake paths
export CMAKE_INCLUDE_PATH=$CPLUS_INCLUDE_PATH
export CMAKE_LIBRARY_PATH=$LD_LIBRARY_PATH
export CMAKE_PREFIX_PATH=$GCC_ENV_DIR/thirdparty/
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment