Commit 2986050a authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Add CI (only compilation)

parent 71df2b28
Pipeline #211698 failed with stage
in 2 minutes and 47 seconds
#!/bin/bash
if [ "$(uname)" == "Darwin" ]; then
if [ $(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}') == "10.12" ]; then
OS=mac1012
COMPILER_TYPE=llvm
COMPILER_VERSION=clang80
else
echo "Bootstrap only works on macOS Sierra (10.12)"
exit 1
fi
else
echo "This script is only meant for Mac"
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
# 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}
#--------------------------------------------------------------------------------
# CMake
#--------------------------------------------------------------------------------
export CMAKE_HOME=${CLICREPO}/software/CMake/3.6.2/${BUILD_FLAVOUR}
export PATH=${CMAKE_HOME}/bin:$PATH
#--------------------------------------------------------------------------------
# ROOT
#--------------------------------------------------------------------------------
export ROOTSYS=${CLICREPO}/software/ROOT/6.08.00/${BUILD_FLAVOUR}
export PYTHONPATH="$ROOTSYS/lib:$PYTHONPATH"
export PATH="$ROOTSYS/bin:$PATH"
export DYLD_LIBRARY_PATH="$ROOTSYS/lib:$DYLD_LIBRARY_PATH"
#--------------------------------------------------------------------------------
# Ninja
#--------------------------------------------------------------------------------
export Ninja_HOME=${CLICREPO}/software/Ninja/1.7.1/${BUILD_FLAVOUR}
export PATH="$Ninja_HOME:$PATH"
#!/bin/bash
# Determine which OS you are using
if [ "$(uname)" == "Linux" ]; then
if [ "$( cat /etc/*-release | grep Scientific )" ]; then
OS=slc6
elif [ "$( cat /etc/*-release | grep CentOS )" ]; then
OS=centos7
else
echo "Cannot detect OS, falling back to SLC6"
OS=slc6
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
if [ ! -d "/cvmfs/sft.cern.ch" ]; then
echo "No sft 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="llvm40"
fi
# Choose build type
if [ -z ${BUILD_TYPE} ]; then
BUILD_TYPE=opt
fi
# General variables
CLICREPO=/cvmfs/clicdp.cern.ch
SFTREPO=/cvmfs/sft.cern.ch
BUILD_FLAVOUR=x86_64-${OS}-${COMPILER_VERSION}-${BUILD_TYPE}
#--------------------------------------------------------------------------------
# Compiler
#--------------------------------------------------------------------------------
if [ ${COMPILER_TYPE} == "gcc" ]; then
source ${CLICREPO}/compilers/gcc/7.1.0/x86_64-${OS}/setup.sh
fi
if [ ${COMPILER_TYPE} == "llvm" ]; then
source ${CLICREPO}/compilers/llvm/4.0.0/x86_64-${OS}/setup.sh
fi
#--------------------------------------------------------------------------------
# CMake
#--------------------------------------------------------------------------------
export CMAKE_HOME=${CLICREPO}/software/CMake/3.8.1/${BUILD_FLAVOUR}
export PATH=${CMAKE_HOME}/bin:$PATH
#--------------------------------------------------------------------------------
# ROOT
#--------------------------------------------------------------------------------
export ROOTSYS=${CLICREPO}/software/ROOT/6.08.06/${BUILD_FLAVOUR}
export PYTHONPATH="$ROOTSYS/lib:$PYTHONPATH"
export PATH="$ROOTSYS/bin:$PATH"
export LD_LIBRARY_PATH="$ROOTSYS/lib:$LD_LIBRARY_PATH"
export CMAKE_PREFIX_PATH="$ROOTSYS:$CMAKE_PREFIX_PATH"
#--------------------------------------------------------------------------------
# Ninja
#--------------------------------------------------------------------------------
export Ninja_HOME=${CLICREPO}/software/Ninja/1.7.2/${BUILD_FLAVOUR}
export PATH="$Ninja_HOME:$PATH"
#--------------------------------------------------------------------------------
# Git
#--------------------------------------------------------------------------------
export Git_HOME=${CLICREPO}/software/git/2.13.2/${BUILD_FLAVOUR}
export PATH=${Git_HOME}/bin:${PATH}
source $ROOTSYS/bin/thisroot.sh
source $G4ENV_INIT
stages:
- compilation
#######################
# Compilation targets #
#######################
cmp:slc6-gcc:
stage: compilation
tags:
- docker
image: clicdp/slc6-base
script:
- export COMPILER_TYPE="gcc"
- source .gitlab-ci.d/init_x86_64.sh
- source .gitlab-ci.d/load_deps.sh
- mkdir build
- cd build
- cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS ..
- ninja
- ninja install
artifacts:
paths:
- build
- bin
- lib
expire_in: 3 hour
cmp:slc6-llvm:
stage: compilation
tags:
- docker
image: clicdp/slc6-base
script:
- export COMPILER_TYPE="llvm"
- source .gitlab-ci.d/init_x86_64.sh
- mkdir build
- cd build
- cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS ..
- ninja
- ninja install
artifacts:
paths:
- build
- bin
- lib
expire_in: 3 hour
cmp:cc7-gcc:
stage: compilation
tags:
- docker
image: clicdp/cc7-base
script:
- export COMPILER_TYPE="gcc"
- source .gitlab-ci.d/init_x86_64.sh
- source .gitlab-ci.d/load_deps.sh
- mkdir build
- cd build
- cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS ..
- ninja
- ninja install
artifacts:
paths:
- build
- bin
- lib
expire_in: 3 hour
cmp:cc7-llvm:
stage: compilation
tags:
- docker
image: clicdp/cc7-base
script:
- export COMPILER_TYPE="llvm"
- source .gitlab-ci.d/init_x86_64.sh
- mkdir build
- cd build
- cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS ..
- ninja
- ninja install
artifacts:
paths:
- build
- bin
- lib
expire_in: 3 hour
cmp:mac1012-clang:
stage: compilation
tags:
- mac
script:
- source .gitlab-ci.d/init_mac.sh
- source .gitlab-ci.d/load_deps.sh
- mkdir build
- cd build
- cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DCMAKE_USE_RELATIVE_PATHS=TRUE ..
- ninja
- ninja install
artifacts:
paths:
- build
- bin
- lib
expire_in: 3 hour
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment