Skip to content

Commit

Permalink
Fix writing MARLIN_DLL
Browse files Browse the repository at this point in the history
  • Loading branch information
andresailer authored and tmadlener committed Dec 21, 2023
1 parent 283018e commit b21790b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 5 deletions.
57 changes: 57 additions & 0 deletions ilcsoft/ilcsoft.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,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 +558,59 @@ 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 )
10 changes: 5 additions & 5 deletions ilcsoft/marlinpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ 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)
Expand All @@ -71,3 +69,5 @@ def postCheckDeps(self):
break
else:
print("Error: did not find any library for the MarlinDLL", self.name)
return False
return True

0 comments on commit b21790b

Please sign in to comment.