forked from iLCSoft/iLCInstall
-
Notifications
You must be signed in to change notification settings - Fork 1
/
acts.py
73 lines (55 loc) · 2.55 KB
/
acts.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
##################################################
#
# ACTS module
#
# Author: Paolo Andreetto, INFN
# Date: Sep 2021
#
##################################################
# custom imports
from baseilc import BaseILC
from util import *
import os.path
class ACTS(BaseILC):
""" Responsible for the ACTS installation process. """
def __init__(self, name, userInput):
BaseILC.__init__(self, userInput, name, name)
self.download.gitrepo = name
self.hasCMakeFindSupport = True
# required modules
self.reqmodules = [ "LCIO", "DD4hep" ]
self.reqfiles = [[
"lib64/libActsCore.so",
"lib64/libActsPluginDD4hep.so",
"lib64/libActsPluginJson.so",
"lib64/libActsPluginTGeo.so"
]]
self.envcmake["ACTS_BUILD_PLUGIN_DD4HEP"] = "ON"
self.envcmake["ACTS_BUILD_PLUGIN_JSON"] = "ON"
def compile(self):
""" compile ACTS """
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!!" )
patch_cmd = "sed -i -e 's|Boost 1.75.0 CONFIG EXACT|Boost 1.75.0 EXACT|g' %s"
file_to_patch = os.path.join(self.installPath, 'lib64', 'cmake', 'Acts', 'ActsConfig.cmake')
if( os_system(patch_cmd % file_to_patch) != 0 ):
print("Cannot patch file %s" % file_to_patch)
def writeEnv(self, f, checked):
if( self.name in checked ):
return
else:
checked.append( self.name )
disclaimer = 2*os.linesep + "#" + 80*'-' + os.linesep
disclaimer += "#" + 5*' ' + self.name + os.linesep + "#" + 80*'-' + os.linesep
f.write(disclaimer)
f.write( "# --- additional " + self.name + " commands ------- " + os.linesep )
f.write( "export LD_LIBRARY_PATH=\"" + self.installPath + "/lib64:$LD_LIBRARY_PATH\"" + os.linesep )