Last active
March 10, 2017 12:34
-
-
Save janmayer/746246e9c7cce4816830 to your computer and use it in GitHub Desktop.
Script to (re-) build FairRoot
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
#!/bin/bash | |
# requires FairSoft installation in ${BASEPATH}/FairSoft | |
# requires FairRoot source code in ${BASEPATH}/FairRoot-src | |
export BASEPATH=$(pwd) | |
# Set FairSoft environment variables | |
export SIMPATH=${BASEPATH}/FairSoft | |
. ${SIMPATH}/share/Geant4/geant4make/geant4make.sh | |
. ${SIMPATH}/bin/thisroot.sh | |
FAIRROOTSOURCEPATH=${BASEPATH}/FairRoot-src | |
FAIRROOTBUILDPATH=${BASEPATH}/FairRoot-build | |
export FAIRROOTPATH=${BASEPATH}/FairRoot | |
# Check if install directory already exists | |
if [ -d "${FAIRROOTPATH}" ]; then | |
# and prompt to remove (can help with errors) | |
echo rm -Ir ${FAIRROOTPATH} | |
rm -Ir ${FAIRROOTPATH} | |
fi | |
mkdir -p ${FAIRROOTPATH} | |
# Check if build directory already exists | |
if [ -d "${FAIRROOTBUILDPATH}" ]; then | |
# and prompt to remove (can help with errors) | |
echo rm -Ir ${FAIRROOTBUILDPATH} | |
rm -Ir ${FAIRROOTBUILDPATH} | |
fi | |
mkdir -p ${FAIRROOTBUILDPATH} | |
# cmake + make + make install | |
cd ${FAIRROOTBUILDPATH} | |
${SIMPATH}/bin/cmake ${FAIRROOTSOURCEPATH} -DCMAKE_INSTALL_PREFIX=${FAIRROOTPATH} -DUSE_DIFFERENT_COMPILER=TRUE -DROOT_DIR=${SIMPATH} -DGEANT4_DIR=${SIMPATH} | |
make -j30 | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment