-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmarlinpkg.py
73 lines (59 loc) · 2.61 KB
/
marlinpkg.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
##################################################
#
# MarlinPKG module
#
# Author: Jan Engels, DESY
# Date: Jan, 2007
#
##################################################
import os
# custom imports
from .baseilc import BaseILC
from .util import *
class ConfigPKG(BaseILC):
""" Responsible for Configuration Packages installation,
i.e. without compilation. """
def __init__(self, name, userInput):
BaseILC.__init__(self, userInput, name, name)
self.reqfiles = []
self.download.root = "ilctools"
self.hasCMakeBuildSupport = False
self.hasCMakeFindSupport = False
self.skipCompile = True
class MarlinPKG(BaseILC):
""" Responsible for Marlin Packages installation process. """
def __init__(self, name, userInput):
BaseILC.__init__(self, userInput, name, name)
self.reqfiles = [ [ folder + "lib" + name + ext for ext in ('.so', '.a', '.dylib') for folder in ('lib/', 'lib64/') ] ]
self.reqmodules=[ 'LCIO', 'Marlin' ]
self.download.gitrepo = name
# Marlin packages just provide libraries.
# They are not supposed to be found via CMake
self.hasCMakeFindSupport = False
def compile(self):
""" compile MarlinPKG """
os.chdir( self.installPath + "/build" )
if( self.rebuild ):
tryunlink( "CMakeCache.txt" )
# build software
if( os_system( ". ../build_env.sh ; " + self.genCMakeCmd() + " 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to configure!!" )
#if( os_system( ". ../../../init_ilcsoft.sh ; make ${MAKEOPTS} 2>&1 | tee -a " + self.logfile ) != 0 ):
if( os_system( ". ../build_env.sh ; make ${MAKEOPTS} 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to compile!!" )
if( os_system( "make install" ) != 0 ):
self.abort( "failed to install!!" )
def checkInstall(self, abort=True):
BaseILC.checkInstall(self)
if self.name not in ("MarlinUtil", "PandoraPFANew", "Physsim", "LCFIVertex"):
for libdir in ("/lib/", "/lib64/"):
libname = self.installPath + libdir + "lib" + self.name + self.shlib_ext
print("MarlinDLL: looking for ", libname)
if os.path.exists(libname):
print("MarlinDLL: Found ", libname)
self.parent.module('Marlin').envpath["MARLIN_DLL"].append(libname)
break
else:
print("Error: did not find any library for the MarlinDLL", self.name)
return False
return True