Weird behavior of Molfile with dump molfile command

Hi devs and community of LAMMPS

First of all, thank you for the powerful and versatile code! Awesome Job (with the capitol J)

Recently I was trying to dump a .xml trajectory of my simulation using the dump molfile command, and I encountered some problem. I am using LAMMPS 14May2016.

My command is

                        dump t_xml all molfile 500 traj.xml hoomd /home/federico/programs/sources/library/hoomd-molfile-plugin/LINUXAMD64

and when it runs produced the annoying error

ERROR on proc 0: No suitable molfile plugin found (../dump_molfile.cpp:109)

First of all, I tried others plugin, to understand if something was missing in the path (you never know). However, pdb and dcd were working fine, and I was able to write and read these files.
I tried with vaspxml, but I got the same error.

I tried to hack my way in the code, and I find out that the hoomd plugin, and only that one, cannot be opened by dlopen in molfile_interface.cpp.

by inserting the command

     if(!dlopen(fname, RTLD_NOW))
                std::cout << fname << ' ' << dlerror() << std::endl;

I got

     /home/federico/programs/sources/library/hoomd-molfile-plugin/LINUXAMD64/hoomdplugin.so libexpat.so.0: cannot open shared object file: No such file or directory
  
Which is weird, since all the other plugin can be opened. For no apparent reason (to me) if I try to use vaspxml, the plug-in is open with dlopen, but the code answer again

ERROR on proc 0: No suitable molfile plugin found (../dump_molfile.cpp:109)

I tried to reinstall the MOLFILE plug-ins but with no luck. I am using the header of VMD 1.9.2 and not those in the original package of LAMMPS.

I also have a large number of trajs to convert in .xml (~200 files), and I was planning to use LAMMPS, by reading and writing with molfile.

So the question is: Am I doing something weird? Is the molfile plug-ins that I have? Or is it something weird with LAMMPS?

Thank you very much for the code and the support!

F.

Hi devs and community of LAMMPS

First of all, thank you for the powerful and versatile code! Awesome Job (with the capitol J)

Recently I was trying to dump a .xml trajectory of my simulation using the dump molfile command, and I encountered some problem. I am using LAMMPS 14May2016.

My command is

                        dump t_xml all molfile 500 traj.xml hoomd /home/federico/programs/sources/library/hoomd-molfile-plugin/LINUXAMD64

and when it runs produced the annoying error

ERROR on proc 0: No suitable molfile plugin found (../dump_molfile.cpp:109)

First of all, I tried others plugin, to understand if something was missing in the path (you never know). However, pdb and dcd were working fine, and I was able to write and read these files.
I tried with vaspxml, but I got the same error.

I tried to hack my way in the code, and I find out that the hoomd plugin, and only that one, cannot be opened by dlopen in molfile_interface.cpp.

by inserting the command

     if(!dlopen(fname, RTLD_NOW))
                std::cout << fname << ' ' << dlerror() << std::endl;

I got

     /home/federico/programs/sources/library/hoomd-molfile-plugin/LINUXAMD64/hoomdplugin.so libexpat.so.0: cannot open shared object file: No such file or directory

Which is weird, since all the other plugin can be opened. For no apparent reason (to me) if I try to use vaspxml, the plug-in is open with dlopen, but the code answer again

this is not weird at all.

ERROR on proc 0: No suitable molfile plugin found (../dump_molfile.cpp:109)

I tried to reinstall the MOLFILE plug-ins but with no luck. I am using the header of VMD 1.9.2 and not those in the original package of LAMMPS.

I also have a large number of trajs to convert in .xml (~200 files), and I was planning to use LAMMPS, by reading and writing with molfile.

So the question is: Am I doing something weird? Is the molfile plug-ins that I have? Or is it something weird with LAMMPS?

you are doing something unusual. you are trying to load a plugin that
is not self-contained, but requires a particular non-standard library.
most molfile plugins simply require the standard c/c++ libraries,
which tend to be present everywhere in a compatible version.

it should be possible to remedy the situation by setting/expanding the
path in the LD_LIBRARY_PATH variable to include a folder containing a
compatible version of libexpat.so.0.

axel.

Thank you Axel for the prompt reply!

Indeed, adding the libexpat.so.0 directory to LD_LIBRARY_PATH fixed the problem.

Thank you very much!

F.