Skip to content
Snippets Groups Projects
Commit 9bf3866e authored by Papeleux Luc's avatar Papeleux Luc
Browse files

rename configLDLIBRARYPATH in config_ld_library_path

parent d028fd80
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,9 @@
# -*- coding: utf-8 -*-
#
# Define external program paths according to local configuration
#
# under linux, call config_ld_library_path(key) to extend LD_LIBRARY_PATH to be able to find .so
#
from prmClasses import *
import os, os.path, shutil #, distutils.spawn
......@@ -113,15 +116,14 @@ class ExtProgs(PRMSet):
SaveAction(self.actions , 'S')
QuitAction(self.actions , 'Q')
def configLDLIBRARYPATH(self, key):
def config_ld_library_path(self, key): # add progPath/bin/../lib to LD_LIBRARY_PATH (else may not found .so)
progLibPath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(self.pars[key].val)),'..','lib'))
if os.path.exist(progLibPath):
if os.path.exists(progLibPath):
for p in os.environ['LD_LIBRARY_PATH'].split(':'):
if os.path.samefile(progLibPath, p): # deja dans le LD_LIBRARY_PATH => on skippe l'ajout
if os.path.exists(p) and os.path.samefile(progLibPath, p): # deja dans le LD_LIBRARY_PATH => on skippe l'ajout
break
else : # pas trouvé dans le LD_LIBRARY_PATH => on ajoute dans le LD_LIBRARY_PATH
os.environ['LD_LIBRARY_PATH'] = progLibPath + ':' + os.environ['LD_LIBRARY_PATH']
os.environ['LD_LIBRARY_PATH'] = progLibPath + ':' + os.environ['LD_LIBRARY_PATH']
#=================================================================================
def main():
progsConf = ExtProgs() #verb=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment