OSError: Could not load LAMMPS dynamic library

htmlboss's picture
Submitted by htmlboss on Fri, 08/15/2014 - 19:12

Hi all,

I recently installed ligghts/lammps with parallel support. When I try to execute one of the example scripts or load the module in a python console, the following is output:

>>> from lammps import lammps
>>> lmp = lammps()
Traceback (most recent call last):
File "", line 1, in
File "lammps.py", line 37, in __init__
raise OSError,"Could not load LAMMPS dynamic library"
OSError: Could not load LAMMPS dynamic library

What is the problem?

Thanks,
-Nabil

ckloss's picture

ckloss | Mon, 08/25/2014 - 22:59

Hi Nabil,

sorry I did not try this yet either. you could try posting this to the LAMMPS mailing list

Christoph

jtvanlew | Thu, 09/25/2014 - 23:27

did you create the dynamic library with these commands?

make makeshlib
make -f Makefile.shlib fedora

in the src directory of LIGGGHTS? (note i use the fedora makefile so you might have diff syntax on that second line.

If you have done that, have you given python knowledge of the location of the dynamic libraries?

For me, for instance, I have this in my bash file:

export PYTHONPATH=$PYTHONPATH:/home/jon/LIGGGHTS/LIGGGHTS-PUBLIC/python
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jon/LIGGGHTS/LIGGGHTS-PUBLIC/src

jon

jtvanlew | Thu, 09/25/2014 - 23:28

i'll also add that on my ubuntu machine, i couldn't get it to work until i added the -fPIC flag to the SH_FLAGS in the fedora makefile. something similar might be your problem.

jon