]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix an environment problem on 64-bit platforms (set_env() method should use "lib64... For_OCT_611
authorvsr <vsr@opencascade.com>
Tue, 15 Aug 2006 15:10:34 +0000 (15:10 +0000)
committervsr <vsr@opencascade.com>
Tue, 15 Aug 2006 15:10:34 +0000 (15:10 +0000)
bin/runSalome.py
bin/virtual_salome.py

index 722629ad4694265738e3dee09443f937a813f01c..7311f00d962beaad55d32e1676fcd3a5ffd09473 100755 (executable)
@@ -55,6 +55,13 @@ def add_path(directory, variable_name):
 
 # -----------------------------------------------------------------------------
 
+def get_lib_dir():
+    if os.path.exists("/usr/lib64/libc.so"):
+        return "lib64"
+    return "lib"
+
+# -----------------------------------------------------------------------------
+
 def get_config():
     """
     Get list of modules, paths.
@@ -130,7 +137,7 @@ def set_env(args, modules_list, modules_root_dir):
         if modules_root_dir.has_key(module):
             module_root_dir = modules_root_dir[module]
             modules_root_dir_list[:0] = [module_root_dir]
-            add_path(os.path.join(module_root_dir,"lib",salome_subdir),
+            add_path(os.path.join(module_root_dir,get_lib_dir(),salome_subdir),
                      "LD_LIBRARY_PATH")
             add_path(os.path.join(module_root_dir,"bin",salome_subdir),
                      "PATH")
@@ -140,13 +147,13 @@ def set_env(args, modules_list, modules_root_dir):
                 pass
             add_path(os.path.join(module_root_dir,"bin",salome_subdir),
                      "PYTHONPATH")
-            add_path(os.path.join(module_root_dir,"lib",
+            add_path(os.path.join(module_root_dir,get_lib_dir(),
                                   python_version,"site-packages",
                                   salome_subdir),
                      "PYTHONPATH")
-            add_path(os.path.join(module_root_dir,"lib",salome_subdir),
+            add_path(os.path.join(module_root_dir,get_lib_dir(),salome_subdir),
                      "PYTHONPATH")
-            add_path(os.path.join(module_root_dir,"lib",
+            add_path(os.path.join(module_root_dir,get_lib_dir(),
                                   python_version,"site-packages",
                                   salome_subdir,
                                   "shared_modules"),
@@ -191,12 +198,12 @@ def set_env(args, modules_list, modules_root_dir):
                     if not os.environ.has_key("SALOME_"+plugin+"Resources"):
                         os.environ["SALOME_"+plugin+"Resources"] \
                         = plugin_root+"/share/"+args["appname"]+"/resources/"+plugin.lower()
-                    add_path(os.path.join(plugin_root,"lib",python_version,
+                    add_path(os.path.join(plugin_root,get_lib_dir(),python_version,
                                           "site-packages",salome_subdir),
                              "PYTHONPATH")
-                    add_path(os.path.join(plugin_root,"lib",salome_subdir),
+                    add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
                              "PYTHONPATH")
-                    add_path(os.path.join(plugin_root,"lib",salome_subdir),
+                    add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
                              "LD_LIBRARY_PATH")
                     add_path(os.path.join(plugin_root,"bin",salome_subdir),
                              "PYTHONPATH")
index edbfbe19383a9f7430c545e1a53921d3ea3c9a12..8040c21c9b90dd7ebf85fec3323a1b32fb7a0266 100644 (file)
@@ -65,6 +65,12 @@ def rmtree(dir):
         pass
     pass
 
+def get_lib_dir():
+    """Get libraries directory according to the Linux platform being used"""
+    if os.path.exists("/usr/lib64/libc.so"):
+        return "lib64"
+    return "lib"
+
 def main():
     usage="""usage: %prog [options]
 Typical use is:
@@ -100,9 +106,9 @@ Typical use is:
 
     #module_dir="/local/chris/SALOME2/RELEASES/Install/KERNEL_V3_1_0b1"
     module_bin_dir=os.path.join(module_dir,'bin','salome')
-    module_lib_dir=os.path.join(module_dir,'lib','salome')
-    module_lib_py_dir=os.path.join(module_dir,'lib',py_version,'site-packages','salome')
-    module_lib_py_shared_dir=os.path.join(module_dir,'lib',py_version,
+    module_lib_dir=os.path.join(module_dir,get_lib_dir(),'salome')
+    module_lib_py_dir=os.path.join(module_dir,get_lib_dir(),py_version,'site-packages','salome')
+    module_lib_py_shared_dir=os.path.join(module_dir,get_lib_dir(),py_version,
                                           'site-packages','salome','shared_modules')
     module_share_dir=os.path.join(module_dir,'share','salome','resources')
     module_doc_gui_dir=os.path.join(module_dir,'doc','salome','gui')