Changeset 789 for SHX/trunk


Ignore:
Timestamp:
10/21/12 11:21:41 (8 years ago)
Author:
marcus
Message:
  • alternate C library
Location:
SHX/trunk/SeismicHandler/lib
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/lib/headers.py

    r746 r789  
    1717from SeismicHandler.basics.messages import log_message 
    1818 
    19 try: 
    20     lib = Settings.config.paths.library[0] 
    21     arch = platform.architecture()[0][:2] 
    22     system = platform.system().lower() 
    23     ext = sysconfig.get_config_vars('SO')[0] 
    24     libname = "%s-%s%s%s" % (lib, system, arch, ext) 
    25     shc = C.CDLL(libname) 
    26     log_message("debug.lib", "Done loading shared lib: %s" % libname) 
    27 except Exception as E: 
     19lib = Settings.config.paths.library[0] 
     20arch = platform.architecture()[0][:2] 
     21system = platform.system().lower() 
     22ext = sysconfig.get_config_vars('SO')[0] 
     23lib_ok = False 
     24 
     25# there was a change in glibc regarding malloc functions, so older systems 
     26# ship another version... 
     27if arch == '64': 
     28    glibc = ["-glib2_7", "-glib2_14"] 
     29else: 
     30    glibc = [""] 
     31 
     32for g in glibc: 
     33    libname = "%s-%s%s%s%s" % (lib, system, arch, g, ext) 
     34    try: 
     35        shc = C.CDLL(libname) 
     36    except Exception as E: 
     37        continue 
     38    else: 
     39        lib_ok = True 
     40        log_message("debug.lib", "Done loading shared lib: %s" % libname) 
     41        break 
     42 
     43if not lib_ok: 
    2844    raise ShxError("Shared lib cannot be loaded: %s" % E, status=9999) 
    2945 
Note: See TracChangeset for help on using the changeset viewer.