summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Clemencic <marco.clemencic@cern.ch>2013-02-25 14:58:17 +0100
committerMarco Clemencic <marco.clemencic@cern.ch>2013-02-25 14:58:17 +0100
commit04edef7b6cc0ee5e5f3bd54e94540bcf9b0d38a5 (patch)
treeff218f2cf698b85d9a4a1a8dc93539c031997463
parentb0b114b0753c3a6ab0d44a69205914db5fc68303 (diff)
parent34d79fedf53422a915729f48e95385fcddc82fa5 (diff)
Merge remote branch 'master' into dev/manycoreHEADdev/manycore
* master: (33 commits) minor changes and a fix to patch #5605 modified gaudirun.py to run performance profilers fixed update_versions.py to change the version in global CMakeLists.txt forgot again that update_versions.py does not update global CMake Improvements to the checker for Python files encoding. Fixed a problem in the detection of Boost 1.50 (Sleep.cpp). updated project release notes updated versions of packages minor fix to update_versions.py Switched to LCGCMT 64c. added check on the encoding of Python files when zipping fixed the Xrootd version in HEPTools 64b and 64c added (preliminary) HEPTools 64c improved inclusion of HEPTools toolchain and added module to inherit it added dictionaries for HistoStrings (GaudiUtils) Patch #5594: fix for parsing of 1D histos with non-equidistant binnings fixed FindROOT.cmake to allow use of system installed ROOT avoid a pointless call to queryInterface in ConversionSvc constructor added release notes for patch #5593 applied patch #5593 (Implemented late forking for GaudiMP) ...
-rw-r--r--CMakeLists.txt2
-rw-r--r--Gaudi/CMakeLists.txt2
-rw-r--r--Gaudi/cmt/requirements2
-rw-r--r--Gaudi/cmt/version.cmt2
-rw-r--r--Gaudi/doc/release.notes16
-rwxr-xr-xGaudi/scripts/gaudirun.py120
-rw-r--r--GaudiExamples/CMakeLists.txt2
-rw-r--r--GaudiExamples/cmt/requirements2
-rw-r--r--GaudiExamples/doc/release.notes1
-rw-r--r--GaudiKernel/CMakeLists.txt2
-rw-r--r--GaudiKernel/cmt/requirements2
-rw-r--r--GaudiKernel/doc/release.notes8
-rw-r--r--GaudiKernel/src/Lib/ConversionSvc.cpp4
-rw-r--r--GaudiKernel/src/Lib/Sleep.cpp10
-rw-r--r--GaudiKernel/src/Util/CMakeLists.txt2
-rw-r--r--GaudiMP/CMakeLists.txt2
-rw-r--r--GaudiMP/cmt/requirements2
-rw-r--r--GaudiMP/doc/release.notes7
-rw-r--r--GaudiMP/python/GaudiMP/GMPBase.py309
-rw-r--r--GaudiMP/python/GaudiMP/pTools.py5
-rw-r--r--GaudiPolicy/CMakeLists.txt2
-rw-r--r--GaudiPolicy/cmt/requirements2
-rw-r--r--GaudiPolicy/doc/release.notes12
-rwxr-xr-xGaudiPolicy/scripts/ZipPythonDir.py55
-rwxr-xr-xGaudiPolicy/scripts/merge_files.py14
-rw-r--r--GaudiPython/CMakeLists.txt2
-rw-r--r--GaudiPython/cmt/requirements2
-rw-r--r--GaudiPython/dict/kernel.h1
-rw-r--r--GaudiPython/dict/selection_kernel.xml41
-rw-r--r--GaudiPython/doc/release.notes4
-rw-r--r--GaudiRelease/cmt/requirements18
-rwxr-xr-xGaudiRelease/cmt/update_versions.py11
-rw-r--r--GaudiRelease/doc/release.notes7
-rw-r--r--GaudiRelease/doc/release.notes.html44
-rw-r--r--GaudiSys/cmt/requirements2
-rw-r--r--GaudiSys/doc/release.notes1
-rw-r--r--GaudiUtils/CMakeLists.txt2
-rw-r--r--GaudiUtils/cmt/requirements2
-rw-r--r--GaudiUtils/doc/release.notes4
-rw-r--r--GaudiUtils/src/Lib/Histo2String.cpp12
-rw-r--r--GaudiUtils/src/Lib/HistoParsers.cpp12
-rw-r--r--cmake/EnvConfig/Control.py2
-rw-r--r--cmake/GaudiProjectConfig.cmake93
-rw-r--r--cmake/InheritHEPTools.cmake68
-rw-r--r--cmake/UseHEPTools.cmake29
-rwxr-xr-xcmake/cmt2cmake/cmt2cmake.py16
-rw-r--r--cmake/cmt2cmake/test_cmt2cmake.py37
-rwxr-xr-xcmake/env.py2
-rw-r--r--cmake/modules/FindROOT.cmake41
-rw-r--r--cmake/toolchain/heptools-64b.cmake2
-rw-r--r--cmake/toolchain/heptools-64c.cmake163
-rw-r--r--cmake/toolchain/heptools-common.cmake5
-rw-r--r--cmt/project.cmt2
-rw-r--r--toolchain.cmake29
54 files changed, 1053 insertions, 188 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 072aaf0..3e1fa93 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@ find_package(GaudiProject)
#---------------------------------------------------------------
# Declare project name and version
-gaudi_project(Gaudi v23r5)
+gaudi_project(Gaudi v23r6)
# This test does not really fit in a subdirectory.
gaudi_add_test(cmake.EnvConfigTests
diff --git a/Gaudi/CMakeLists.txt b/Gaudi/CMakeLists.txt
index 3ca9601..fde992d 100644
--- a/Gaudi/CMakeLists.txt
+++ b/Gaudi/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(Gaudi v23r5)
+gaudi_subdir(Gaudi v23r6)
gaudi_depends_on_subdirs(GaudiKernel)
diff --git a/Gaudi/cmt/requirements b/Gaudi/cmt/requirements
index 941eaf4..8c89daa 100644
--- a/Gaudi/cmt/requirements
+++ b/Gaudi/cmt/requirements
@@ -1,6 +1,6 @@
package Gaudi
-version v23r5
+version v23r6
branches doc cmt
use GaudiSys *
diff --git a/Gaudi/cmt/version.cmt b/Gaudi/cmt/version.cmt
index e8e047e..4934bdd 100644
--- a/Gaudi/cmt/version.cmt
+++ b/Gaudi/cmt/version.cmt
@@ -1 +1 @@
-v23r5
+v23r6
diff --git a/Gaudi/doc/release.notes b/Gaudi/doc/release.notes
index d014db7..df9d23f 100644
--- a/Gaudi/doc/release.notes
+++ b/Gaudi/doc/release.notes
@@ -1,6 +1,22 @@
Package : Gaudi
Package manager : Marco Clemencic
+! 2013-02-15 - Danilo Piparo
+ - Patch #5605: Run performance profilers with gaudirun.py command line options
+ Allow to operate performance profilers directly from gaudirun.py, simply
+ using command line options. Igprof and Valgrind (whole suite: callgrind,
+ massif, cachegrind, drd, ...) are supported.
+ Three options have been added:
+ o --profilerName: Specify the profiler name. The possibilities are
+ igprofMem, igprofPerf and valgrind<toolname>. For igprof,
+ sensible and basically universal meaningful default
+ options are added (compress output, be verbose)
+ o --profilerOutput: Specify the output file name. If not selected, a default
+ is provided.
+ o --profilerExtraOptions: specify extra options for the profiler, where the
+ '--' is replaces with a '__'.
+
+================================ Gaudi v23r6 =================================
================================ Gaudi v23r5 =================================
! 2012-11-05 - Marco Clemencic
- Ensure that we get the correct return code after a segfault in C++.
diff --git a/Gaudi/scripts/gaudirun.py b/Gaudi/scripts/gaudirun.py
index 899b554..53e8095 100755
--- a/Gaudi/scripts/gaudirun.py
+++ b/Gaudi/scripts/gaudirun.py
@@ -1,5 +1,34 @@
#!/usr/bin/env python
+def getArgsWithoutoProfilerInfo(args):
+ """
+ Remove from the arguments the presence of the profiler and its output in
+ order to relaunch the script w/o infinite loops.
+
+ >>> getArgsWithoutoProfilerInfo(['--profilerName', 'igprof', 'myopts.py'])
+ ['myopts.py']
+
+ >>> getArgsWithoutoProfilerInfo(['--profilerName=igprof', 'myopts.py'])
+ ['myopts.py']
+
+ >>> getArgsWithoutoProfilerInfo(['--profilerName', 'igprof', '--profilerExtraOptions', 'a b c', 'myopts.py'])
+ ['myopts.py']
+
+ >>> getArgsWithoutoProfilerInfo(['--profilerName', 'igprof', '--options', 'a b c', 'myopts.py'])
+ ['--options', 'a b c', 'myopts.py']
+ """
+ newargs = []
+ args = list(args) # make a temp copy
+ while args:
+ o = args.pop(0)
+ if o.startswith('--profile'):
+ if '=' not in o:
+ args.pop(0)
+ else:
+ newargs.append(o)
+ return newargs
+
+
#---------------------------------------------------------------------
if __name__ == "__main__":
import os, sys
@@ -66,8 +95,24 @@ if __name__ == "__main__":
parser.add_option("--preload", action="append",
help="Allow pre-loading of special libraries (e.g. Google "
"profiling libraries).")
+
+ # Option to use a profiler
+ parser.add_option("--profilerName", type="string",
+ help="Select one profiler among: igprofPerf, igprofMem and valgrind<toolname>")
+
+ # Option to specify the filename where to collect the profiler's output
+ parser.add_option("--profilerOutput", type="string",
+ help="Specify the name of the output file for the profiler output")
+
+ # Option to specify the filename where to collect the profiler's output
+ parser.add_option("--profilerExtraOptions", type="string",
+ help="Specify additional options for the profiler. The '--' string should be expressed as '__' (--my-opt becomes __my-opt)")
+
parser.set_defaults(options = [],
tcmalloc = False,
+ profilerName = '',
+ profilerOutput = '',
+ profilerExtraOptions = '',
preload = [],
ncpus = None)
@@ -127,6 +172,81 @@ if __name__ == "__main__":
args = [ a for a in sys.argv if a != '-T' and not '--tcmalloc'.startswith(a) ]
os.execv(sys.executable, [sys.executable] + args)
+ # Profiler Support ------
+ if opts.profilerName:
+ profilerName = opts.profilerName
+ profilerExecName = ""
+ profilerOutput = opts.profilerOutput or (profilerName + ".output")
+
+ # To restart the application removing the igprof option and prepending the string
+ args = getArgsWithoutoProfilerInfo(sys.argv)
+
+ igprofPerfOptions = "-d -pp -z -o igprof.pp.gz".split()
+
+ profilerOptions = ""
+ if profilerName == "igprof":
+ if not opts.profilerOutput:
+ profilerOutput += ".profile.gz"
+ profilerOptions = "-d -z -o %s" % profilerOutput
+ profilerExecName = "igprof"
+
+ elif profilerName == "igprofPerf":
+ if not opts.profilerOutput:
+ profilerOutput += ".pp.gz"
+ profilerOptions = "-d -pp -z -o %s" % profilerOutput
+ profilerExecName = "igprof"
+
+ elif profilerName == "igprofMem":
+ if not opts.profilerOutput:
+ profilerOutput += ".mp.gz"
+ profilerOptions = "-d -mp -z -o %s" % profilerOutput
+ profilerExecName = "igprof"
+
+ elif "valgrind" in profilerName:
+ # extract the tool
+ if not opts.profilerOutput:
+ profilerOutput += ".log"
+ toolname = profilerName.replace('valgrind','')
+ outoption = "--log-file"
+ if toolname in ("massif", "callgrind", "cachegrind"):
+ outoption = "--%s-out-file" % toolname
+ profilerOptions = "--tool=%s %s=%s" % (toolname, outoption, profilerOutput)
+ profilerExecName = "valgrind"
+
+ else:
+ root_logger.warning("Profiler %s not recognized!" % profilerName)
+
+ # Add potential extra options
+ if opts.profilerExtraOptions!="":
+ profilerExtraOptions = opts.profilerExtraOptions
+ profilerExtraOptions = profilerExtraOptions.replace("__","--")
+ profilerOptions += " %s" % profilerExtraOptions
+
+ # now we look for the full path of the profiler: is it really there?
+ import distutils.spawn
+ profilerPath = distutils.spawn.find_executable(profilerExecName)
+ if not profilerPath:
+ root_logger.error("Cannot locate profiler %s" % profilerExecName)
+ sys.exit(1)
+
+ root_logger.info("------ Profiling options are on ------ \n"\
+ " o Profiler: %s\n"\
+ " o Options: '%s'.\n"\
+ " o Output: %s" % (profilerExecName, profilerOptions, profilerOutput))
+
+ # We profile python
+ profilerOptions += " python"
+
+ # now we have all the ingredients to prepare our command
+ arglist = [profilerPath] + profilerOptions.split() + args
+ arglist = [ a for a in arglist if a!='' ]
+ #print profilerPath
+ #for arg in arglist:
+ #print arg
+ os.execv(profilerPath, arglist)
+
+ # End Profiler Support ------
+
if opts.pickle_output:
if opts.output:
root_logger.error("Conflicting options: use only --pickle-output or --output")
diff --git a/GaudiExamples/CMakeLists.txt b/GaudiExamples/CMakeLists.txt
index 6f67d3d..17af5a7 100644
--- a/GaudiExamples/CMakeLists.txt
+++ b/GaudiExamples/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(GaudiExamples v23r5)
+gaudi_subdir(GaudiExamples v23r6)
gaudi_depends_on_subdirs(GaudiKernel GaudiUtils GaudiGSL GaudiAlg)
diff --git a/GaudiExamples/cmt/requirements b/GaudiExamples/cmt/requirements
index e7f81a7..0e998a9 100644
--- a/GaudiExamples/cmt/requirements
+++ b/GaudiExamples/cmt/requirements
@@ -1,5 +1,5 @@
package GaudiExamples
-version v23r5
+version v23r6
use ROOT * LCG_Interfaces
use Reflex * LCG_Interfaces -no_auto_imports
diff --git a/GaudiExamples/doc/release.notes b/GaudiExamples/doc/release.notes
index 6ec2a80..4a18c4d 100644
--- a/GaudiExamples/doc/release.notes
+++ b/GaudiExamples/doc/release.notes
@@ -1,6 +1,7 @@
Package GaudiExamples
Package manager : Marco Clemencic
+============================ GaudiExamples v23r6 =============================
============================ GaudiExamples v23r5 =============================
! 2012-11-15 - Marco Clemencic
- Added a test for CorruptedInputFile exit code that uses a real corrupted
diff --git a/GaudiKernel/CMakeLists.txt b/GaudiKernel/CMakeLists.txt
index e11c260..9cab4e9 100644
--- a/GaudiKernel/CMakeLists.txt
+++ b/GaudiKernel/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(GaudiKernel v28r4)
+gaudi_subdir(GaudiKernel v28r5)
find_package(Boost REQUIRED COMPONENTS filesystem thread system)
find_package(ROOT REQUIRED COMPONENTS Core Reflex)
diff --git a/GaudiKernel/cmt/requirements b/GaudiKernel/cmt/requirements
index 3ea3a45..750267d 100644
--- a/GaudiKernel/cmt/requirements
+++ b/GaudiKernel/cmt/requirements
@@ -1,5 +1,5 @@
package GaudiKernel
-version v28r4
+version v28r5
author "LHCb Gaudi Team"
branches GaudiKernel cmt doc src
diff --git a/GaudiKernel/doc/release.notes b/GaudiKernel/doc/release.notes
index eb11aee..a5aa782 100644
--- a/GaudiKernel/doc/release.notes
+++ b/GaudiKernel/doc/release.notes
@@ -1,6 +1,14 @@
Package : GaudiKernel
Package manager : Marco Clemencic
+! 2013-01-30 - Marco Clemencic
+ - Fixed a problem in the detection of Boost 1.50 (Sleep.cpp).
+
+============================= GaudiKernel v28r5 ==============================
+! 2013-01-15 - Marco Clemencic
+ - Minor change in ConversionSvc constructor to avoid a pointless call to
+ queryInterface.
+
============================= GaudiKernel v28r4 ==============================
! 2012-11-12 - Marco Clemencic
- Define the incident and return code for corrupted input files.
diff --git a/GaudiKernel/src/Lib/ConversionSvc.cpp b/GaudiKernel/src/Lib/ConversionSvc.cpp
index 978896a..9f3da1a 100644
--- a/GaudiKernel/src/Lib/ConversionSvc.cpp
+++ b/GaudiKernel/src/Lib/ConversionSvc.cpp
@@ -405,11 +405,11 @@ StatusCode ConversionSvc::createAddress( long /* svc_type */,
/// Standard Constructor
ConversionSvc::ConversionSvc(const std::string& name, ISvcLocator* svc, long type)
- : base_class(name, svc)
+ : base_class(name, svc),
+ m_cnvSvc(static_cast<IConversionSvc*>(this))
{
m_type = type;
m_dataSvc = 0;
- m_cnvSvc = this;
m_workers = new Workers();
setAddressCreator(this).ignore();
}
diff --git a/GaudiKernel/src/Lib/Sleep.cpp b/GaudiKernel/src/Lib/Sleep.cpp
index 21f050a..022d356 100644
--- a/GaudiKernel/src/Lib/Sleep.cpp
+++ b/GaudiKernel/src/Lib/Sleep.cpp
@@ -1,6 +1,8 @@
#include "GaudiKernel/Sleep.h"
-#if BOOST_VERSION < 15000
+#include "boost/version.hpp"
+
+#if BOOST_VERSION < 105000
#include "boost/thread/xtime.hpp"
#endif
#include "boost/thread/thread.hpp"
@@ -10,7 +12,7 @@ namespace Gaudi {
/// Simple sleep function taken from COOL.
/// @author Marco Clemencic
void Sleep(int sec){
-#if BOOST_VERSION >= 15000
+#if BOOST_VERSION >= 105000
boost::this_thread::sleep_for(boost::chrono::seconds(sec));
#else
using namespace boost;
@@ -23,10 +25,10 @@ namespace Gaudi {
#endif
}
- /// Small variation on the sleep function for nanosecons sleep.
+ /// Small variation on the sleep function for nanoseconds sleep.
/// @author Marco Clemencic
void NanoSleep(long long nsec){
-#if BOOST_VERSION >= 15000
+#if BOOST_VERSION >= 105000
boost::this_thread::sleep_for(boost::chrono::nanoseconds(nsec));
#else
using namespace boost;
diff --git a/GaudiKernel/src/Util/CMakeLists.txt b/GaudiKernel/src/Util/CMakeLists.txt
index 48a7c04..738b329 100644
--- a/GaudiKernel/src/Util/CMakeLists.txt
+++ b/GaudiKernel/src/Util/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(Util v28r4)
+gaudi_subdir(Util v28r5)
gaudi_depends_on_subdirs(GaudiKernel)
diff --git a/GaudiMP/CMakeLists.txt b/GaudiMP/CMakeLists.txt
index 8e86926..62d24e6 100644
--- a/GaudiMP/CMakeLists.txt
+++ b/GaudiMP/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(GaudiMP v1r6)
+gaudi_subdir(GaudiMP v1r7)
gaudi_depends_on_subdirs(GaudiKernel)
diff --git a/GaudiMP/cmt/requirements b/GaudiMP/cmt/requirements
index 4e17377..d22340a 100644
--- a/GaudiMP/cmt/requirements
+++ b/GaudiMP/cmt/requirements
@@ -1,5 +1,5 @@
package GaudiMP
-version v1r6
+version v1r7
branches GaudiMP cmt doc src dict python scripts
diff --git a/GaudiMP/doc/release.notes b/GaudiMP/doc/release.notes
index 087ed95..e0d07d9 100644
--- a/GaudiMP/doc/release.notes
+++ b/GaudiMP/doc/release.notes
@@ -1,6 +1,13 @@
Package: GaudiMP
Package manager : Sebastien Binet
+================================ GaudiMP v1r7 ================================
+! 2013-01-15 - Nathalie Rauschmayr
+ - Patch #5593: Implemented late forking for GaudiMP
+ Implemented late forking on the level of the worker processes. After
+ Application Manager has been initialized and before the first event has been
+ processed, subworkers are forked by the main worker.
+
================================ GaudiMP v1r6 ================================
! 2012-11-14 - Marco Clemencic
- Updated CMakeLists.txt.
diff --git a/GaudiMP/python/GaudiMP/GMPBase.py b/GaudiMP/python/GaudiMP/GMPBase.py
index 32beb6c..d6156ff 100644
--- a/GaudiMP/python/GaudiMP/GMPBase.py
+++ b/GaudiMP/python/GaudiMP/GMPBase.py
@@ -8,7 +8,7 @@ from multiprocessing import cpu_count, current_process
from multiprocessing.queues import Empty
from pTools import *
import time, sys, os
-
+from ROOT import TParallelMergingFile
# This script contains the bases for the Gaudi MultiProcessing (GMP)
# classes
@@ -43,7 +43,7 @@ WAIT_SINGLE_EVENT = 60*6
WAIT_FINALISE = 60*2
STEP_INITIALISE = 10
STEP_EVENT = 2
-STEP_FINALISE = 5
+STEP_FINALISE = 10
# My switch for direct switching on/off Smaps Algorithm in GaudiPython AppMgr
SMAPS = False
@@ -197,10 +197,11 @@ class CollectHistograms( PyAlgorithm ) :
def execute( self ) :
return SUCCESS
def finalize( self ) :
- self.log.info('CollectHistograms Finalise (%s)'%(self._gmpc.nodeType))
+ self.log.info('CollectHistograms Finalise (%s)'%(self._gmpc.nodeType))
self._gmpc.hDict = self._gmpc.dumpHistograms( )
ks = self._gmpc.hDict.keys()
self.log.info('%i Objects in Histogram Store'%(len(ks)))
+
# crashes occurred due to Memory Error during the sending of hundreds
# histos on slc5 machines, so instead, break into chunks
# send 100 at a time
@@ -211,7 +212,7 @@ class CollectHistograms( PyAlgorithm ) :
smalld = dict( [(key, self._gmpc.hDict[key]) for key in someKeys] )
self._gmpc.hq.put( (self._gmpc.nodeID, smalld) )
# "finished" Notification
- self.log.debug('Signalling end of histos to Writer')
+ self.log.debug('Signalling end of histos to Writer')
self._gmpc.hq.put( 'HISTOS_SENT' )
self.log.debug( 'Waiting on Sync Event' )
self._gmpc.sEvent.wait()
@@ -284,13 +285,14 @@ class EventCommunicator( object ) :
return itemIn
def finalize( self ) :
- self.log.info('Finalize Event Communicator : %s'%(self._gmpc.nodeType))
+ self.log.info('Finalize Event Communicator : %s %s'%(self._gmpc, self._gmpc.nodeType))
# Reader sends one flag for each worker
# Workers send one flag each
# Writer sends nothing (it's at the end of the chain)
if self._gmpc.nodeType == 'Reader' : downstream = self._gmpc.nWorkers
elif self._gmpc.nodeType == 'Writer' : downstream = 0
elif self._gmpc.nodeType == 'Worker' : downstream = 1
+
for i in xrange(downstream) :
self.qout.put( 'FINISHED' )
if self._gmpc.nodeType != 'Writer' :
@@ -395,7 +397,7 @@ class GMPComponent( object ) :
# -1 for reader
# -2 for writer
# 0,...,nWorkers-1 for the Workers
- def __init__( self, nodeType, nodeID, queues, events, params ) :
+ def __init__( self, nodeType, nodeID, queues, events, params, subworkers ) :
# declare a Gaudi MultiProcessing Node
# the nodeType is going to be one of Reader, Worker, Writer
# qPair is going to be a tuple of ( qin, qout )
@@ -414,13 +416,25 @@ class GMPComponent( object ) :
# necessary for knowledge of the system
self.nWorkers, self.sEvent, self.config, self.log = params
+ self.subworkers = subworkers
self.nodeID = nodeID
# describe the state of the node by the current Event Number
self.currentEvent = None
# Unpack the Queues : (events, histos, filerecords)
- qPair, histq, fq = queues
+ self.queues = queues
+ self.num = 0
+
+ ks = self.config.keys()
+ self.app = None
+ list = ["Brunel", "DaVinci", "Boole", "Gauss"]
+ for k in list:
+ if k in ks: self.app = k
+
+ def Start( self ) :
+ # define the separate process
+ qPair, histq, fq = self.queues
# Set up the Queue Mechanisms ( Event Communicators )
if self.nodeType == 'Reader' or self.nodeType == 'Worker' :
@@ -459,21 +473,13 @@ class GMPComponent( object ) :
self.firstEvTime = 0.0
self.tTime = 0.0
- # define the separate process
self.proc = Process( target=self.Engine )
-
- self.num = 0
-
- ks = self.config.keys()
- self.app = None
- list = ["Brunel", "DaVinci", "Boole", "Gauss"]
- for k in list:
- if k in ks: self.app = k
-
- def Start( self ) :
# Fork and start the separate process
self.proc.start()
+
+
+
def Engine( self ) :
# This will be the method carried out by the Node
# Different for all
@@ -526,6 +532,7 @@ class GMPComponent( object ) :
path = l
try :
n = self.evt[path].evtNumber()
+
return n
except :
# No evt number at this path
@@ -535,6 +542,7 @@ class GMPComponent( object ) :
# The Evt Number is in bank type 16, bank 0, data pt 4
try :
n = self.evt['/Event/DAQ/RawEvent'].banks(16)[0].data()[4]
+
return n
except :
pass
@@ -548,7 +556,7 @@ class GMPComponent( object ) :
else:
if self.nodeID == -1:
self.num = self.num + 1
- self.log.info( 'Evt Number %d' % self.num )
+
return self.num
def IdentifyWriters( self ) :
@@ -605,10 +613,9 @@ class GMPComponent( object ) :
self.StartGaudiPython( )
if self.app == 'Gauss':
-
+
tool = self.a.tool( "ToolSvc.EvtCounter" )
self.cntr = InterfaceCast( gbl.IEventCounter )( tool.getInterface() )
- self.log.info("interface %s" %self.cntr)
else:
self.cntr = None
@@ -639,8 +646,8 @@ class GMPComponent( object ) :
# =============================================================================
class Reader( GMPComponent ) :
- def __init__( self, queues, events, params ) :
- GMPComponent.__init__(self, 'Reader', -1, queues, events, params )
+ def __init__( self, queues, events, params, subworkers ) :
+ GMPComponent.__init__(self, 'Reader', -1, queues, events, params, subworkers )
def processConfiguration( self ) :
# Reader :
@@ -652,7 +659,7 @@ class Reader( GMPComponent ) :
if "HistogramPersistencySvc" in self.config.keys() :
self.config[ 'HistogramPersistencySvc' ].OutputFile = ''
self.config['MessageSvc'].Format = '[Reader]% F%18W%S%7W%R%T %0W%M'
- self.evtMax = self.config[ 'ApplicationMgr' ].EvtMax
+ self.evtMax = self.config[ 'ApplicationMgr' ].EvtMax
def DumpEvent( self ) :
tb = TBufferFile( TBuffer.kWrite )
@@ -706,6 +713,13 @@ class Reader( GMPComponent ) :
return SUCCESS
def Engine( self ) :
+ # rename process
+ import os
+ import ctypes
+ libc = ctypes.CDLL('libc.so.6')
+ name = str(self.nodeType) + str(self.nodeID) + '\0'
+ libc.prctl(15,name,0,0,0)
+
startEngine = time.time()
self.log.name = 'Reader'
@@ -759,18 +773,183 @@ class Reader( GMPComponent ) :
self.Report()
# =============================================================================
+class Subworker(GMPComponent):
+ def __init__( self, workerID, queues, events, params, subworkers ) :
+ GMPComponent.__init__(self,'Worker', workerID, queues, events, params, subworkers )
+ # Identify the writer streams
+ self.writerDict = self.IdentifyWriters( )
+ # Identify the accept/veto checks for each event
+ self.acceptAlgs, self.requireAlgs, self.vetoAlgs = self.getCheckAlgs()
+ self.log.info("Subworker-%i Created OK"%(self.nodeID))
+ self.eventOutput = True
+
+ def Engine( self ) :
+ # rename process
+ import os
+ import ctypes
+ libc = ctypes.CDLL('libc.so.6')
+ name = str(self.nodeType) + str(self.nodeID) + '\0'
+ libc.prctl(15,name,0,0,0)
+
+ self.initEvent.set()
+ startEngine = time.time()
+ msg = self.a.service('MessageSvc')
+ msg.Format = '[' + self.log.name + '] % F%18W%S%7W%R%T %0W%M'
+
+ self.log.name = "Worker-%i"%(self.nodeID)
+ self.log.info("Subworker %i starting Engine"%(self.nodeID))
+ self.filerecordsAgent = FileRecordsAgent(self)
+
+ # populate the TESSerializer itemlist
+ self.log.info('EVT WRITERS ON WORKER : %i'\
+ %( len(self.writerDict['events'])))
+
+ nEventWriters = len( self.writerDict[ "events" ] )
+ self.a.addAlgorithm( CollectHistograms(self) )
+
+ # Begin processing
+ Go = True
+ while Go :
+ packet = self.evcom.receive( )
+ if packet : pass
+ else : continue
+ if packet == 'FINISHED' : break
+ evtNumber, tbin = packet # unpack
+ if self.cntr != None:
+
+ self.cntr.setEventCounter( evtNumber )
+
+ self.nIn += 1
+ self.TS.Load( tbin )
+
+ t = time.time()
+ sc = self.a.executeEvent()
+ if self.nIn == 1 :
+ self.firstEvTime = time.time()-t
+ else :
+ self.rTime += (time.time()-t)
+ if sc.isSuccess() :
+ pass
+ else :
+ self.log.name = "Worker-%i"%(self.nodeID)
+ self.log.warning('Did not Execute Event')
+ self.evt.clearStore()
+ continue
+ if self.isEventPassed() :
+ pass
+ else :
+ self.log.name = "Worker-%i"%(self.nodeID)
+ self.log.warning( 'Event did not pass : %i'%(evtNumber) )
+ self.evt.clearStore()
+ continue
+ if self.eventOutput :
+ # It may be the case of generating Event Tags; hence
+ # no event output
+ self.currentEvent = self.getEventNumber( )
+ tb = self.TS.Dump( )
+ self.evcom.send( (self.currentEvent, tb) )
+ self.nOut += 1
+ self.inc.fireIncident(gbl.Incident('Subworker','EndEvent'))
+ self.eventLoopSyncer.set()
+ self.evt.clearStore( )
+ self.log.name = "Worker-%i"%(self.nodeID)
+ self.log.info('Setting <Last> Event %s' %(self.nodeID))
+ self.lastEvent.set()
+
+ self.evcom.finalize()
+ # Now send the FileRecords and stop/finalize the appMgr
+ self.filerecordsAgent.SendFileRecords()
+ self.tTime = time.time()-startEngine
+ self.Finalize()
+ self.Report()
+ #self.finalEvent.set()
+
+ def SetServices(self,a, evt, hvt, fsr, inc, pers, ts , cntr):
+ self.a = a
+ self.evt = evt
+ self.hvt = hvt
+ self.fsr = fsr
+ #self.inc = inc
+ self.inc = self.a.service('IncidentSvc','IIncidentSvc')
+ self.pers = pers
+ self.ts = ts
+ self.cntr = cntr
+ self.TS = TESSerializer( self.ts, self.evt,
+ self.nodeType, self.nodeID, self.log )
+
+
+ def getCheckAlgs( self ) :
+ '''
+ For some output writers, a check is performed to see if the event has
+ executed certain algorithms.
+ These reside in the AcceptAlgs property for those writers
+ '''
+ acc = []
+ req = []
+ vet = []
+ for m in self.writerDict[ "events" ] :
+ if hasattr(m.w, 'AcceptAlgs') : acc += m.w.AcceptAlgs
+ if hasattr(m.w, 'RequireAlgs') : req += m.w.RequireAlgs
+ if hasattr(m.w, 'VetoAlgs') : vet += m.w.VetoAlgs
+ return (acc, req, vet)
+
+
+ def checkExecutedPassed( self, algName ) :
+ if self.a.algorithm( algName )._ialg.isExecuted()\
+ and self.a.algorithm( algName )._ialg.filterPassed() :
+ return True
+ else :
+ return False
+
+ def isEventPassed( self ) :
+ '''
+ Check the algorithm status for an event.
+ Depending on output writer settings, the event
+ may be declined based on various criteria.
+ This is a transcript of the check that occurs in GaudiSvc::OutputStream
+ '''
+ passed = False
+
+ self.log.debug('self.acceptAlgs is %s'%(str(self.acceptAlgs)))
+ if self.acceptAlgs :
+ for name in self.acceptAlgs :
+ if self.checkExecutedPassed( name ) :
+ passed = True
+ break
+ else :
+ passed = True
+ self.log.debug('self.requireAlgs is %s'%(str(self.requireAlgs)))
+ for name in self.requireAlgs :
+ if self.checkExecutedPassed( name ) :
+ pass
+ else :
+ self.log.info('Evt declined (requireAlgs) : %s'%(name) )
+ passed = False
+
+ self.log.debug('self.vetoAlgs is %s'%(str(self.vetoAlgs)))
+ for name in self.vetoAlgs :
+ if self.checkExecutedPassed( name ) :
+ pass
+ else :
+ self.log.info( 'Evt declined : (vetoAlgs) : %s'%(name) )
+ passed = False
+ return passed
+
+# =============================================================================
class Worker( GMPComponent ) :
- def __init__( self, workerID, queues, events, params ) :
- GMPComponent.__init__(self,'Worker', workerID, queues, events, params)
+ def __init__( self, workerID, queues, events, params , subworkers ) :
+ GMPComponent.__init__(self,'Worker', workerID, queues, events, params, subworkers )
# Identify the writer streams
self.writerDict = self.IdentifyWriters( )
# Identify the accept/veto checks for each event
self.acceptAlgs, self.requireAlgs, self.vetoAlgs = self.getCheckAlgs()
- self.log.debug("Worker-%i Created OK"%(self.nodeID))
+ self.log.name = "Worker-%i"%(self.nodeID)
+ self.log.info("Worker-%i Created OK"%(self.nodeID))
self.eventOutput = True
def processConfiguration( self ) :
+
# Worker :
# No input
# No output
@@ -796,21 +975,29 @@ class Worker( GMPComponent ) :
# pass
#else :
# self.config[ 'MessageSvc' ].OutputLevel = ERROR
-
- try:
+
+ if self.app == "Gauss":
+ try:
if "ToolSvc.EvtCounter" not in self.config:
from Configurables import EvtCounter
counter = EvtCounter()
else:
counter = self.config["ToolSvc.EvtCounter"]
counter.UseIncident = False
- except:
+ except:
# ignore errors when trying to change the configuration of the EvtCounter
self.log.warning('Cannot configure EvtCounter')
def Engine( self ) :
+
+ # rename process
+ import os
+ import ctypes
+ libc = ctypes.CDLL('libc.so.6')
+ name = str(self.nodeType) + str(self.nodeID) + '\0'
+ libc.prctl(15,name,0,0,0)
+
startEngine = time.time()
- self.log.name = "Worker-%i"%(self.nodeID)
self.log.info("Worker %i starting Engine"%(self.nodeID))
self.Initialize()
self.filerecordsAgent = FileRecordsAgent(self)
@@ -846,11 +1033,7 @@ class Worker( GMPComponent ) :
self.log.info( 'There is no Event Output for this app' )
self.eventOutput = False
- # add the Histogram Collection Algorithm
- self.a.addAlgorithm( CollectHistograms(self) )
-
# Begin processing
- self.log.name = "Worker-%i"%(self.nodeID)
Go = True
while Go :
packet = self.evcom.receive( )
@@ -858,13 +1041,26 @@ class Worker( GMPComponent ) :
else : continue
if packet == 'FINISHED' : break
evtNumber, tbin = packet # unpack
- if self.cntr != None:
-
+ if self.cntr != None:
self.cntr.setEventCounter( evtNumber )
-
+
+ # subworkers are forked before the first event is processed
+ # reader-thread for ConDB must be closed and reopened in each subworker
+ # this is done by disconnect()
+ if self.nIn == 0:
+
+ self.log.info("Fork new subworkers and disconnect from CondDB")
+ condDB = self.a.service('CondDBCnvSvc', gbl.ICondDBReader)
+ condDB.disconnect()
+
+ # Fork subworkers and share services
+ for k in self.subworkers:
+ k.SetServices(self.a, self.evt, self.hvt, self.fsr, self.inc, self.pers, self.ts, self.cntr)
+ k.Start()
+ self.a.addAlgorithm( CollectHistograms(self) )
self.nIn += 1
self.TS.Load( tbin )
- # print 'Worker-%i : Event %i'%(self.nodeID, evtNumber)
+
t = time.time()
sc = self.a.executeEvent()
if self.nIn == 1 :
@@ -904,6 +1100,10 @@ class Worker( GMPComponent ) :
self.tTime = time.time()-startEngine
self.Report()
+ for k in self.subworkers:
+ self.log.info('Join subworkers')
+ k.proc.join()
+
def getCheckAlgs( self ) :
'''
For some output writers, a check is performed to see if the event has
@@ -965,8 +1165,8 @@ class Worker( GMPComponent ) :
# =============================================================================
class Writer( GMPComponent ) :
- def __init__( self, queues, events, params ) :
- GMPComponent.__init__(self,'Writer', -2, queues, events, params)
+ def __init__( self, queues, events, params, subworkers ) :
+ GMPComponent.__init__(self,'Writer', -2, queues, events, params, subworkers )
# Identify the writer streams
self.writerDict = self.IdentifyWriters( )
# This keeps track of workers as they finish
@@ -1017,8 +1217,15 @@ class Writer( GMPComponent ) :
newName=self.config[hs].OutputFile.replace('.',\
'.p%i.'%(self.nWorkers))
self.config[ hs ].OutputFile = newName
-
+
def Engine( self ) :
+ # rename process
+ import os
+ import ctypes
+ libc = ctypes.CDLL('libc.so.6')
+ name = str(self.nodeType) + str(self.nodeID) + '\0'
+ libc.prctl(15,name,0,0,0)
+
startEngine = time.time()
self.Initialize()
self.histoAgent = HistoAgent( self )
@@ -1035,6 +1242,7 @@ class Writer( GMPComponent ) :
continue
if packet == 'FINISHED' :
self.log.info('Writer got FINISHED flag : Worker %i'%(current))
+
self.status[current] = True
if all(self.status) :
self.log.info('FINISHED recd from all workers, break loop')
@@ -1113,17 +1321,19 @@ class Coord( object ) :
# params are common to al subprocesses
params = (self.nWorkers, self.histSyncEvent, self.config, self.log)
+ self.subworkers = []
# Declare SubProcesses!
- self.reader= Reader(self.getQueues(-1), self.getSyncEvents(-1), params)
+ for i in range(1, self.nWorkers ) :
+ sub = Subworker( i, self.getQueues(i), self.getSyncEvents(i), params, self.subworkers )
+ self.subworkers.append( sub )
+ self.reader= Reader(self.getQueues(-1), self.getSyncEvents(-1), params, self.subworkers)
self.workers = []
- for i in xrange( self.nWorkers ) :
- wk = Worker( i, self.getQueues(i), self.getSyncEvents(i), params )
- self.workers.append( wk )
- self.writer= Writer(self.getQueues(-2), self.getSyncEvents(-2), params)
+ wk = Worker( 0, self.getQueues(0), self.getSyncEvents(0), params, self.subworkers )
+ self.writer= Writer(self.getQueues(-2), self.getSyncEvents(-2), params, self.subworkers)
self.system = []
self.system.append(self.writer)
- [ self.system.append(w) for w in self.workers ]
+ self.system.append(wk)
self.system.append(self.reader)
def getSyncEvents( self, nodeID ) :
@@ -1143,8 +1353,11 @@ class Coord( object ) :
# Initialise
self.log.name = 'GaudiPython-Parallel-Logger'
self.log.info( 'INITIALISING SYSTEM' )
+
+ # Start reader, writer and main worker
for p in self.system :
p.Start()
+
sc = self.sInit.syncAll(step="Initialise")
if sc == SUCCESS: pass
else : self.Terminate() ; return FAILURE
diff --git a/GaudiMP/python/GaudiMP/pTools.py b/GaudiMP/python/GaudiMP/pTools.py
index 5053116..3a1f304 100644
--- a/GaudiMP/python/GaudiMP/pTools.py
+++ b/GaudiMP/python/GaudiMP/pTools.py
@@ -99,9 +99,11 @@ class HistoAgent( ) :
for tup in self.histos :
workerID, histDict = tup
added = 0 ; registered = 0; booked = 0
+
for n in histDict.keys() :
o = histDict[ n ]
obj = self.hvt.retrieve( n )
+
if obj :
try :
aida2root(obj).Add(o)
@@ -110,6 +112,7 @@ class HistoAgent( ) :
errors += 1
added += 1
else :
+
if o.__class__.__name__ in self.bookingDict.keys() :
try :
self.bookingDict[o.__class__.__name__](n, o)
@@ -569,10 +572,12 @@ class Syncer( object ) :
self.step = step
self.d = {}
self.manyEvents = manyEvents
+
for i in xrange(-2, nWorkers) :
self.d[ i ] = SyncMini( Event(), lastEvent=Event() )
if self.manyEvents :
self.limitFirst = firstEvent
+
self.keys = self.d.keys()
self.nWorkers = nWorkers
self.log = log
diff --git a/GaudiPolicy/CMakeLists.txt b/GaudiPolicy/CMakeLists.txt
index 2410599..2bfe4ce 100644
--- a/GaudiPolicy/CMakeLists.txt
+++ b/GaudiPolicy/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(GaudiPolicy v12r3)
+gaudi_subdir(GaudiPolicy v12r4)
#---Installation-----------------------------------------------------------------------------
gaudi_install_scripts()
diff --git a/GaudiPolicy/cmt/requirements b/GaudiPolicy/cmt/requirements
index 518273e..0d993df 100644
--- a/GaudiPolicy/cmt/requirements
+++ b/GaudiPolicy/cmt/requirements
@@ -1,5 +1,5 @@
package GaudiPolicy
-version v12r3
+version v12r4
branches cmt doc
diff --git a/GaudiPolicy/doc/release.notes b/GaudiPolicy/doc/release.notes
index 0608117..3bbb7f2 100644
--- a/GaudiPolicy/doc/release.notes
+++ b/GaudiPolicy/doc/release.notes
@@ -1,6 +1,18 @@
package GaudiPolicy
package manager: Marco Clemencic
+! 2013-02-08 - Marco Clemencic
+ - Improvements to the checker for Python files encoding.
+
+============================= GaudiPolicy v12r4 ==============================
+! 2013-01-25 - Marco Clemencic
+ - Ignore '.__afs**' when zipping Python directories
+ - Check that the Python files have the correct encoding.
+ http://www.python.org/dev/peps/pep-0263/
+
+! 2012-12-06 - Marco Clemencic
+ - Added to merge_files.py the possibility to ignore missing fragments.
+
============================= GaudiPolicy v12r3 ==============================
! 2012-11-20 - Marco Clemencic
- Modified createProjVersHeader.py to understand version 'HEAD' as v999r999.
diff --git a/GaudiPolicy/scripts/ZipPythonDir.py b/GaudiPolicy/scripts/ZipPythonDir.py
index 29df564..3a7bc0c 100755
--- a/GaudiPolicy/scripts/ZipPythonDir.py
+++ b/GaudiPolicy/scripts/ZipPythonDir.py
@@ -3,7 +3,14 @@
## file ZipPythonDir.py
# Script to generate a zip file that can replace a directory in the python path.
-import os, sys, zipfile, logging, stat, time
+import os
+import sys
+import zipfile
+import logging
+import stat
+import time
+import re
+import codecs
from StringIO import StringIO
# Add to the path the entry needed to import the locker module.
@@ -63,7 +70,8 @@ def _zipChanges(directory, infolist):
log.debug(" %s -> %s", action, filename)
else:
log.info(" %s -> %s", action, filename)
- elif ext not in [".pyc", ".pyo", ".stamp", ".cmtref"]: # extensions that can be ignored
+ # cases that can be ignored
+ elif ext not in [".pyc", ".pyo", ".stamp", ".cmtref"] and not f.startswith('.__afs'):
raise ZipdirError("Cannot add '%s' to the zip file, only '.py' are allowed." % os.path.join(arcdir, f))
# check for removed files
for filename in infos:
@@ -72,6 +80,43 @@ def _zipChanges(directory, infolist):
log.info(" %s -> %s", "R", filename)
return (added, modified, untouched, removed)
+def checkEncoding(fileObj):
+ '''
+ Check that a file honors the declared encoding (default ASCII for Python 2
+ and UTF-8 for Python 3).
+
+ Raises a UnicodeDecodeError in case of decoding problems and LookupError if
+ the specified codec does not exists.
+
+ See http://www.python.org/dev/peps/pep-0263/
+ '''
+ from itertools import islice
+
+ # default encoding
+ if sys.version_info[0] <= 2:
+ enc = 'ascii'
+ else:
+ enc = 'utf-8'
+
+ # find the encoding of the file, if specified (in the first two lines)
+ enc_exp = re.compile(r"coding[:=]\s*([-\w.]+)")
+ for l in islice(fileObj, 2):
+ m = enc_exp.search(l)
+ if m:
+ enc = m.group(1)
+ break
+
+ if hasattr(fileObj, 'name'):
+ logging.getLogger('checkEncoding').debug('checking encoding %s on %s',
+ enc, fileObj.name)
+ else:
+ logging.getLogger('checkEncoding').debug('checking encoding %s on file object',
+ enc)
+ # try to read the file with the declared encoding
+ fileObj.seek(0)
+ codecs.getreader(enc)(fileObj).read()
+
+
## Make a zip file out of a directory containing python modules
def zipdir(directory, no_pyc = False):
log = logging.getLogger("zipdir")
@@ -104,6 +149,7 @@ def zipdir(directory, no_pyc = False):
z = zipfile.PyZipFile(tempBuf, "w", zipfile.ZIP_DEFLATED)
for f in added + modified + untouched:
src = os.path.join(directory, f)
+ checkEncoding(open(src, 'rb'))
if no_pyc:
log.debug("adding '%s'", f)
z.write(src, f)
@@ -121,6 +167,11 @@ def zipdir(directory, no_pyc = False):
log.info("File '%s' closed", filename)
else:
log.info("Nothing to do on '%s'", filename)
+ except UnicodeDecodeError, x:
+ log.error("Wrong encoding in file '%s':", src)
+ log.error(" %s", x)
+ log.error("Probably you forgot the line '# -*- coding: utf-8 -*-'")
+ sys.exit(1)
finally:
locker.unlock(zipFile)
zipFile.close()
diff --git a/GaudiPolicy/scripts/merge_files.py b/GaudiPolicy/scripts/merge_files.py
index 6d4347f..4f4f0fc 100755
--- a/GaudiPolicy/scripts/merge_files.py
+++ b/GaudiPolicy/scripts/merge_files.py
@@ -9,7 +9,7 @@ import sys
from datetime import datetime
import locker
-def mergeFiles( fragFileNames, mergedFileName, commentChar, doMerge ):
+def mergeFiles( fragFileNames, mergedFileName, commentChar, doMerge, ignoreMissing ):
startMark = "%s --Beg " % commentChar
timeMark = "%s --Date inserted: %s" % (commentChar, datetime.now())
@@ -54,6 +54,9 @@ def mergeFiles( fragFileNames, mergedFileName, commentChar, doMerge ):
if doMerge:
for f in fragFileNames:
+ if ignoreMissing and not os.path.exists(f):
+ print "WARNING: '%s' does not exist, I'm ignoring it" % f
+ continue
# I do not want to add 2 empty lines at the beginning of a file
if newLines:
newLines.append('\n\n')
@@ -129,6 +132,12 @@ if __name__ == "__main__":
action = "store_true",
help = "Do no create stamp files."
)
+ parser.add_option(
+ "--ignore-missing",
+ dest = "ignoreMissing",
+ action = "store_true",
+ help = "Print a warning if a fragment file is missing, but do not fail."
+ )
(options, args) = parser.parse_args()
@@ -167,7 +176,8 @@ if __name__ == "__main__":
if True: #try:
sc = mergeFiles( options.fragFileNames, options.mergedFileName,
options.commentChar,
- doMerge = options.doMerge )
+ doMerge = options.doMerge,
+ ignoreMissing = options.ignoreMissing)
if not options.no_stamp:
for stamp in map(stampFileName, options.fragFileNames):
open(stamp, 'w')
diff --git a/GaudiPython/CMakeLists.txt b/GaudiPython/CMakeLists.txt
index ee9a646..a8a62d3 100644
--- a/GaudiPython/CMakeLists.txt
+++ b/GaudiPython/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(GaudiPython v12r4)
+gaudi_subdir(GaudiPython v12r5)
gaudi_depends_on_subdirs(GaudiAlg GaudiUtils GaudiKernel)
diff --git a/GaudiPython/cmt/requirements b/GaudiPython/cmt/requirements
index 2b3830d..5386456 100644
--- a/GaudiPython/cmt/requirements
+++ b/GaudiPython/cmt/requirements
@@ -1,5 +1,5 @@
package GaudiPython
-version v12r4
+version v12r5
branches GaudiPython cmt doc src
diff --git a/GaudiPython/dict/kernel.h b/GaudiPython/dict/kernel.h
index 3fe741b..9a8b0ae 100644
--- a/GaudiPython/dict/kernel.h
+++ b/GaudiPython/dict/kernel.h
@@ -78,6 +78,7 @@
#include "GaudiUtils/IIODataManager.h"
#include "GaudiUtils/HistoStats.h"
#include "GaudiUtils/HistoDump.h"
+#include "GaudiUtils/HistoStrings.h"
#include <iostream>
#include <istream>
diff --git a/GaudiPython/dict/selection_kernel.xml b/GaudiPython/dict/selection_kernel.xml
index e62f8af..15ee2ec 100644
--- a/GaudiPython/dict/selection_kernel.xml
+++ b/GaudiPython/dict/selection_kernel.xml
@@ -1,5 +1,5 @@
<lcgdict>
- <class name = "__gnu_cxx::dummy" />
+ <class name = "__gnu_cxx::dummy" />
<!--class pattern = "GaudiPython::Interface<*>"/-->
<class pattern = "std::unary_function<*>"/>
<class name = "GaudiPython::Helper"/>
@@ -7,23 +7,23 @@
<class name = "std::vector<Property*>" />
<class name = "std::vector<const Property*>"/>
<class name = "std::vector<std::basic_string<char> >" rootmap="false"/>
- <class name = "std::vector<std::vector<double> >" rootmap="false"/>
+ <class name = "std::vector<std::vector<double> >" rootmap="false"/>
<class name = "std::vector<IRegistry*>"/>
<class name = "std::ostream"/>
<!--class name = "std::basic_ostream<char,std::char_traits<char> >" rootmap="false"/-->
<class name = "std::basic_stringbuf<char,std::char_traits<char>,std::allocator<char> >" rootmap="false"/>
<class name = "std::map<std::basic_string<char>,std::basic_string<char> >" rootmap="false"/>
<class pattern = "std::_Bit_reference*"/>
-
+
<class name = "std::list<IAlgorithm*>"/>
<class name = "std::list<IService*>"/>
<class name = "std::list<const IFactory*>"/>
-
+
<class name = "std::allocator<IRegistry*>"/>
<class name = "std::allocator<IAlgorithm*>"/>
<class name = "std::allocator<IService*>"/>
-
-
+
+
<class name = "std::vector<IAlgTool*>" />
<class name = "std::vector<const StatEntity*>" />
<class name = "std::vector<GaudiAlg::ID>" />
@@ -34,7 +34,8 @@
<class name = "std::vector<AIDA::IProfile2D*>" />
<function name = "Gaudi::Utils::Histos::path" />
<function name = "Gaudi::Utils::Histos::histoDump" />
-
+ <class name = "Gaudi::Utils::Histos::HistoStrings" />
+
<class pattern = "SimpleProperty<*>"/>
<class pattern = "SimplePropertyRef<*>"/>
<class pattern = "BoundedVerifier<*>"/>
@@ -43,7 +44,7 @@
<class name = "GaudiHandleProperty" />
<class name = "GaudiHandleArrayProperty" />
-
+
<class pattern = "GaudiAlg::*" />
<class name = "GaudiAlgorithm" />
<class name = "GaudiHistoAlg" />
@@ -62,23 +63,23 @@
<class name = "Stat" />
<class pattern = "Chrono*" />
-
+
<class pattern = "Property*Functor" />
<class pattern = "SimpleProperty<*>" />
<class pattern = "SimplePropertyRef<*>" />
<class pattern = "PropertyWithVerifier<*>" />
- <class pattern = "PropertyWithValue<*>">
+ <class pattern = "PropertyWithValue<*>">
<field name="m_value" transient="true"/>
</class>
<class pattern = "BoundedVerifier<*>" />
<class pattern = "PropertyVerifier<*>" />
-
+
<class pattern = "AIDA::I*" />
<class name = "GaudiPython::PyAlgorithm"/>
<class name = "GaudiPython::CallbackStreamBuf"/>
<class name = "ParticleProperty"/>
<class name = "InterfaceID"/>
-
+
<class name = "Gaudi::StringKey" />
<class name = "Gaudi::Utils::MapBase" />
@@ -87,22 +88,22 @@
<class name = "IHistoTool" />
<class name = "ITupleTool" />
<class name = "ISequencerTimerTool" />
-
+
<function name= "Gaudi::Utils::hasProperty" />
-
+
<class name = "Gaudi::IFileCatalog" />
<class name = "Gaudi::IFileCatalogMgr" />
<class name = "Gaudi::IDataConnection" />
<class name = "Gaudi::IIODataManager" />
-
+
<enum name= "Gaudi::Utils::Histos::Formats::Format" />
<function name= "Gaudi::Utils::Histos::Formats::format" />
<function name= "Gaudi::Utils::Histos::Formats::header" />
<function name= "Gaudi::Utils::Histos::format" />
<class name= "Gaudi::Utils::Histos::Table" />
- <class name= "Gaudi::Utils::HistoStats" />
+ <class name= "Gaudi::Utils::HistoStats" />
- <class name= "Gaudi::RangeBase_" />
+ <class name= "Gaudi::RangeBase_" />
<exclusion>
<class name = "GaudiAlg::ID::LiteralID" />
@@ -120,18 +121,18 @@
<class pattern = "std::unary_function<std::pair<*,NTuple::*>" />
<class pattern = "std::unary_function<std::pair<*,AIDA::*>" />
<class name = "GaudiPython::CallbackStreamBuf">
- <!-- assignement operator and copy constructor cannot compile -->
+ <!-- assignment operator and copy constructor cannot compile -->
<method name="="/>
<method proto_pattern="CallbackStreamBuf*CallbackStreamBuf*"/>
</class>
<class pattern = "std::basic_ostream&lt;char*">
- <!-- assignement operator and copy constructor cannot compile -->
+ <!-- assignment operator and copy constructor cannot compile -->
<method name="="/>
<!-- We should exclude only the copy constructor, but I did not manage to do it -->
<!--method pattern="basic_ostream*"/-->
</class>
<class pattern = "std::basic_stringbuf&lt;char*">
- <!-- assignement operator cannot compile -->
+ <!-- assignment operator cannot compile -->
<method name="="/>
</class>
</exclusion>
diff --git a/GaudiPython/doc/release.notes b/GaudiPython/doc/release.notes
index 35895a8..77f8c2e 100644
--- a/GaudiPython/doc/release.notes
+++ b/GaudiPython/doc/release.notes
@@ -1,6 +1,10 @@
Package: GaudiPython
Package manager : Marco Clemencic
+============================= GaudiPython v12r5 ==============================
+! 2013-01-24 - Marco Clemencic
+ - Added dictionaries for HistoStrings (GaudiUtils).
+
============================= GaudiPython v12r4 ==============================
! 2012-10-26 - Marco Clemencic
- Stop execution (in AppMgr.run()) if the return code of the application is not
diff --git a/GaudiRelease/cmt/requirements b/GaudiRelease/cmt/requirements
index 5c2bd02..323c263 100644
--- a/GaudiRelease/cmt/requirements
+++ b/GaudiRelease/cmt/requirements
@@ -3,33 +3,33 @@
package GaudiRelease
-version v23r5
+version v23r6
branches doc cmt
# CMT and Gaudi policy
-use GaudiPolicy v12r3
+use GaudiPolicy v12r4
# Gaudi executable
-use Gaudi v23r5
+use Gaudi v23r6
# Gaudi libraries - generic
-use GaudiKernel v28r4
+use GaudiKernel v28r5
use GaudiCoreSvc v1r3
use GaudiCommonSvc v1r4
use GaudiSvc v19r3
use GaudiAud v9r8
use GaudiAlg v14r4
use GaudiGSL v7r12
-use GaudiUtils v4r3
+use GaudiUtils v4r4
use GaudiPartProp v1r2
# Technology-specific Persistency packages
use RootCnv v1r19
use RootHistCnv v11r2
-use GaudiPython v12r4
+use GaudiPython v12r5
# Container package specifying the minimum set of core packages
-use GaudiSys v23r5
+use GaudiSys v23r6
# Monitoring utilities.
use GaudiMonitor v3r2
@@ -38,10 +38,10 @@ use GaudiMonitor v3r2
use GaudiProfiling v1r7
# Multi Processing libraries
-use GaudiMP v1r6
+use GaudiMP v1r7
# Examples packages
-use GaudiExamples v23r5
+use GaudiExamples v23r6
# Atlas packages
diff --git a/GaudiRelease/cmt/update_versions.py b/GaudiRelease/cmt/update_versions.py
index 5f1c259..c3df08c 100755
--- a/GaudiRelease/cmt/update_versions.py
+++ b/GaudiRelease/cmt/update_versions.py
@@ -81,7 +81,7 @@ def gather_new_versions(f):
return versions
def extract_recent_rel_notes(filename):
- changelog_entry = re.compile(r'^(! [0-9]{4}-[0-9]{2}-[0-9]{2} -)|============')
+ changelog_entry = re.compile(r'^(! [0-9]{4}-[0-9]{2}-[0-9]{2} -)|!?============')
separator_entry = re.compile(r'^!?============')
notes = []
state = "searching"
@@ -217,5 +217,14 @@ def main():
out.append(l)
open(global_rel_notes, "w").writelines(out)
+ # update the global CMakeLists.txt
+ global_cmakelists = os.path.join("..","..","CMakeLists.txt")
+ out = []
+ for l in open(global_cmakelists):
+ if l.strip().startswith('gaudi_project'):
+ l = 'gaudi_project(Gaudi %s)\n' % new_version
+ out.append(l)
+ open(global_cmakelists, "w").writelines(out)
+
if __name__ == '__main__':
main()
diff --git a/GaudiRelease/doc/release.notes b/GaudiRelease/doc/release.notes
index 86be929..90c0627 100644
--- a/GaudiRelease/doc/release.notes
+++ b/GaudiRelease/doc/release.notes
@@ -1,6 +1,13 @@
Package: GaudiRelease
Manatiner: Marco Clemencic
+! 2013-02-15 - Marco Clemencic
+ - Fixed update_versions.py to change the version in the global CMakeLists.txt.
+
+============================= GaudiRelease v23r6 =============================
+! 2013-01-28 - Marco Clemencic
+ - Minor fix to update_versions.py.
+
============================= GaudiRelease v23r5 =============================
============================= GaudiRelease v23r4 =============================
! 2012-09-13 - Marco Clemencic
diff --git a/GaudiRelease/doc/release.notes.html b/GaudiRelease/doc/release.notes.html
index 1fc5f52..91dff98 100644
--- a/GaudiRelease/doc/release.notes.html
+++ b/GaudiRelease/doc/release.notes.html
@@ -38,6 +38,50 @@ Package Coordinator: Marco Clemencic, Charles Leggett<br>
Purpose: Gaudi common set of packages<br><br>
</pre>
<!-- ====================================================================== -->
+<h2><a name="v23r6">Gaudi v23r6</a> (2013-01-28)</h2>
+<h3>Externals version: <a href="http://lcgsoft.cern.ch/index.py?page=cfg_overview&cfg=64c">LCGCMT_64c</a></h3>
+<h3>General Changes</h3>
+<ul>
+<li>Improvements and fixes to the CMake configuration and modules.<br/>
+ (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+<h3>Packages Changes</h3>
+<ul>
+<li>GaudiPolicy (v12r4):
+<ul>
+<li>Modified Python zipping to fail if coding is not correct.<br/>
+ (<span class="author">Marco Clemencic</span>)</li>
+<li>Minor fixes.<br/>
+ (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiKernel (v28r5):
+<ul>
+<li>Minor change in ConversionSvc constructor to avoid a pointless call to
+ queryInterface.<br/>
+ (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiUtils (v4r4):
+<ul>
+<li> Patch #5594: fix for parsing of 1D histograms with non-equidistant binnings.<br/>
+ (<span class="author">Vanya Belyaev</span>)</li>
+</ul>
+</li>
+<li>GaudiPython (v12r5):
+<ul>
+<li>Added dictionaries for HistoStrings (GaudiUtils).<br/>
+ (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiMP (v1r7):
+<ul>
+<li>Patch #5593: Implemented late forking for GaudiMP.<br/>
+ (<span class="author">Nathalie Rauschmayr</span>)</li>
+</ul>
+</li>
+</ul>
+<!-- ====================================================================== -->
<h2><a name="v23r5">Gaudi v23r5</a> (2012-11-26)</h2>
<h3>Externals version: <a href="http://lcgsoft.cern.ch/index.py?page=cfg_overview&cfg=64b">LCGCMT_64b</a></h3>
<h3>General Changes</h3>
diff --git a/GaudiSys/cmt/requirements b/GaudiSys/cmt/requirements
index 6120f38..9b5adf8 100644
--- a/GaudiSys/cmt/requirements
+++ b/GaudiSys/cmt/requirements
@@ -1,5 +1,5 @@
package GaudiSys
-version v23r5
+version v23r6
branches doc cmt
diff --git a/GaudiSys/doc/release.notes b/GaudiSys/doc/release.notes
index 87f4322..1bb84c6 100644
--- a/GaudiSys/doc/release.notes
+++ b/GaudiSys/doc/release.notes
@@ -1,6 +1,7 @@
package GaudiSys
package manager: Pere Mato
+=============================== GaudiSys v23r6 ===============================
=============================== GaudiSys v23r5 ===============================
=============================== GaudiSys v23r4 ===============================
=============================== GaudiSys v23r3 ===============================
diff --git a/GaudiUtils/CMakeLists.txt b/GaudiUtils/CMakeLists.txt
index 9c52eca..6d4d046 100644
--- a/GaudiUtils/CMakeLists.txt
+++ b/GaudiUtils/CMakeLists.txt
@@ -1,4 +1,4 @@
-gaudi_subdir(GaudiUtils v4r3)
+gaudi_subdir(GaudiUtils v4r4)
gaudi_depends_on_subdirs(GaudiKernel)
diff --git a/GaudiUtils/cmt/requirements b/GaudiUtils/cmt/requirements
index 5f5350a..5f2faa0 100644
--- a/GaudiUtils/cmt/requirements
+++ b/GaudiUtils/cmt/requirements
@@ -1,6 +1,6 @@
# =============================================================================
package GaudiUtils
-version v4r3
+version v4r4
# ============== structure ====================================================
branches GaudiUtils src cmt doc
diff --git a/GaudiUtils/doc/release.notes b/GaudiUtils/doc/release.notes
index b533ceb..275fdf1 100644
--- a/GaudiUtils/doc/release.notes
+++ b/GaudiUtils/doc/release.notes
@@ -1,6 +1,10 @@
Package: GaudiUtils
Package manager : Marco Clemencic
+============================== GaudiUtils v4r4 ===============================
+! 2013-01-22 - Vanya Belyaev
+ - Patch #5594: fix for parsing of 1D histograms with non-equidistant binnings
+
============================== GaudiUtils v4r3 ===============================
! 2012-11-14 - Marco Clemencic
- Updated CMakeLists.txt.
diff --git a/GaudiUtils/src/Lib/Histo2String.cpp b/GaudiUtils/src/Lib/Histo2String.cpp
index c4e3d51..cfba5e1 100644
--- a/GaudiUtils/src/Lib/Histo2String.cpp
+++ b/GaudiUtils/src/Lib/Histo2String.cpp
@@ -49,6 +49,8 @@ namespace
//
const TAxis* axis = histo.GetXaxis() ;
const unsigned int nBins = axis->GetNbins() ;
+ //
+ stream << std::endl << "'X' : { " ;
if ( axis->IsVariableBinSize() )
{
const TArrayD* xbins = axis->GetXbins() ;
@@ -56,19 +58,17 @@ namespace
std::vector<double> edges ;
for ( unsigned int iBin = 0 ; iBin < xsize ; ++iBin )
{ edges.push_back ( xbins->At( iBin ) ) ; }
- // the edges
- stream << std::endl ;
stream << "'edges' : " ;
- Gaudi::Utils::toStream ( edges , stream ) << " ," << std::endl;
+ Gaudi::Utils::toStream ( edges , stream ) << " }, " << std::endl;
}
else
{
stream << "'nbins' : " ;
- Gaudi::Utils::toStream ( nBins , stream ) << " , " ;
+ Gaudi::Utils::toStream ( nBins , stream ) << " , " ;
stream << "'low' : " ;
- Gaudi::Utils::toStream ( axis->GetXmin () , stream ) << " , " ;
+ Gaudi::Utils::toStream ( axis->GetXmin () , stream ) << " , " ;
stream << "'high' : " ;
- Gaudi::Utils::toStream ( axis->GetXmax () , stream ) << " , " << std::endl ;
+ Gaudi::Utils::toStream ( axis->GetXmax () , stream ) << " }, " << std::endl ;
}
// finally: the content
std::vector<std::pair<double,double> > bins ;
diff --git a/GaudiUtils/src/Lib/HistoParsers.cpp b/GaudiUtils/src/Lib/HistoParsers.cpp
index e3f9b6c..2b33447 100644
--- a/GaudiUtils/src/Lib/HistoParsers.cpp
+++ b/GaudiUtils/src/Lib/HistoParsers.cpp
@@ -80,9 +80,9 @@ namespace Gaudi
| enc::char_('{')[qi::_val='}']
| enc::char_('(')[qi::_val=')'];
end = enc::char_(qi::_r1);
- result = begin[qi::_a = qi::_1]
- >> inner[qi::_val = qi::_1]
- >> end(qi::_a);
+ result = begin[qi::_a = qi::_1]
+ >> inner[qi::_val = qi::_1]
+ >> end(qi::_a) ;
}
VectorGrammar<Iterator, std::vector<double>, Skipper> edges ;
RealGrammar<Iterator, double, Skipper> low, high;
@@ -113,9 +113,9 @@ namespace Gaudi
|
(( qi::lit("title") | "'title'" | "\"title\"" )
>> ":" >> title [ qi::_val /= qi::_1 ])
- |
- (( qi::lit("X") | "'X'" | "\"X\"" | "x" | "'x'" | "\"x\"" ) >> ':'
- >> edges [ qi::_val &= qi::_1 ])
+ |
+ ( -(( qi::lit("X") | "'X'" | "\"X\"" | "x" | "'x'" | "\"x\"" ) >> ':' )
+ >> edges [ qi::_val &= qi::_1 ])
|
(( qi::lit("nbins") | "'nbins'" | "\"nbins\"" )
>> ":" >> nbins [qi::_val |= qi::_1])
diff --git a/cmake/EnvConfig/Control.py b/cmake/EnvConfig/Control.py
index d54da8b..c648ea0 100644
--- a/cmake/EnvConfig/Control.py
+++ b/cmake/EnvConfig/Control.py
@@ -316,7 +316,7 @@ class Environment():
Call the variable processors on all the variables.
'''
for v in self.variables.values():
- v.val = v.process(val, self.variables)
+ v.val = v.process(v.val, self.variables)
def _concatenate(self, value):
'''Returns a variable string with separator separator from the values list'''
diff --git a/cmake/GaudiProjectConfig.cmake b/cmake/GaudiProjectConfig.cmake
index c9d95e8..c3bcddb 100644
--- a/cmake/GaudiProjectConfig.cmake
+++ b/cmake/GaudiProjectConfig.cmake
@@ -228,9 +228,10 @@ macro(gaudi_project project version)
#--- Project Installations------------------------------------------------------------------------
install(DIRECTORY cmake/ DESTINATION cmake
FILES_MATCHING PATTERN "*.cmake"
- PATTERN ".svn" EXCLUDE )
- install(PROGRAMS cmake/testwrap.sh cmake/testwrap.csh cmake/testwrap.bat cmake/genCMake.py cmake/env.py DESTINATION scripts OPTIONAL)
- install(DIRECTORY cmake/EnvConfig DESTINATION scripts FILES_MATCHING PATTERN "*.py" PATTERN "*.conf")
+ PATTERN ".svn" EXCLUDE)
+ install(PROGRAMS cmake/env.py DESTINATION scripts OPTIONAL)
+ install(DIRECTORY cmake/EnvConfig DESTINATION scripts
+ FILES_MATCHING PATTERN "*.py" PATTERN "*.conf")
#--- Global actions for the project
#message(STATUS "CMAKE_MODULE_PATH -> ${CMAKE_MODULE_PATH}")
@@ -278,7 +279,9 @@ macro(gaudi_project project version)
gaudi_merge_files(DictRootmap lib ${CMAKE_PROJECT_NAME}Dict.rootmap)
# FIXME: it is not possible to produce the file python.zip at installation time
- # because of http://public.kitware.com/Bug/view.php?id=8438
+ # because the install scripts of the subdirectories are executed after those
+ # of the parent project and we cannot have a post-install target because of
+ # http://public.kitware.com/Bug/view.php?id=8438
# install(CODE "execute_process(COMMAND ${zippythondir_cmd} ${CMAKE_INSTALL_PREFIX}/python)")
add_custom_target(python.zip
COMMAND ${zippythondir_cmd} ${CMAKE_INSTALL_PREFIX}/python
@@ -816,11 +819,10 @@ macro(gaudi_collect_subdir_deps)
foreach(var ${vars})
# extract the individual subdir names
string(REGEX REPLACE "gaudi_depends_on_subdirs *\\(([^)]+)\\)" "\\1" __p ${var})
- string(REGEX REPLACE "(\r?\n)+$" "" ___p "${___p}")
+ # (replace space-type chars with spaces)
+ string(REGEX REPLACE "[\t\r\n]+" " " __p "${__p}")
separate_arguments(__p)
foreach(___p ${__p})
- # remove newlines in the matched subdir name
- string(REGEX REPLACE "(\r?\n)+$" "" ___p "${___p}")
# check that the declared dependency refers to an existing (known) package
list(FIND known_packages ${___p} idx)
if(idx LESS 0)
@@ -996,10 +998,14 @@ function(gaudi_resolve_link_libraries variable)
foreach(package ${ARGN})
# check if it is an actual library or a target first
if(TARGET ${package})
+ #message(STATUS "${package} is a TARGET")
set(collected ${collected} ${package})
get_target_property(libs ${package} REQUIRED_LIBRARIES)
- set(to_be_resolved ${to_be_resolved} ${libs})
+ if(libs)
+ set(to_be_resolved ${to_be_resolved} ${libs})
+ endif()
elseif(EXISTS ${package}) # it's a real file
+ #message(STATUS "${package} is a FILE")
set(collected ${collected} ${package})
else()
# it must be an available package
@@ -1084,8 +1090,20 @@ function(gaudi_merge_files merge_tgt dest filename)
add_custom_target(Merged${merge_tgt} ALL DEPENDS ${output})
# prepare the high level dependencies
add_dependencies(Merged${merge_tgt} ${deps})
+
+ # target to generate a partial merged file
+ add_custom_command(OUTPUT ${output}_force
+ COMMAND ${merge_cmd} --ignore-missing ${parts} ${output})
+ add_custom_target(Merged${merge_tgt}_force DEPENDS ${output}_force)
+ # ensure that we merge what we have before installing if the output was not
+ # produced
+ install(CODE "if(NOT EXISTS ${output})
+ message(WARNING \"creating partial ${output}\")
+ execute_process(COMMAND ${merge_cmd} --ignore-missing ${parts} ${output})
+ endif()")
+
# install rule for the merged DB
- install(FILES ${output} DESTINATION ${dest})
+ install(FILES ${output} DESTINATION ${dest} OPTIONAL)
endif()
endfunction()
@@ -1139,7 +1157,7 @@ function(gaudi_generate_configurables library)
gaudi_merge_files_append(ConfDB ${library}Conf ${outdir}/${library}_confDb.py)
#----Installation details-------------------------------------------------------
install(FILES ${outdir}/${library}_confDb.py ${outdir}/${library}Conf.py
- DESTINATION python/${package})
+ DESTINATION python/${package} OPTIONAL)
# Check if we need to install our __init__.py (i.e. it is not already installed
# with the python modules).
@@ -1150,7 +1168,7 @@ function(gaudi_generate_configurables library)
list(FIND python_modules ${package} got_pkg_module)
if(got_pkg_module LESS 0)
# we need to install our __init__.py
- install(FILES ${outdir}/__init__.py DESTINATION python/${package})
+ install(FILES ${outdir}/__init__.py DESTINATION python/${package} OPTIONAL)
endif()
endif()
@@ -1198,7 +1216,7 @@ function(gaudi_generate_confuserdb)
-o ${outdir}/${package}_user_confDb.py
${package} ${modules})
install(FILES ${outdir}/${package}_user_confDb.py
- DESTINATION python/${package})
+ DESTINATION python/${package} OPTIONAL)
gaudi_merge_files_append(ConfDB ${package}ConfUserDB ${outdir}/${package}_user_confDb.py)
# FIXME: dependency on others ConfUserDB
@@ -1346,7 +1364,7 @@ macro(gaudi_common_add_build)
CMAKE_PARSE_ARGUMENTS(ARG "" "" "LIBRARIES;LINK_LIBRARIES;INCLUDE_DIRS" ${ARGN})
# obsolete option
if(ARG_LIBRARIES)
- message(WARNING "Deprecated option 'LIBRARY', use 'LINK_LIBRARIES' instead")
+ message(WARNING "Deprecated option 'LIBRARIES', use 'LINK_LIBRARIES' instead")
set(ARG_LINK_LIBRARIES ${ARG_LINK_LIBRARIES} ${ARG_LIBRARIES})
endif()
@@ -1434,7 +1452,7 @@ macro(_gaudi_detach_debinfo target)
WORKING_DIRECTORY ${_builddir}
COMMENT "Detaching debug infos for ${_tn} (${target}).")
# ensure that the debug file is installed on 'make install'...
- install(FILES ${_builddir}/${_tn}.dbg DESTINATION ${_dest})
+ install(FILES ${_builddir}/${_tn}.dbg DESTINATION ${_dest} OPTIONAL)
# ... and removed on 'make clean'.
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${_builddir}/${_tn}.dbg)
endif()
@@ -1490,10 +1508,10 @@ function(gaudi_add_library library)
gaudi_add_genheader_dependencies(${library})
#----Installation details-------------------------------------------------------
- install(TARGETS ${library} EXPORT ${CMAKE_PROJECT_NAME}Exports DESTINATION lib)
+ install(TARGETS ${library} EXPORT ${CMAKE_PROJECT_NAME}Exports DESTINATION lib OPTIONAL)
gaudi_export(LIBRARY ${library})
gaudi_install_headers(${ARG_PUBLIC_HEADERS})
- install(EXPORT ${CMAKE_PROJECT_NAME}Exports DESTINATION cmake)
+ install(EXPORT ${CMAKE_PROJECT_NAME}Exports DESTINATION cmake OPTIONAL)
endfunction()
# Backward compatibility macro
@@ -1520,7 +1538,7 @@ function(gaudi_add_module library)
gaudi_add_genheader_dependencies(${library})
#----Installation details-------------------------------------------------------
- install(TARGETS ${library} LIBRARY DESTINATION lib)
+ install(TARGETS ${library} LIBRARY DESTINATION lib OPTIONAL)
gaudi_export(MODULE ${library})
endfunction()
@@ -1562,7 +1580,7 @@ function(gaudi_add_dictionary dictionary header selection)
gaudi_merge_files_append(DictRootmap ${dictionary}Gen ${CMAKE_CURRENT_BINARY_DIR}/${rootmapname})
#----Installation details-------------------------------------------------------
- install(TARGETS ${dictionary}Dict LIBRARY DESTINATION lib)
+ install(TARGETS ${dictionary}Dict LIBRARY DESTINATION lib OPTIONAL)
endfunction()
#---------------------------------------------------------------------------------------------------
@@ -1590,7 +1608,7 @@ function(gaudi_add_python_module module)
gaudi_add_genheader_dependencies(${module})
#----Installation details-------------------------------------------------------
- install(TARGETS ${module} LIBRARY DESTINATION python/lib-dynload)
+ install(TARGETS ${module} LIBRARY DESTINATION python/lib-dynload OPTIONAL)
endfunction()
#---------------------------------------------------------------------------------------------------
@@ -1617,8 +1635,8 @@ function(gaudi_add_executable executable)
gaudi_add_genheader_dependencies(${executable})
#----Installation details-------------------------------------------------------
- install(TARGETS ${executable} EXPORT ${CMAKE_PROJECT_NAME}Exports RUNTIME DESTINATION bin)
- install(EXPORT ${CMAKE_PROJECT_NAME}Exports DESTINATION cmake)
+ install(TARGETS ${executable} EXPORT ${CMAKE_PROJECT_NAME}Exports RUNTIME DESTINATION bin OPTIONAL)
+ install(EXPORT ${CMAKE_PROJECT_NAME}Exports DESTINATION cmake OPTIONAL)
gaudi_export(EXECUTABLE ${executable})
endfunction()
@@ -1801,6 +1819,7 @@ function(gaudi_install_scripts)
install(DIRECTORY scripts/ DESTINATION scripts
FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
+ WORLD_EXECUTE WORLD_READ
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "*~" EXCLUDE
@@ -1808,6 +1827,32 @@ function(gaudi_install_scripts)
endfunction()
#---------------------------------------------------------------------------------------------------
+# gaudi_alias(name command...)
+#
+# Create a shell script that wraps the call to the specified command, as in
+# usual Unix shell aliases.
+#---------------------------------------------------------------------------------------------------
+function(gaudi_alias name)
+ if(NOT ARGN)
+ message(FATAL_ERROR "No command specified for wrapper (alias) ${name}")
+ endif()
+ # prepare actual command line
+ set(cmd)
+ foreach(arg ${ARGN})
+ set(cmd "${cmd} \"${arg}\"")
+ endforeach()
+ # create wrapper
+ file(WRITE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
+ "#!/bin/sh
+exec ${cmd} \"\$@\"
+")
+ # make it executable
+ execute_process(COMMAND chmod 755 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name})
+ # install
+ install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name} DESTINATION scripts)
+endfunction()
+
+#---------------------------------------------------------------------------------------------------
# gaudi_install_joboptions(<files...>)
#
# Install the specified options files in the directory 'jobOptions/<package>'.
@@ -1961,11 +2006,7 @@ set(${CMAKE_PROJECT_NAME}_INCLUDE_DIRS \${_dir}/include)
set(${CMAKE_PROJECT_NAME}_LIBRARY_DIRS \${_dir}/lib)
set(${CMAKE_PROJECT_NAME}_BINARY_PATH \${_dir}/bin \${_dir}/scripts)
-if(EXISTS \${_dir}/python.zip)
- set(${CMAKE_PROJECT_NAME}_PYTHON_PATH \${_dir}/python.zip)
-else()
- set(${CMAKE_PROJECT_NAME}_PYTHON_PATH \${_dir}/python)
-endif()
+set(${CMAKE_PROJECT_NAME}_PYTHON_PATH \${_dir}/python)
set(${CMAKE_PROJECT_NAME}_COMPONENT_LIBRARIES ${component_libraries})
set(${CMAKE_PROJECT_NAME}_LINKER_LIBRARIES ${linker_libraries})
diff --git a/cmake/InheritHEPTools.cmake b/cmake/InheritHEPTools.cmake
new file mode 100644
index 0000000..8951c73
--- /dev/null
+++ b/cmake/InheritHEPTools.cmake
@@ -0,0 +1,68 @@
+# Special toolchain file that looks for the projects used and choose the version
+# of the heptools toolchain from them.
+
+cmake_minimum_required(VERSION 2.8.5)
+
+include(CMakeParseArguments)
+
+# detect the required heptols version
+function(guess_heptools_version var)
+
+ # Note: it works even if the env. var. is not set.
+ file(TO_CMAKE_PATH "$ENV{CMAKE_PREFIX_PATH}" sp1)
+ file(TO_CMAKE_PATH "$ENV{CMTPROJECTPATH}" sp2)
+ set(projects_search_path ${CMAKE_PREFIX_PATH} ${sp1} ${sp2})
+
+ # extract the list of projects we depend on
+ file(READ CMakeLists.txt config_file)
+ string(REGEX MATCH "gaudi_project *\\(([^)]+)\\)" args ${config_file})
+ set(args ${CMAKE_MATCH_1})
+ # (replace space-type chars with spaces)
+ string(REGEX REPLACE "[ \t\r\n]+" " " args "${args}")
+ separate_arguments(args)
+ CMAKE_PARSE_ARGUMENTS(PROJECT "" "" "USE;DATA" ${args})
+ #message(STATUS "${PROJECT_USE}")
+
+ while(PROJECT_USE)
+ list(LENGTH PROJECT_USE len)
+ if(len LESS 2)
+ return() # ignore wrong arguments (for the moment)
+ endif()
+ list(GET PROJECT_USE 0 other_project)
+ list(GET PROJECT_USE 1 other_project_version)
+ list(REMOVE_AT PROJECT_USE 0 1)
+
+ string(TOUPPER ${other_project} other_project_upcase)
+ set(suffixes ${other_project}
+ ${other_project_upcase}/${other_project_upcase}_${other_project_version}
+ ${other_project_upcase})
+
+ #message(STATUS "projects_search_path -> ${projects_search_path}")
+ #message(STATUS "suffixes -> ${suffixes}")
+ foreach(base ${projects_search_path})
+ foreach(suffix ${suffixes})
+ file(GLOB configs ${base}/${suffix}/InstallArea/*/${other_project}Config.cmake)
+ #message(STATUS "config -> ${configs}")
+ foreach(config ${configs})
+ file(READ ${config} config_file)
+ if(config_file MATCHES "set *\\( *${other_project}_VERSION *${other_project_version} *\\)")
+ string(REGEX MATCH "set *\\( *${other_project}_heptools_version *([^ ]*) *\\)" _ ${config_file})
+ set(${var} ${CMAKE_MATCH_1} PARENT_SCOPE)
+ message(STATUS "Detected heptools version ${CMAKE_MATCH_1} in ${base}/${suffix}")
+ return()
+ endif()
+ endforeach()
+ endforeach()
+ endforeach()
+ endwhile()
+
+endfunction()
+
+include(${CMAKE_CURRENT_LIST_DIR}/UseHEPTools.cmake)
+
+macro(inherit_heptools)
+ guess_heptools_version(heptools_version)
+ if(heptools_version)
+ use_heptools(${heptools_version})
+ endif()
+endmacro()
diff --git a/cmake/UseHEPTools.cmake b/cmake/UseHEPTools.cmake
new file mode 100644
index 0000000..740f42b
--- /dev/null
+++ b/cmake/UseHEPTools.cmake
@@ -0,0 +1,29 @@
+# use_heptools(heptools_version)
+#
+# Look for the required version of the HEPTools toolchain and replace the
+# current toolchain file with it.
+#
+# WARNING: this macro must be called from a toolchain file
+#
+macro(use_heptools heptools_version)
+ # Remove the reference to this file from the cache.
+ unset(CMAKE_TOOLCHAIN_FILE CACHE)
+
+ # Find the actual toolchain file.
+ find_file(CMAKE_TOOLCHAIN_FILE
+ NAMES heptools-${heptools_version}.cmake
+ HINTS ENV CMTPROJECTPATH
+ PATHS ${CMAKE_CURRENT_LIST_DIR}/cmake/toolchain
+ PATH_SUFFIXES toolchain)
+
+ if(NOT CMAKE_TOOLCHAIN_FILE)
+ message(FATAL_ERROR "Cannot find heptools-${heptools_version}.cmake.")
+ endif()
+
+ # Reset the cache variable to have proper documentation.
+ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}
+ CACHE FILEPATH "The CMake toolchain file" FORCE)
+
+ message(STATUS "Using heptools version ${heptools_version}")
+ include(${CMAKE_TOOLCHAIN_FILE})
+endmacro()
diff --git a/cmake/cmt2cmake/cmt2cmake.py b/cmake/cmt2cmake/cmt2cmake.py
index d165f83..00b6e27 100755
--- a/cmake/cmt2cmake/cmt2cmake.py
+++ b/cmake/cmt2cmake/cmt2cmake.py
@@ -53,6 +53,7 @@ def makeParser(patterns=None):
+ identifier + ZeroOrMore(constituent_option | source))
macro = (Keyword('macro') | Keyword('macro_append')) + identifier + values
setenv = (Keyword('set') | Keyword('path_append') | Keyword('path_prepend')) + identifier + values
+ alias = Keyword('alias') + identifier + values
apply_pattern = Keyword("apply_pattern") + identifier + ZeroOrMore(variable)
if patterns:
@@ -61,7 +62,7 @@ def makeParser(patterns=None):
direct_patterns.addParseAction(lambda toks: toks.insert(0, 'apply_pattern'))
apply_pattern = apply_pattern | (direct_patterns + ZeroOrMore(variable))
- statement = (package | version | use | constituent | macro | setenv | apply_pattern)
+ statement = (package | version | use | constituent | macro | setenv | alias | apply_pattern)
return Optional(statement) + Optional(comment) + StringEnd()
@@ -138,6 +139,7 @@ def extName(n):
'fftw': 'FFTW',
'uuid': 'UUID',
'fastjet': 'FastJet',
+ 'lapack': 'LAPACK',
}
return mapping.get(n, n)
@@ -195,6 +197,7 @@ class Package(object):
self.macros = {}
self.sets = {}
self.paths = {}
+ self.aliases = {}
# These are patterns that can appear only once per package.
# The corresponding dictionary will contain the arguments passed to the
@@ -522,6 +525,11 @@ class Package(object):
data.extend(installs)
data.append('') # empty line
+ if self.aliases:
+ data.extend(['gaudi_alias({0}\n {1})'.format(name, ' '.join(alias))
+ for name, alias in self.aliases.iteritems()])
+ data.append('') # empty line
+
# environment
def fixSetValue(s):
'''
@@ -685,6 +693,12 @@ class Package(object):
value = args[0].strip('"').strip("'")
self.sets[name] = value
+ elif cmd == 'alias':
+ # FIXME: should handle macro tags
+ name = args.pop(0)
+ value = args[0].strip('"').strip("'").split()
+ self.aliases[name] = value
+
# classification of libraries in the package
unquote = lambda x: x.strip('"').strip("'")
self.component_libraries = set([unquote(l['library']) for l in self.component_library])
diff --git a/cmake/cmt2cmake/test_cmt2cmake.py b/cmake/cmt2cmake/test_cmt2cmake.py
index 9cdb9e2..e30ba81 100644
--- a/cmake/cmt2cmake/test_cmt2cmake.py
+++ b/cmake/cmt2cmake/test_cmt2cmake.py
@@ -385,20 +385,24 @@ apply_pattern component_library library=Lib2
# We do not use variables
library Lib3 lib3/*.cpp a_variable=some_value
apply_pattern component_library library=Lib3
+
+# test that we can handle the '-import' before the sources
+library Lib4 -import=XercesC lib4/*.cpp
+apply_pattern component_library library=Lib4
'''
pkg = PackWrap("Test", requirements, files={})
print 'components', pkg.component_libraries
print 'libraries', pkg.libraries
- assert pkg.component_libraries == set(['Lib1', 'Lib2', 'Lib3'])
+ assert pkg.component_libraries == set(['Lib1', 'Lib2', 'Lib3', 'Lib4'])
assert pkg.libraries
cmakelists = pkg.generate()
print cmakelists
calls = getCalls("gaudi_add_module", cmakelists)
- assert len(calls) == 3, "gaudi_add_module wrong count %d" % len(calls)
+ assert len(calls) == 4, "gaudi_add_module wrong count %d" % len(calls)
l = calls[0]
assert re.match(r' *Lib1\b', l)
@@ -415,6 +419,11 @@ apply_pattern component_library library=Lib3
assert not re.search(r'\bPUBLIC_HEADERS', l)
assert re.search(r'\bLINK_LIBRARIES +Boost', l)
assert re.search(r'\bINCLUDE_DIRS +Boost', l)
+ l = calls[3]
+ assert re.match(r' *Lib4\b', l)
+ assert not re.search(r'\bPUBLIC_HEADERS', l)
+ assert re.search(r'\bLINK_LIBRARIES +Boost +XercesC', l)
+ assert re.search(r'\bINCLUDE_DIRS +Boost +XercesC', l)
def test_libraries_3():
# some corner cases
@@ -1422,5 +1431,29 @@ project TestProjectHT
+
+def test_alias():
+ requirements = '''
+package Test
+version v1r0
+
+alias MyCommand "Command"
+alias pypaw "pyroot -i "
+ '''
+ pkg = PackWrap("Test", requirements, files={})
+
+ cmakelists = pkg.generate()
+ print cmakelists
+
+ calls = getCalls("gaudi_alias", cmakelists)
+ assert len(calls) == 2
+
+ calls = sorted([x.strip().split() for x in calls])
+
+ assert calls[0] == ['MyCommand', 'Command'], calls[0]
+
+ assert calls[1] == ['pypaw', 'pyroot', '-i'], calls[1]
+
+
from nose.core import main
main()
diff --git a/cmake/env.py b/cmake/env.py
index 0b84c89..f4ea24c 100755
--- a/cmake/env.py
+++ b/cmake/env.py
@@ -110,7 +110,7 @@ def makeEnv(actions, ignore_system=False):
# prepare initial control object
control = prepareEnv(ignore_system)
- # apply al the actions
+ # apply all the actions
for action, args in actions:
apply(getattr(control, action), args)
diff --git a/cmake/modules/FindROOT.cmake b/cmake/modules/FindROOT.cmake
index 08cebbe..3e526dc 100644
--- a/cmake/modules/FindROOT.cmake
+++ b/cmake/modules/FindROOT.cmake
@@ -16,18 +16,24 @@ endif()
if(NOT ROOT_INCLUDE_DIR)
find_path(ROOT_INCLUDE_DIR TROOT.h
HINTS ${ROOTSYS}/include $ENV{ROOTSYS}/include
+ PATH_SUFFIXES root
${ROOT_OVERRIDE_PATH})
- get_filename_component(ROOTSYS ${ROOT_INCLUDE_DIR} PATH)
- set(ROOTSYS ${ROOTSYS} CACHE PATH "Location of the installation of ROOT" FORCE)
+ if(ROOT_INCLUDE_DIR MATCHES "include$")
+ # ROOTSYS-style installation
+ get_filename_component(ROOTSYS ${ROOT_INCLUDE_DIR} PATH)
+ set(ROOTSYS ${ROOTSYS} CACHE PATH "Location of the installation of ROOT" FORCE)
+ else()
+ set(ROOT_NO_ROOTSYS TRUE CACHE BOOL "ROOT is installed with system packages and not in a ROOTSYS")
+ endif()
endif()
-set(ROOT_INCLUDE_DIRS ${ROOTSYS}/include)
-set(ROOT_LIBRARY_DIRS ${ROOTSYS}/lib)
+set(ROOT_INCLUDE_DIRS ${ROOT_INCLUDE_DIR})
-# This is the list of all known component libraries
-set(ROOT_ALL_COMPONENTS Core Cint Reflex RIO Hist Tree TreePlayer Cintex Matrix GenVector MathCore MathMore XMLIO)
+# This is the list of some known component libraries
+set(ROOT_ALL_COMPONENTS Core Cint Reflex RIO Hist Tree TreePlayer Cintex Matrix
+ GenVector MathCore MathMore XMLIO Graf Gui Rint Physics)
# and build tools
-set(ROOT_ALL_TOOLS genreflex genmap root)
+set(ROOT_ALL_TOOLS genreflex genmap root rootcint)
# Helper macro to discover the dependencies between components needed on Mac)
macro(_root_get_deps libpath var)
@@ -65,7 +71,8 @@ while(ROOT_FIND_COMPONENTS)
# look for the library if not found yet
if(NOT ROOT_${component}_LIBRARY)
find_library(ROOT_${component}_LIBRARY NAMES ${component}
- HINTS ${ROOT_LIBRARY_DIRS}
+ HINTS ${ROOTSYS}/lib
+ PATH_SUFFIXES root
${ROOT_OVERRIDE_PATH})
if(ROOT_${component}_LIBRARY)
mark_as_advanced(ROOT_${component}_LIBRARY)
@@ -102,7 +109,7 @@ endforeach()
# handle the QUIETLY and REQUIRED arguments and set ROOT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ROOT DEFAULT_MSG ROOTSYS ROOT_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ROOT DEFAULT_MSG ROOT_INCLUDE_DIR)
mark_as_advanced(ROOT_FOUND ROOTSYS ROOT_INCLUDE_DIR)
######################################################################
@@ -260,11 +267,15 @@ macro (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN)
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
endmacro (ROOT_GENERATE_DICTIONARY)
-set(ROOT_ENVIRONMENT SET ROOTSYS ${ROOTSYS})
-set(ROOT_BINARY_PATH ${ROOTSYS}/bin)
-if(WIN32)
- set(ROOT_PYTHON_PATH ${ROOTSYS}/bin)
-else()
- set(ROOT_PYTHON_PATH ${ROOTSYS}/lib)
+if(ROOTSYS)
+ set(ROOT_ENVIRONMENT SET ROOTSYS ${ROOTSYS})
+ set(ROOT_BINARY_PATH ${ROOTSYS}/bin)
+ set(ROOT_LIBRARY_DIRS ${ROOTSYS}/lib)
+
+ if(WIN32)
+ set(ROOT_PYTHON_PATH ${ROOTSYS}/bin)
+ else()
+ set(ROOT_PYTHON_PATH ${ROOTSYS}/lib)
+ endif()
endif()
diff --git a/cmake/toolchain/heptools-64b.cmake b/cmake/toolchain/heptools-64b.cmake
index c167456..747a7fc 100644
--- a/cmake/toolchain/heptools-64b.cmake
+++ b/cmake/toolchain/heptools-64b.cmake
@@ -157,7 +157,7 @@ LCG_external_package(xqilla 2.2.4
else()
LCG_external_package(xqilla 2.2.4p1 )
endif()
-LCG_external_package(xrootd 3.1.0p2 )
+LCG_external_package(xrootd 3.2.4 )
# Prepare the search paths according to the versions above
LCG_prepare_paths()
diff --git a/cmake/toolchain/heptools-64c.cmake b/cmake/toolchain/heptools-64c.cmake
new file mode 100644
index 0000000..b00fe20
--- /dev/null
+++ b/cmake/toolchain/heptools-64c.cmake
@@ -0,0 +1,163 @@
+cmake_minimum_required(VERSION 2.8.5)
+
+# Declare the version of HEP Tools we use
+# (must be done before including heptools-common to allow evolution of the
+# structure)
+set(heptools_version 64c)
+
+include(${CMAKE_CURRENT_LIST_DIR}/heptools-common.cmake)
+
+# please keep alphabetic order and the structure (tabbing).
+# it makes it much easier to edit/read this file!
+
+
+# Application Area Projects
+LCG_AA_project(COOL COOL_2_8_15)
+LCG_AA_project(CORAL CORAL_2_3_24)
+LCG_AA_project(RELAX RELAX_1_3_0i)
+LCG_AA_project(ROOT 5.34.03)
+
+# Compilers
+LCG_compiler(gcc43 gcc 4.3.6)
+LCG_compiler(gcc46 gcc 4.6.2)
+LCG_compiler(gcc47 gcc 4.7.2)
+LCG_compiler(clang30 clang 3.0)
+LCG_compiler(gccmax gcc 4.7.2)
+
+# Externals
+LCG_external_package(4suite 1.0.2p1 )
+LCG_external_package(AIDA 3.2.1 )
+LCG_external_package(bjam 3.1.13 )
+LCG_external_package(blas 20110419 )
+if(${LCG_COMP}${LCG_COMPVERS} STREQUAL "gccmax" OR LCG_SYSTEM MATCHES "-slc6-")
+LCG_external_package(Boost 1.48.0p1 )
+else()
+LCG_external_package(Boost 1.48.0 )
+endif()
+LCG_external_package(bz2lib 1.0.2 )
+if(NOT APPLE)
+LCG_external_package(CASTOR 2.1.13-6 castor )
+else()
+LCG_external_package(CASTOR 2.1.9-4 castor )
+endif()
+LCG_external_package(cernlib 2006a )
+LCG_external_package(cgsigsoap 1.3.3-1 )
+LCG_external_package(CLHEP 1.9.4.7 clhep )
+LCG_external_package(cmake 2.8.6 )
+LCG_external_package(cmt v1r20p20081118 )
+LCG_external_package(coin3d 3.1.3p2 )
+LCG_external_package(coverage 3.5.2 )
+LCG_external_package(CppUnit 1.12.1_p1 )
+LCG_external_package(cx_oracle 5.1.1 )
+LCG_external_package(david 1_36a )
+LCG_external_package(dawn 3_88a )
+if(LCG_SYSTEM MATCHES "-slc5-")
+LCG_external_package(dcache_client 2.47.5-0 )
+else()
+LCG_external_package(dcache_client 2.47.6-1 )
+endif()
+LCG_external_package(dcache_srm 1.9.5-23 )
+LCG_external_package(doxygen 1.7.6 )
+LCG_external_package(dpm 1.7.4-7sec )
+LCG_external_package(Expat 2.0.1 )
+LCG_external_package(fastjet 3.0.3 )
+if(NOT APPLE)
+LCG_external_package(fftw 3.1.2 fftw3 )
+else()
+LCG_external_package(fftw 3.2.2 fftw3 )
+endif()
+LCG_external_package(Frontier_Client 2.8.5p1 frontier_client)
+if(NOT LCG_COMP STREQUAL "gccmax")
+LCG_external_package(GCCXML 0.9.0_20110825 gccxml )
+else()
+LCG_external_package(GCCXML 0.9.0_20120309 gccxml )
+endif()
+LCG_external_package(genshi 0.6 )
+LCG_external_package(gfal 1.11.8-2 )
+LCG_external_package(globus 4.0.7-VDT-1.10.1 )
+LCG_external_package(graphviz 2.28.0 )
+LCG_external_package(GSL 1.10 )
+LCG_external_package(HepMC 2.06.05 )
+LCG_external_package(HepPDT 2.06.01 )
+LCG_external_package(igprof 5.9.2 )
+LCG_external_package(ipython 0.12.1 )
+LCG_external_package(javasdk 1.6.0 )
+LCG_external_package(javajni ${javasdk_config_version} )
+LCG_external_package(json 2.5.2 )
+LCG_external_package(kcachegrind 0.4.6 )
+LCG_external_package(lapack 3.4.0 )
+LCG_external_package(lcgdmcommon 1.7.4-7sec )
+LCG_external_package(lcginfosites 2.6.2-1 )
+LCG_external_package(lcgutils 1.7.6-1 )
+LCG_external_package(lcov 1.9 )
+LCG_external_package(lfc 1.7.4-7sec Grid/LFC )
+LCG_external_package(libsvm 2.86 )
+LCG_external_package(libunwind 5c2cade )
+LCG_external_package(lxml 2.3 )
+LCG_external_package(matplotlib 1.1.0 )
+LCG_external_package(minuit 5.27.02 )
+LCG_external_package(mock 0.8.0 )
+LCG_external_package(multiprocessing 2.6.2.1 )
+LCG_external_package(myproxy 4.2-VDT-1.10.1 )
+LCG_external_package(mysql 5.5.14 )
+LCG_external_package(mysql_python 1.2.3 )
+LCG_external_package(neurobayes 3.7.0 )
+LCG_external_package(neurobayes_expert 3.7.0 )
+LCG_external_package(nose 1.1.2 )
+LCG_external_package(numpy 1.6.1 )
+LCG_external_package(oracle 11.2.0.3.0 )
+LCG_external_package(processing 0.52 )
+LCG_external_package(py 1.4.8 )
+if(LCG_SYSTEM MATCHES "-slc6-")
+LCG_external_package(pyanalysis 1.3p1 )
+else()
+LCG_external_package(pyanalysis 1.3 )
+endif()
+LCG_external_package(pydot 1.0.28 )
+LCG_external_package(pygraphics 1.3 )
+LCG_external_package(pylint 0.25.1 )
+LCG_external_package(pyminuit 0.0.1 )
+LCG_external_package(pyparsing 1.5.6 )
+LCG_external_package(pyqt 4.9.3 )
+LCG_external_package(pytest 2.2.4 )
+if(NOT LCG_SYSTEM MATCHES "-mac106-")
+LCG_external_package(Python 2.6.5p2 )
+else()
+LCG_external_package(Python 2.6.5 )
+endif()
+LCG_external_package(pytools 1.7p1 )
+LCG_external_package(pyxml 0.8.4p1 )
+LCG_external_package(QMtest 2.4.1 )
+LCG_external_package(Qt 4.7.4 qt )
+LCG_external_package(qwt 6.0.1 )
+LCG_external_package(readline 2.5.1p1 )
+LCG_external_package(roofit 3.10p1 )
+LCG_external_package(scipy 0.10.0 )
+LCG_external_package(setuptools 0.6c11 )
+LCG_external_package(sip 4.13.3 )
+LCG_external_package(soqt 1.5.0 )
+LCG_external_package(sqlalchemy 0.7.7 )
+LCG_external_package(sqlite 3070900 )
+LCG_external_package(stomppy 3.1.3 )
+LCG_external_package(storm 0.19 )
+LCG_external_package(sympy 0.7.1 )
+LCG_external_package(TBB 41_20121003 tbb )
+LCG_external_package(tcmalloc 1.7p3 )
+if(NOT LCG_SYSTEM MATCHES "-slc6-") # uuid is not distributed with SLC6
+LCG_external_package(uuid 1.42 )
+endif()
+LCG_external_package(valgrind 3.7.0p1 )
+LCG_external_package(vomsapi_noglobus 1.9.17-1 )
+LCG_external_package(vomsapic 1.9.17-1 )
+LCG_external_package(vomsapicpp 1.9.17-1 )
+LCG_external_package(vomsclients 1.9.17-1 )
+LCG_external_package(XercesC 3.1.1p1 )
+if(NOT ${LCG_COMP}${LCG_COMPVERS} STREQUAL "gcc46")
+LCG_external_package(xqilla 2.2.4 )
+else()
+LCG_external_package(xqilla 2.2.4p1 )
+endif()
+LCG_external_package(xrootd 3.2.4 )
+
+# Prepare the search paths according to the versions above
+LCG_prepare_paths()
diff --git a/cmake/toolchain/heptools-common.cmake b/cmake/toolchain/heptools-common.cmake
index bf36ba9..ec0efde 100644
--- a/cmake/toolchain/heptools-common.cmake
+++ b/cmake/toolchain/heptools-common.cmake
@@ -339,8 +339,9 @@ endmacro()
# LCG_external_package(Boost 1.44.0)
# LCG_external_package(CLHEP 1.9.4.7 clhep)
macro(LCG_external_package name version)
- set(${name}_config_version ${version})
- set(${name}_native_version ${version})
+ set(${name}_config_version ${version} CACHE STRING "Version of ${name}")
+ mark_as_advanced(${name}_config_version)
+ set(${name}_native_version ${${name}_config_version})
if(${ARGC} GREATER 2)
set(${name}_directory_name ${ARGV2})
else()
diff --git a/cmt/project.cmt b/cmt/project.cmt
index d5dd10f..b26aadc 100644
--- a/cmt/project.cmt
+++ b/cmt/project.cmt
@@ -1,6 +1,6 @@
project GAUDI
-use LCGCMT LCGCMT_64b
+use LCGCMT LCGCMT_64c
build_strategy with_installarea
setup_strategy root
diff --git a/toolchain.cmake b/toolchain.cmake
index 7f07417..6769a42 100644
--- a/toolchain.cmake
+++ b/toolchain.cmake
@@ -1,22 +1,11 @@
# Special wrapper to load the declared version of the heptools toolchain.
-set(heptools_version 64b)
-
-# Remove the reference to this file from the cache.
-unset(CMAKE_TOOLCHAIN_FILE CACHE)
-
-# Find the actual toolchain file.
-find_file(CMAKE_TOOLCHAIN_FILE
- NAMES heptools-${heptools_version}.cmake
- HINTS ENV CMTPROJECTPATH
- PATHS ${CMAKE_CURRENT_LIST_DIR}/cmake/toolchain
- PATH_SUFFIXES toolchain)
-
-if(NOT CMAKE_TOOLCHAIN_FILE)
- message(FATAL_ERROR "Cannot find heptools-${heptools_version}.cmake.")
+set(heptools_version 64c)
+
+find_file(use_heptools_module UseHEPTools.cmake
+ HINTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+# this check is needed because the toolchain seem to be called a second time
+# without the proper cache
+if(use_heptools_module)
+ include(${use_heptools_module})
+ use_heptools(${heptools_version})
endif()
-
-# Reset the cache variable to have proper documentation.
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}
- CACHE FILEPATH "The CMake toolchain file" FORCE)
-
-include(${CMAKE_TOOLCHAIN_FILE})