Skip to content

Commit

Permalink
Add init file for GCC7
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Petric committed Nov 16, 2017
1 parent 2f9db4a commit e18f752
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions builds/init_x86_64_7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash

#Determine which OS you are using
if [ "$(uname)" == "Darwin" ]; then
if [ $(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}') == "10.12" ]; then
OS=mac1012
COMPILER_TYPE=clang
COMPILER_VERSION=clang80
else
echo "Bootstrap only works on macOS Sierra (10.12)"
fi
elif [ "$(uname)" == "Linux" ]; then
if [ "$( cat /etc/*-release | grep Scientific )" ]; then
OS=slc6
elif [ "$( cat /etc/*-release | grep CentOS )" ]; then
OS=centos7
fi
else
echo "UNKNOWN OS"
exit 1
fi

#Determine is you have CVMFS installed
if [ ! -d "/cvmfs" ]; then
echo "No CVMFS detected, please install it."
exit 1
fi

if [ ! -d "/cvmfs/clicdp.cern.ch" ]; then
echo "No clicdp CVMFS repository detected, please add it."
exit 1
fi


#Determine which compiler to use
if [ -z ${COMPILER_TYPE} ]; then
COMPILER_TYPE='gcc'
fi
if [ ${COMPILER_TYPE} == 'gcc' ]; then
COMPILER_VERSION='gcc7'
fi
if [ ${COMPILER_TYPE} == 'llvm' ]; then
COMPILER_VERSION='llvm5'
fi


#Choose build type
if [ -z ${BUILD_TYPE} ]; then
BUILD_TYPE='opt'
fi


# General variables
CLICREPO=/cvmfs/clicdp.cern.ch
BUILD_FLAVOUR=x86_64-${OS}-${COMPILER_VERSION}-${BUILD_TYPE}

#--------------------------------------------------------------------------------
# Compiler
#--------------------------------------------------------------------------------

if [ ${COMPILER_TYPE} == "gcc" ]; then
source ${CLICREPO}/compilers/gcc/7.2.0/x86_64-${OS}/setup.sh
fi
if [ ${COMPILER_TYPE} == "llvm" ]; then
source ${CLICREPO}/compilers/llvm/5.0.0/x86_64-${OS}/setup.sh
fi

#--------------------------------------------------------------------------------
# CMake
#--------------------------------------------------------------------------------

export CMAKE_HOME=${CLICREPO}/software/CMake/3.9.5/${BUILD_FLAVOUR}
export PATH=${CMAKE_HOME}/bin:$PATH

#--------------------------------------------------------------------------------
# Python
#--------------------------------------------------------------------------------

if [ ${OS} == "slc6" ] || [ ${OS} == "centos7" ]; then
export PYTHONDIR=${CLICREPO}/software/Python/2.7.14/${BUILD_FLAVOUR}
export PATH=${PYTHONDIR}/bin:$PATH
export LD_LIBRARY_PATH=${PYTHONDIR}/lib:${LD_LIBRARY_PATH}
fi

0 comments on commit e18f752

Please sign in to comment.