Skip to content
Snippets Groups Projects
Commit df1e1d2b authored by Simon Spannagel's avatar Simon Spannagel
Browse files

CI: corectly pick up macOS

parent 65b49a59
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
# Determine which OS you are using # Determine which OS you are using
if [ "$(uname)" == "Linux" ]; then if [ "$(uname)" = "Linux" ]; then
if [ "$( cat /etc/*-release | grep Scientific )" ]; then if [ "$( cat /etc/*-release | grep "CentOS Linux 7" )" ]; then
OS=slc6 echo "Detected CentOS Linux 7"
elif [ "$( cat /etc/*-release | grep CentOS )" ]; then
OS=centos7 OS=centos7
elif [ "$( cat /etc/*-release | grep "CentOS Linux 8" )" ]; then
echo "Detected CentOS Linux 8"
OS=centos8
else else
echo "Cannot detect OS, falling back to CentOS7" echo "Cannot detect OS, falling back to CentOS7"
OS=centos7 OS=centos7
fi fi
elif [ "$(uname)" == "Darwin" ]; then elif [ "$(uname)" = "Darwin" ]; then
if [ $(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}') == "10.15" ]; then MACOS_MAJOR=$(sw_vers -productVersion | awk -F '.' '{print $1}')
MACOS_MINOR=$(sw_vers -productVersion | awk -F '.' '{print $2}')
if [ $MACOS_MAJOR = "11" ] || [ "${MACOS_MAJOR}.${MACOS_MINOR}" = "10.15" ]; then
OS=mac1015 OS=mac1015
else else
echo "Bootstrap only works on macOS Catalina (10.15)" echo "Unsupported version of macOS ${MACOS_MAJOR}.${MACOS_MINOR}"
exit 1 exit 1
fi fi
else else
...@@ -23,32 +27,37 @@ else ...@@ -23,32 +27,37 @@ else
fi fi
# Determine is you have CVMFS installed # Determine is you have CVMFS installed
if [ ! -d "/cvmfs" ]; then CVMFS_MOUNT=""
echo "No CVMFS detected, please install it." if [ "$OS" = mac1015 ]; then
CVMFS_MOUNT="/Users/Shared"
fi
if [ ! -d "${CVMFS_MOUNT}/cvmfs" ]; then
echo "No CVMFS detected, please install it. Looking at ${CVMFS_MOUNT}/cvmfs"
exit 1 exit 1
fi fi
if [ ! -d "/cvmfs/sft.cern.ch" ]; then if [ ! -d "${CVMFS_MOUNT}/cvmfs/sft.cern.ch" ]; then
echo "No SFT CVMFS repository detected, please make sure it is available." echo "No SFT CVMFS repository detected, please make sure it is available."
exit 1 exit 1
fi fi
if [ ! -d "/cvmfs/geant4.cern.ch" ]; then if [ ! -d "${CVMFS_MOUNT}/cvmfs/geant4.cern.ch" ]; then
echo "No Geant4 CVMFS repository detected, please make sure it is available." echo "No Geant4 CVMFS repository detected, please make sure it is available."
exit 1 exit 1
fi fi
# Determine which LCG version to use # Determine which LCG version to use
DEFAULT_LCG="LCG_98python3" DEFAULT_LCG="LCG_99"
if [ -z ${CORRY_LCG_VERSION} ]; then if [ -z ${ALLPIX_LCG_VERSION} ]; then
echo "No explicit LCG version set, using ${DEFAULT_LCG}." echo "No explicit LCG version set, using ${DEFAULT_LCG}."
CORRY_LCG_VERSION=${DEFAULT_LCG} ALLPIX_LCG_VERSION=${DEFAULT_LCG}
fi fi
# Determine which compiler to use # Determine which compiler to use
if [ -z ${COMPILER_TYPE} ]; then if [ -z ${COMPILER_TYPE} ]; then
if [ "$(uname)" == "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
COMPILER_TYPE="llvm" COMPILER_TYPE="llvm"
echo "No compiler type set, falling back to AppleClang." echo "No compiler type set, falling back to AppleClang."
else else
...@@ -56,17 +65,13 @@ if [ -z ${COMPILER_TYPE} ]; then ...@@ -56,17 +65,13 @@ if [ -z ${COMPILER_TYPE} ]; then
COMPILER_TYPE="gcc" COMPILER_TYPE="gcc"
fi fi
fi fi
if [ ${COMPILER_TYPE} == "gcc" ]; then if [ ${COMPILER_TYPE} = "gcc" ]; then
if [ ${OS} == "slc6" ]; then COMPILER_VERSION="gcc10"
COMPILER_VERSION="gcc8"
else
COMPILER_VERSION="gcc10"
fi
echo "Compiler type set to GCC, version ${COMPILER_VERSION}." echo "Compiler type set to GCC, version ${COMPILER_VERSION}."
fi fi
if [ ${COMPILER_TYPE} == "llvm" ]; then if [ ${COMPILER_TYPE} = "llvm" ]; then
if [ "$(uname)" == "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
COMPILER_VERSION="clang110" COMPILER_VERSION="clang120"
else else
COMPILER_VERSION="clang10" COMPILER_VERSION="clang10"
fi fi
...@@ -79,15 +84,19 @@ if [ -z ${BUILD_TYPE} ]; then ...@@ -79,15 +84,19 @@ if [ -z ${BUILD_TYPE} ]; then
fi fi
# General variables # General variables
SFTREPO=/cvmfs/sft.cern.ch SFTREPO=${CVMFS_MOUNT}/cvmfs/sft.cern.ch
export BUILD_FLAVOUR=x86_64-${OS}-${COMPILER_VERSION}-${BUILD_TYPE} export BUILD_FLAVOUR=x86_64-${OS}-${COMPILER_VERSION}-${BUILD_TYPE}
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Source full LCG view # Source dependencies
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
export LCG_VIEW=${SFTREPO}/lcg/views/${CORRY_LCG_VERSION}/${BUILD_FLAVOUR}/setup.sh export LCG_VIEW=${SFTREPO}/lcg/views/${ALLPIX_LCG_VERSION}/${BUILD_FLAVOUR}/setup.sh
source ${LCG_VIEW} || echo "yes" source ${LCG_VIEW} || echo "yes"
# Fix LCIO path for LCG_96, cmake configs are not properly placed: if [ -n "${CI}" ] && [ "$(uname)" = "Darwin" ]; then
export LCIO_DIR=$(dirname $(dirname $(readlink $(which lcio_event_counter)))) source $ROOTSYS/bin/thisroot.sh
cd $G4INSTALL/bin/
source geant4.sh
cd -
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment