custom fix and pairstyle give error when called from python

Hi all,

I have a custom fix and pair style that I use quite often. I've compiled
the shared lib according the instructions and re installed the python
packages after the changes.

Both the old and the pylammps interfaces don't recognize them.

Both the pair style and the fix show up in the output from lammps -h |
more.

The lammps binary runs without problems.

Running the same input file through lmp.file("inputfile") gives "ERROR:
Unknown pair style"

When I use the same lammps library in my openfoam-lammps code it runs ok.

Is this me or a bug?

Thanks,

Victor

Hi all,

I have a custom fix and pair style that I use quite often. I've compiled
the shared lib according the instructions and re installed the python
packages after the changes.

Both the old and the pylammps interfaces don't recognize them.

Both the pair style and the fix show up in the output from lammps -h |
more.

The lammps binary runs without problems.

Running the same input file through lmp.file("inputfile") gives "ERROR:
Unknown pair style"

When I use the same lammps library in my openfoam-lammps code it runs ok.

Is this me or a bug?

​this is very unlikely to be a bug.
you can cross-check which library object and LAMMPS version was picked up​
and which styles they contain through the "info" command.
so do a lmp.command("info all") and see what your python module picked up.

axel.

Yep that’s indeed the problem, in my first mail lammps found an old shared lib based on vanilla lammps. Installind the lammps python bindings in a clean anaconda env gave the error that the shared lib wasn’t found.

As a quick fix I prepended my LD_LIBRARY_PATH with the lammps src folder. Would be nicer to add the shared lib to the anaconda env. Not sure how to do that right now.