-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marko Petric
committed
Nov 16, 2017
1 parent
2f9db4a
commit e18f752
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
|