forked from iLCSoft/iLCInstall
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dd4hep.py
79 lines (53 loc) · 2.32 KB
/
dd4hep.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
##################################################
#
# DD4hep module
#
# Author: F.Gaede, DESY
# Date: May, 2013
#
##################################################
# custom imports
from .baseilc import BaseILC
import sys
from .util import *
class DD4hep(BaseILC):
""" Responsible for the DD4hep configuration process. """
def __init__(self, userInput):
BaseILC.__init__(self, userInput, "DD4hep", "DD4hep")
#self.hasCMakeBuildSupport = False
#self.hasCMakeFindSupport = False
self.download.supportedTypes = [ "GitHub" ]
self.download.gituser = 'AIDASoft'
self.download.gitrepo = 'DD4hep'
self.reqfiles = [ ["lib/libDDCore.so", "lib/libDDCore.dylib" ]]
self.reqmodules = [ "ROOT" , "LCIO", "GEAR", "Geant4" , "CLHEP" ,"Boost" ]
def setMode(self, mode):
BaseILC.setMode(self, mode)
self.cmakeconfig = self.installPath + "/cmake"
def init(self):
""" init DD4hep """
BaseILC.init(self)
# g4mod = self.parent.module("Geant4")
# self.g4ver = Version( g4mod.version )
def compile(self):
""" compile DD4hep """
trymakedir( self.installPath + "/build" )
os.chdir( self.installPath + "/build" )
if( self.rebuild ):
tryunlink( "CMakeCache.txt" )
if( os_system( self.genCMakeCmd() + " 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to configure!!" )
if (self.nightlyBuild == True):
for targetName in self.nightlyTargets:
if( os_system( ". ../build_env.sh ; make ${MAKEOPTS} " + targetName + " 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to compile!!" )
else:
if( os_system( ". ../build_env.sh ; make ${MAKEOPTS} 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to compile!!" )
if( os_system( ". ../build_env.sh ; make install 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to install!!" )
def postCheckDeps(self):
BaseILC.postCheckDeps(self)
self.env[ 'DD4HEP' ] = self.installPath
self.env[ 'DD4HEP_ENVINIT' ] = "${DD4HEP}/bin/thisdd4hep.sh"
self.envcmds.append('test -r ${DD4HEP_ENVINIT} && . ${DD4HEP_ENVINIT}')