Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Gauss.py 10.81 KiB
# -*- coding: utf-8 -*-
###############################################################################
# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration           #
#                                                                             #
# This software is distributed under the terms of the GNU General Public      #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".   #
#                                                                             #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization  #
# or submit itself to any jurisdiction.                                       #
###############################################################################
from LbNightlyTools.Configuration import Slot, Project, DBASE, PARAM, Package
from .Common import WARNINGS_EXCEPTIONS, ERROR_EXCEPTIONS

import os
# datetime for rebuildAlways temporary hack
import datetime

# list of defined slots
slots = []

## A few reminder of possible ways to include merge requests
# gSim09Cmake = cloneSlot('lhcb-sim09', 'lhcb-sim09-cmake')
# Project('Gauss', 'Sim09', checkout=('git',{'merges':'all'})) ] )
# Project('Gauss', 'Sim09', checkout=('git',{'merges':10})) ] )
# Project('Gauss', 'Sim09', checkout=('git',{'merges':[10,11,12]})) ] )

# set cmt environment to pick up the nightlies for dbase and param
cmtEnv = [('CMTPROJECTPATH=' + '${CMTPROJECTPATH}' +
           ':/cvmfs/lhcbdev.cern.ch/lib/lcg/releases')]

# do the same for cmake
cmakeEnv = [('CMAKE_PREFIX_PATH=' + ':'.join([
    '/cvmfs/lhcbdev.cern.ch/lib/lcg/releases',
    '/cvmfs/lhcb.cern.ch/lib/lcg/releases',
    '/cvmfs/sft.cern.ch/lcg/releases',
    '${CMAKE_PREFIX_PATH}',
]))]

# to test release build
relEnv = [('CMAKE_PREFIX_PATH=' + ':'.join([
    '/cvmfs/lhcb.cern.ch/lib/lcg/releases',
    '${CMAKE_PREFIX_PATH}',
]))]

DEFAULT_DEPLOYMENT = ['cvmfs']
NO_DEPLOYMENT = []

SIM09_PLATFORMS = [
    'x86_64-slc6-gcc48-opt', 'x86_64-slc6-gcc48-dbg', 'x86_64-slc6-gcc49-opt',
    'x86_64-slc6-gcc49-dbg'
]

# Slot for Sim09 on cvmfs with cmt
gSim09 = Slot(
    name='lhcb-sim09',
    projects=[
        Project('LHCb', 'sim09-patches', checkout=('git', {
            'merges': 'all'
        })),
        Project('Gauss', 'Sim09', checkout=('git', {
            'merges': 'all'
        })),
        DBASE(packages=[
            Package('PRConfig', 'HEAD'),
            Package('Gen/PGunsData', 'HEAD'),
            Package('LHAPDFSets', 'Sim09')
        ]),
        PARAM(packages=[Package('ParamFiles', 'HEAD')])
    ])
gSim09.desc = 'To build Gauss Sim09 with LHCb v39r1p4+patches, Gaudi v26r4 and LCG_79'
gSim09.platforms = SIM09_PLATFORMS
gSim09.build_tool = 'cmt'
gSim09.env = cmtEnv
gSim09.deployment = DEFAULT_DEPLOYMENT
gSim09.cache_entries['GEANT4_TAG'] = 'lhcb/v9.6.4-branch'
#gSim09.cache_entries['GEANT4_TAG'] = 'lhcb/v96r4p3'
#gSim09.env = cmtEnv + ['VERBOSE=1']
slots.append(gSim09)

# Slots for g4 and gauss with cmake
#    for Sim09
gSim09Cmake = Slot(
    name='lhcb-sim09-cmake',
    projects=[
        Project('LCGCMT', '79', disabled=True),
        Project('Geant4', 'Sim09', checkout=('git', {
            'merges': 'all'
        })),
        Project('LHCb', 'sim09-patches', checkout=('git', {
            'merges': 'all'
        })),
        Project('Gauss', 'Sim09', checkout=('git', {
            'merges': 'all'
        })),
        DBASE(packages=[
            Package('PRConfig', 'HEAD'),
            Package('Gen/PGunsData', 'HEAD')
        ]),
        PARAM(packages=[Package('ParamFiles', 'HEAD')])
    ])
gSim09Cmake.desc = 'Identical to lhcb-sim09 but built with cmake'
gSim09Cmake.platforms = SIM09_PLATFORMS
gSim09Cmake.warning_exceptions = list(WARNINGS_EXCEPTIONS)
gSim09Cmake.error_exceptions = list(ERROR_EXCEPTIONS)
gSim09Cmake.build_tool = 'cmake'
gSim09Cmake.env = cmakeEnv
gSim09Cmake.deployment = DEFAULT_DEPLOYMENT
gSim09Cmake.cache_entries['GEANT4_TAG'] = 'lhcb/v9.6.4-branch'
gSim09Cmake.cache_entries['GAUDI_DIAGNOSTICS_COLOR'] = False
gSim09Cmake.cache_entries['GAUDI_DIAGNOTICS_COLOR'] = False
# Temp hack to trigger slot rebuild
gSim09Cmake.metadata = {'rebuildAlways': str(datetime.date.today())}
slots.append(gSim09Cmake)

# Special slot for gauss for upgrade study
gSim09Up = Slot(
    name='lhcb-sim09-upgrade',
    projects=[
        Project('LHCb', 'v42r11', disabled=True),
        Project('Geant4', 'Sim09', checkout=('git', {
            'merges': 'all'
        })),
        Project('Gauss', 'Sim09-upgrade', checkout=('git', {
            'merges': 'all'
        })),
        DBASE(packages=[Package('PRConfig', 'HEAD')]),
        PARAM(packages=[Package('ParamFiles', 'HEAD')])
    ])
gSim09Up.desc = 'Build of Gauss for Upgrade studies, identical to Gauss Sim09 for generators and Geant4, build with LHCb v42r11, Gaudi v28r1 and LCG_88'
gSim09Up.platforms = ['x86_64-slc6-gcc49-opt', 'x86_64-slc6-gcc49-dbg']
gSim09Up.warning_exceptions = list(WARNINGS_EXCEPTIONS)
gSim09Up.error_exceptions = list(ERROR_EXCEPTIONS)
gSim09Up.build_tool = 'cmake'
gSim09Up.env = cmakeEnv
gSim09Up.deployment = NO_DEPLOYMENT
gSim09Up.cache_entries['GEANT4_TAG'] = 'lhcb/v9.6.4-branch'
slots.append(gSim09Up)

# Temporary definition of gcc8 platforms for Sim10 until we may include the gcc9 platforms
CORE_PLATFORMS = [
    'x86_64-centos7-gcc9-opt',
    'x86_64-centos7-gcc9-dbg',
]
SIM10_PLATFORMS = [
    'x86_64-centos7-gcc8-opt',
    'x86_64-centos7-gcc8-dbg',
]
DEV_PLATFORMS = CORE_PLATFORMS + SIM10_PLATFORMS


def create_sim_slot(name, desc, platforms=CORE_PLATFORMS, deploy=False):
    slot = Slot(
        name=name,
        projects=[
            Project('Geant4', 'Sim10', checkout=('git', {
                'merges': 'all'
            })),
            Project('Gauss', 'HEAD'),
            DBASE(packages=[Package('PRConfig', 'HEAD')])
        ],
        warning_exceptions=list(WARNINGS_EXCEPTIONS),
        error_exceptions=list(ERROR_EXCEPTIONS))
    slot.desc = desc
    slot.platforms = platforms
    slot.build_tool = 'cmake'
    slot.env = cmakeEnv
    slot.deployment = DEFAULT_DEPLOYMENT if deploy else NO_DEPLOYMENT
    #    slot.cache_entries['GEANT4_TAG'] = 'lhcb/v10.6.2-branch'
    return slot


# Slot for Gauss Sim10 development - for now master, eventually will move to Sim10 branch
gaussSim10 = create_sim_slot(
    'lhcb-sim10',
    'Development build of Gauss for Sim10 with LHCb v51r0+patches, Gaudi v33r0 and LCG_96b, Geant4 v106r1',
    platforms=CORE_PLATFORMS,
    deploy=True)
#gaussSim10.Gauss.version = 'v54r2'
#gaussSim10.LHCb.disabled = True
# Temp hack to trigger slot rebuild
gaussSim10.metadata = {'rebuildAlways': str(datetime.date.today())}
slots.append(gaussSim10)

# Slots for Gauss generator development - for now master, eventually will move to Sim10 branch
gaussGen = create_sim_slot(
    'lhcb-gauss-gen-dev',
    'Development build of Gauss identical to Sim10 but with new generators or generator version',
    platforms=CORE_PLATFORMS,
    deploy=False)
gaussGen.projects.append(
    DBASE(packages=[Package('Gen/PowhegboxData', 'HEAD')]))
gaussGen.Geant4.version = 'v106r2'
gaussGen.Geant4.disabled = True
slots.append(gaussGen)

gaussGen2 = create_sim_slot(
    'lhcb-gauss-gen2-dev',
    'Development build of Gauss identical to Sim10 but with new generators or generator version',
    platforms=CORE_PLATFORMS,
    deploy=False)
gaussGen2.projects.append(
    DBASE(packages=[Package('Gen/MadgraphData', 'HEAD')]))
gaussGen.Geant4.version = 'v106r2'
gaussGen.Geant4.disabled = True
slots.append(gaussGen2)

# Slot for Gauss developments on latest stable LCG / LHCb
gaussDev = create_sim_slot(
    'lhcb-gauss-dev',
    'Development build of Gauss that could be incompatible with Sim10, using Gaudi v32r2, LCG_96b',
    platforms=CORE_PLATFORMS,
    deploy=True)
gaussDev.projects.append(Project('LCG', '96b', disabled=True))
gaussDev.projects.append(Project('Gaudi', 'master'))
gaussDev.projects.append(Project('Detector', 'v0-patches'))
gaussDev.projects.append(Project('LHCb', 'HEAD'))
# Temporary: force CRMC from a special build
gaussDev.cache_entries[
    'CRMC_INCLUDE_DIR'] = '/cvmfs/sft-nightlies.cern.ch/lcg/nightlies/dev3/Thu/MCGenerators/crmc/1.6.0/x86_64-centos7-gcc9-opt/src'
# Temp hack to trigger slot rebuild
gaussDev.metadata = {'rebuildAlways': str(datetime.date.today())}
slots.append(gaussDev)

# Slot for Gauss with Lamarr development
gaussLamarr = create_sim_slot(
    'lhcb-gauss-lamarr',
    'Development build of Gauss identical to lhcb-gauss-sim10 but with Lamarr',
    platforms=CORE_PLATFORMS,
    deploy=True)
#gaussLamarr.Gauss.checkout_opts['merges'] = ['all']
gaussLamarr.Geant4.version = 'v106r2'
gaussLamarr.Geant4.disabled = True
slots.append(gaussLamarr)

# Slot for Gauss with fast Calorimeter development
gaussFastCalo = create_sim_slot(
    'lhcb-gauss-fast',
    'Development build of Gauss indentical to lhcb-gauss-sim10 but with fast calorimeter options',
    platforms=CORE_PLATFORMS,
    deploy=False)
gaussFastCalo.projects.append(
    DBASE(packages=[Package('FastCaloSimData', 'HEAD')]))
slots.append(gaussFastCalo)

# Slot for Gaussino and Gauss-on-Gaussino
gaussino = Slot(
    name='lhcb-gaussino',
    projects=[
        Project('LCG', '97', disabled=True),
        Project('Gaudi', 'cmake-modernisation'),
        Project('GitCondDB', 'HEAD'),
        Project('Geant4', 'HEAD'),
        Project('Detector', 'HEAD'),
        Project('LHCb', 'HEAD'),
        Project(
            'Gaussino',
            'HEAD',
            checkout=('git', {
                'url': 'https://gitlab.cern.ch/Gaussino/Gaussino.git'
            })),
        Project('Gauss', 'Futurev3', checkout=('git', {
            'merges': 'all'
        })),
        DBASE(packages=[Package('PRConfig', 'HEAD')]),
    ],
    warning_exceptions=list(WARNINGS_EXCEPTIONS),
    error_exceptions=list(ERROR_EXCEPTIONS))
gaussino.desc = 'Test build of Gaussino and future Gauss'
gaussino.Gaudi.checkout_opts[
    'url'] = 'https://gitlab.cern.ch/clemenci/Gaudi.git'
gaussino.Detector._deps = ['GitCondDB']
gaussino.env.append(
    'CMAKE_PREFIX_PATH=${PWD}/build/GitCondDB/InstallArea/${platform}:/cvmfs/lhcbdev.cern.ch/lib/lcg/releases:${CMAKE_PREFIX_PATH}'
)
gaussino.cache_entries['DETECTOR_VERSION'] = 'HEAD'
gaussino.cache_entries['USE_DD4HEP'] = 'ON'
gaussino.cache_entries['GAUDI_USE_INTELAMPLIFIER'] = True
gaussino.cache_entries['GAUDI_LEGACY_CMAKE_SUPPORT'] = True
gaussino.cache_entries['CATCH2_SOURCES_URL'] = \
        'https://lhcb-repository.web.cern.ch/repository/lhcb-contrib/Catch2/Catch2-3.0.0-preview1.tar.gz'

# hack to make pkg-config work
gaussino.cache_entries['PKG_CONFIG_USE_CMAKE_PREFIX_PATH'] = True
gaussino.env.append('CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr')
gaussino.platforms = ['x86_64-centos7-gcc9-opt', 'x86_64-centos7-gcc9-dbg']
gaussino.build_tool = 'cmake'
gaussino.deployment = DEFAULT_DEPLOYMENT
gaussino.env = cmakeEnv
gaussino.env.append('LCG_VERSION=97')
slots.append(gaussino)