10 from HLTUtils
import hltOksUtils
11 from pm.dal
import dal
16 parser = optparse.OptionParser(description=
"Create HLT S/W respository")
18 parser.add_option(
"-p",
"--prefix", action=
"store",
19 help=
"Prefix used for all objects (default: 'HLT')")
21 parser.add_option(
"-m",
"--modifier", action=
"store",
22 help=
"Modifier for objects in S/W repository (default: '')")
24 (opt, args) = parser.parse_args()
26 if opt.prefix
is not None:
29 if opt.modifier
is not None and len(opt.modifier)>0:
30 modifier =
'_' + opt.modifier
32 rep = pm.project.Project(
'daq/sw/repository.data.xml')
33 onlineRep = rep.getObject(
'SW_Repository',
'Online')
34 common_env = pm.project.Project(
'daq/segments/common-environment.data.xml')
36 atlas_project = os.environ.get(
'AtlasProject')
38 if not os.environ.get(
'AtlasReleaseType')==
'stable':
40 atlas_version=
'%s,r%s' % (os.environ.get(
'AtlasBuildBranch'),
41 os.environ.get(
'AtlasBuildStamp'))
44 atlas_version = os.environ.get(
'AtlasVersion')
46 platform = hltOksUtils.platform()
49 dal.SW_PackageVariable(
'XMLPATH',
51 Suffix=os.path.join(platform,
"XML")),
52 dal.SW_PackageVariable(
'DATAPATH',
54 Suffix=os.path.join(platform,
"share")),
55 dal.SW_PackageVariable(
'CALIBPATH',
57 Suffix=os.path.join(platform,
"share")),
58 dal.SW_PackageVariable(
'JOBOPTSEARCHPATH',
59 Name=
'JOBOPTSEARCHPATH',
60 Suffix=os.path.join(platform,
"jobOptions")),
61 dal.SW_PackageVariable(
'PYTHONPATH',
63 Suffix=os.path.join(platform,
"python"))
67 dal.Variable(
'%s_ASETUP_ARGS' % prefix,
69 Value=(
'%s,%s' % (atlas_project,
'${%s_VERSION}' % prefix)),
70 Description=
'asetup arguments'),
72 dal.Variable(
'%s_PRELOAD' % prefix,
73 Name=
'ASETUP_PRELOAD',
74 Value=
'libtcmalloc_minimal.so:libimf.so:libintlc.so.5',
75 Description=
'Preload libraries'),
77 dal.Variable(
'%s_VERBOSE' % prefix,
78 Name=
'ASETUP_VERBOSE',
80 Description=
'Verbosity for asetup_wrapper'),
82 dal.Variable(
'%s_EXTRA_SW_PATH' % prefix,
83 Name=
'ASETUP_EXTRA_SW_PATH',
85 Description=
'Patch area (e.g. /my/path/InstallArea)'),
87 common_env.getObject(
'Variable',
'AtlasSetup')
90 pars = dal.VariableSet(
'%s-Parameters' % prefix,
91 Description=
'Parameters to expand for executables',
92 Contains = [ dal.Variable(
'%s_VERSION' % prefix,
93 Name=
'%s_VERSION' % prefix,
95 Description=
'%s release version' % prefix) ])
98 dal.Binary(
'HLTMPPU_asetup',
99 BinaryName=
'asetup_wrapper',
100 Description=
'HLTMPPU_main with asetup environment',
101 DefaultParameters=
'HLTMPPU_main',
102 ProcessEnvironment=puvars)
108 tag = pm.common.tdaqRepository.getObject(
'Tag',hltOksUtils.platform())
110 tag = pm.common.tdaqRepository.getObject(
'Tag')[0]
111 print(
'Cannot find tag %s in OKS. Using %s instead. Please fix manually.' %
112 (hltOksUtils.platform(), tag.id))
114 hltRep = dal.SW_Repository(
'%s-Repository' % prefix,
115 Name=(
'%s-Repository' % prefix),
116 InstallationPath=
"%s/InstallArea" % os.environ.get(
'AtlasArea'),
119 ISInfoDescriptionFiles=[os.path.join(platform,
'share/data/daq/schema/is_trigconf_hlt.schema.xml')],
120 AddProcessEnvironment = swvars
124 app.BelongsTo = hltRep
126 proj = pm.project.Project(
'%s_SW_Repository.data.xml' % prefix,
127 [
'daq/schema/core.schema.xml',
128 'daq/sw/repository.data.xml'])
130 proj.addObjects([hltRep])
131 proj.addObjects([pars])