Crompulence / cpl-library

http://www.cpl-library.org
Other
24 stars 9 forks source link

OSError undefined symbol MPIR_F_TRUE when running pytest #14

Closed edwardsmith999 closed 6 years ago

edwardsmith999 commented 7 years ago

Running pytest gives an OSError undefined symbol MPIR_F_TRUE. I suspect it could be because mpich is built without shared libraries as needed for mpi4py but the error handling in cplpy.py bindings:

try:
    _cpl_lib = load_library(_libname, _lib_path)
except OSError as e:
    print("OSError: ", e)
    print("WARNING - " + _libname + " not found under path specified by \
          CPL_LIBRARY_PATH variable: " + _lib_path)
    print("Attempting to find system version")
    _lib_path = util.find_library(_libname)

obscures the problem, would this not be better as a check to see if the library exists

import os.path
os.path.exists(_lib_path+ "/"+_libname)

and then simply raise the oserror?

edwardsmith999 commented 7 years ago

Possibly related error (the only one I can find): https://groups.google.com/forum/#!topic/mpi4py/7TSG6mZWpzo suggests that "building mpi4py with just static libraries" fixed this...

edwardsmith999 commented 7 years ago

Okay, the bug is related to LD_LIBRARY_PATH not being set correctly which results in mixing of system and locally installed version of MPI. The following might be related: http://stackoverflow.com/questions/856116/changing-ld-library-path-at-runtime-for-ctypes