Python library interface

I was trying to test something through the python interface today, and I
get two strange errors. The first is blocking, and may be due to an old
version of a file:

% python
Traceback (most recent call last):
   File "", line 25, in <module>
     from lammps import LMPINT as INT
ImportError: cannot import name LMPINT

I recall a previous version of having LMPINT, LMPDOUBLE, etc.
defined in it, but those are no longer there. Does need to be
updated, or am I doing something wrong? I haven't used the Python
interface much at all, so I very well could be!

The second error occurs when I use a parallel library (through OpenMPI, in
my case) instead of a serial library. I get the following error:
   python: symbol lookup error:
   /usr/lib64/openmpi/lib/openmpi/ undefined symbol:
I found a link here:
indicating that changing, lines 26-27, from
       if not name: self.lib = CDLL("")
       else: self.lib = CDLL("liblammps_s\.so&quot; name)
       if not name: self.lib = CDLL("", RTLD_GLOBAL)
       else: self.lib = CDLL("liblammps_s\.so&quot; name, RTLD_GLOBAL)
will solve the problem, and I can confirm it does (at least for me). The
problem happens because MPI loads some other libraries, but the namespace
created by CDLL is not global and therefore it can't find those symbols.
RTLD_GLOBAL puts them in the global namespace for library symbols.

Karl D. Hammond
University of Tennessee, Knoxville

"You can never know everything, and part of what you know is always
   wrong. A portion of wisdom lies in knowing that. A portion of courage
   lies in going on anyway."
"Nothing ever goes as you expect. Expect nothing, and you will not be
   surprised." was out-of-date. I'll post a patch this
AM, and include the RTLD_GLOBAL flag on CDLL().