From: vsr Date: Tue, 15 Aug 2006 15:10:34 +0000 (+0000) Subject: Fix an environment problem on 64-bit platforms (set_env() method should use "lib64... X-Git-Tag: For_OCT_611 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32acdf47cd7198290a4bc64db2ee60b2dacfe747;p=modules%2Fkernel.git Fix an environment problem on 64-bit platforms (set_env() method should use "lib64" library path instead of "lib") --- diff --git a/bin/runSalome.py b/bin/runSalome.py index 722629ad4..7311f00d9 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -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") diff --git a/bin/virtual_salome.py b/bin/virtual_salome.py index edbfbe193..8040c21c9 100644 --- a/bin/virtual_salome.py +++ b/bin/virtual_salome.py @@ -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')