Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some updates for key4hep and Marlin packages #175

Merged
merged 7 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions examples/macbookfg/release-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,12 @@


# ======================= PACKAGE VERSIONS ===================================
##Geant4_version = "10.06.p02"
##CLHEP_version = "2.4.1.3" #"2.3.4.3"
##ROOT_version = "6.22.02"
##GSL_version = "2.6" #"2.1" # "1.15"
##Qt5_version = "v5.13.1"
##CMake_version = "3.17.3" ##"3.15.2" #"3.4.3" #"2.8.5"
##SIO_version = "v00-00-03"
Eigen_version = "3.3.7"
##Boost_version = "1.71.0"

Geant4_version = "11.0.2"
Geant4_version = "11.1.1"

CLHEP_version = "2.4.5.3"
CLHEP_version = "2.4.6.4"

ROOT_version = "6.26.06"
ROOT_version = "6.28.04"

GSL_version = "2.7"

Expand All @@ -134,7 +125,7 @@

Boost_version = "1.77.0"

#Eigen_version = "3.4.0"
Eigen_version = "3.4.0"

# -------------------------------------------

Expand Down
5 changes: 3 additions & 2 deletions ilcsoft/baseilc.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,9 @@ def downloadSources(self):
elif self.download.type[:6] == "GitHub":
if self.version =="HEAD" or self.version =="dev" or self.version =="devel" or self.version =="master" or self.download.branch:
#clone the whole repo into the directory
branch = 'master' if self.download.branch is None else self.download.branch
cmd="git clone -b %s https://github.com/%s/%s.git %s" % (branch, self.download.gituser, self.download.gitrepo, self.version)
branch = '' if self.download.branch is None else '-b ' + self.download.branch

cmd="git clone %s https://github.com/%s/%s.git %s" % (branch, self.download.gituser, self.download.gitrepo, self.version)
print("Executing command:",cmd)
if os_system( cmd ) != 0:
self.abort( "Problems occurred during execution of " + cmd + " [!!ERROR!!]")
Expand Down
116 changes: 59 additions & 57 deletions ilcsoft/ilcsoft.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,63 +403,7 @@ def makeinstall(self):
print("\n" + 30*'*' + " Starting ILC Software installation process " + 30*'*' + "\n")
# write CMake Environment to file ILCSoft.cmake
self.writeCMakeEnv()

# write init_ilcsoft.sh
checked=[]
f = open(self.installPath + "/init_ilcsoft.sh", 'w')

f.write( 'export ILCSOFT='+self.installPath + os.linesep )

#------- prepend the pathes for the compiler and python used in this installation -------

compiler = self.env["CXX"]
status, cxx_path = getstatusoutput( "which "+compiler )
cxx_path = os.path.dirname( os.path.dirname( cxx_path ) ) # remove '/bin/g++'

status, py_path = getstatusoutput( "which python" )
py_path = os.path.dirname( os.path.dirname( py_path ) ) # remove '/bin/python'

f.write( os.linesep + '# -------------------------------------------------------------------- ---' + os.linesep )
f.write( os.linesep + '# --- Use the same compiler and python as used for the installation ---' + os.linesep )
f.write( os.linesep + '# -------------------------------------------------------------------- ---' + os.linesep )
# On cvmfs the gcc/llvm compilers are setup using the setup.sh file
# source also other important scripts. Adding the compiler to LD_LIBRARY_PATH and PATH
# is not enough. The setup.sh file is also setting up paths to binutils and other important variables
if os.path.exists( cxx_path + "/setup.sh" ):
f.write( '. ' + cxx_path + '/setup.sh' + os.linesep + os.linesep )
else:
f.write( 'export PATH='+cxx_path+'/bin:${PATH}' + os.linesep )
f.write( 'export LD_LIBRARY_PATH='+cxx_path+'/lib64:'+ cxx_path+'/lib:${LD_LIBRARY_PATH}' + os.linesep + os.linesep )

# export Python in PATH and LD_LIBRARY_PATH
f.write( 'export PATH='+py_path+'/bin:${PATH}' + os.linesep )
f.write( 'export LD_LIBRARY_PATH='+py_path+'/lib:${LD_LIBRARY_PATH}' + os.linesep + os.linesep )
# copy the PYTHONPATH verbatim from the build setup if it is set
python_path = os.getenv('PYTHONPATH')
if python_path:
f.write('export PYTHONPATH=' + python_path + os.linesep + os.linesep )

f.write( 'export CXX=' + compiler + os.linesep )
ccompiler = self.env["CC"]
f.write( 'export CC=' + ccompiler + os.linesep )

# set GIT_EXEC_PATH inherited from the setup.sh
if os.environ.get("GIT_EXEC_PATH"):
f.write('export GIT_EXEC_PATH=%s' % os.environ.get("GIT_EXEC_PATH"))

#----------------------------------------------------------------------------------------


for mod in self.modules:
mod.writeEnv(f, checked)
if self.os.type == "Darwin":
f.write( os.linesep + '# --- set DYLD_LIBRARY_PATH to LD_LIBRARY_PATH for MAC compatibility ---' + os.linesep )
f.write( 'export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH' + os.linesep + os.linesep )
if ( self.os.ver.find("cientific") and self.release_number == '6'):
f.write( os.linesep + '# --- Workaraund for OpenGl bug on SL6 ---' + os.linesep )
f.write( 'export LIBGL_ALWAYS_INDIRECT=1' + os.linesep )


self.writeInit()
print("\n" + 30*'*' + " Creating symlinks " + 30*'*' + "\n")
for mod in self.modules:
mod.createLink()
Expand Down Expand Up @@ -515,6 +459,7 @@ def makeinstall(self):
for mod in self.modules:
os_system( "echo '%s:%s' >> %s" % (mod.alias,mod.version,depsfile) )

self.writeInit()
print("\n" + 30*'*' + " Finished installation " + 30*'*' + "\n")

def summary(self):
Expand Down Expand Up @@ -557,3 +502,60 @@ def showDependencies(self):
mod.showDependencies()

print("};")

def writeInit(self):
"""write init_ilcsoft.sh"""
checked=[]
f = open(self.installPath + "/init_ilcsoft.sh", 'w')

f.write( 'export ILCSOFT='+self.installPath + os.linesep )

#------- prepend the pathes for the compiler and python used in this installation -------

compiler = self.env["CXX"]
status, cxx_path = getstatusoutput( "which "+compiler )
cxx_path = os.path.dirname( os.path.dirname( cxx_path ) ) # remove '/bin/g++'

status, py_path = getstatusoutput( "which python" )
py_path = os.path.dirname( os.path.dirname( py_path ) ) # remove '/bin/python'

f.write( os.linesep + '# -------------------------------------------------------------------- ---' + os.linesep )
f.write( os.linesep + '# --- Use the same compiler and python as used for the installation ---' + os.linesep )
f.write( os.linesep + '# -------------------------------------------------------------------- ---' + os.linesep )
# On cvmfs the gcc/llvm compilers are setup using the setup.sh file
# source also other important scripts. Adding the compiler to LD_LIBRARY_PATH and PATH
# is not enough. The setup.sh file is also setting up paths to binutils and other important variables
if os.path.exists( cxx_path + "/setup.sh" ):
f.write( '. ' + cxx_path + '/setup.sh' + os.linesep + os.linesep )
else:
f.write( 'export PATH='+cxx_path+'/bin:${PATH}' + os.linesep )
f.write( 'export LD_LIBRARY_PATH='+cxx_path+'/lib64:'+ cxx_path+'/lib:${LD_LIBRARY_PATH}' + os.linesep + os.linesep )

# export Python in PATH and LD_LIBRARY_PATH
f.write( 'export PATH='+py_path+'/bin:${PATH}' + os.linesep )
f.write( 'export LD_LIBRARY_PATH='+py_path+'/lib:${LD_LIBRARY_PATH}' + os.linesep + os.linesep )
# copy the PYTHONPATH verbatim from the build setup if it is set
python_path = os.getenv('PYTHONPATH')
if python_path:
f.write('export PYTHONPATH=' + python_path + os.linesep + os.linesep )

f.write( 'export CXX=' + compiler + os.linesep )
ccompiler = self.env["CC"]
f.write( 'export CC=' + ccompiler + os.linesep )

# set GIT_EXEC_PATH inherited from the setup.sh
if os.environ.get("GIT_EXEC_PATH"):
f.write('export GIT_EXEC_PATH=%s' % os.environ.get("GIT_EXEC_PATH"))

#----------------------------------------------------------------------------------------


for mod in self.modules:
mod.writeEnv(f, checked)
if self.os.type == "Darwin":
f.write( os.linesep + '# --- set DYLD_LIBRARY_PATH to LD_LIBRARY_PATH for MAC compatibility ---' + os.linesep )
f.write( 'export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH' + os.linesep + os.linesep )
if ( self.os.ver.find("cientific") and self.release_number == '6'):
f.write( os.linesep + '# --- Workaraund for OpenGl bug on SL6 ---' + os.linesep )
f.write( 'export LIBGL_ALWAYS_INDIRECT=1' + os.linesep )
f.close()
16 changes: 10 additions & 6 deletions ilcsoft/marlinpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MarlinPKG(BaseILC):

def __init__(self, name, userInput):
BaseILC.__init__(self, userInput, name, name)
self.reqfiles = [ [ str("lib/lib" + name + ".a"), str("lib/lib" + name + ".so"), str("lib/lib" + name + ".dylib") ] ]
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
Expand All @@ -57,13 +57,17 @@ def compile(self):
if( os_system( "make install" ) != 0 ):
self.abort( "failed to install!!" )

def postCheckDeps(self):
BaseILC.postCheckDeps(self)

# fill MARLIN_DLL
if( self.name != "MarlinUtil" and self.name != "PandoraPFANew" ):
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