diff --git a/externalProgramPath.py b/externalProgramPath.py
index 5380eb42aed1601453073e64990e946440f35824..9830f3c0688d77cefaaa01675a448da6b83a566a 100755
--- a/externalProgramPath.py
+++ b/externalProgramPath.py
@@ -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)