[lammps-users] Difficulty Connecting to Shared Libraries for LAMMPS

Hi all,

I’m a relatively new LAMMPS user who is trying to connect LAMMPS with the phonolammps python tool. I’ve run into some difficulties with getting the shared libraries connected, so I am testing everything out on the google colab for ease of sharing / to have a clean slate.

  • I have installed LAMMPS (10 Mar 2021)
  • I aim to run lammps with the USER-MEAMC package along with phonolammps
  • As stated above, I am currently in the google colab setup. I download and install lammps using the -DCMAKE_INSTALL_PREFIX to give the complete (no ~) location that matches my LD_LIBRARY_PATH
  • Upon running the following command:

!D_LIBRARY_PATH="$LD_LIBRARY_PATH" ldd which lmp

I get the following output

linux-vdso.so.1 (0x00007fff33bd4000) /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4 (0x00007f5f5ac63000) liblammps.so.0 => /usr/local/nvidia/lib/liblammps.so.0 (0x00007f5f5a478000) libmpi_cxx.so.20 => /usr/lib/x86_64-linux-gnu/libmpi_cxx.so.20 (0x00007f5f5a25e000) libmpi.so.20 => /usr/lib/x86_64-linux-gnu/libmpi.so.20 (0x00007f5f59f6c000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5f59be3000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5f599cb000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5f595da000) libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f5f593bf000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5f591a0000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5f58e02000) libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f5f58b9a000) libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f5f58968000) libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f5f58739000) libopen-rte.so.20 => /usr/lib/x86_64-linux-gnu/libopen-rte.so.20 (0x00007f5f584b1000) libopen-pal.so.20 => /usr/lib/x86_64-linux-gnu/libopen-pal.so.20 (0x00007f5f581ff000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5f57ff7000) libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007f5f57dba000) /lib64/ld-linux-x86-64.so.2 (0x00007f5f5b0e7000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f5f57b94000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5f57977000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5f57773000) libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f5f57570000) libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f5f57365000) libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f5f5715b000)

which leads me to believe that everything is okay (because there are no “not found” messages here)

However, when I try running a test phonolammps run, it claims that liblammps.so is not found. I apologize if this is a silly question at all, but I’m hoping there’s a simple explanation as to what I am doing wrong. Upon browsing through lammps documentation and the answers to a related question I may be confused about where, ideally, liblammps.so is supposed to live.

If it is helpful, I would be glad to share my google colab document so people may see my full installation steps.

Thank you, and have a great day,

-AJ

to use the LAMMPS python module you don’t need the full LAMMPS installation, it should suffice to do:
make install-python
(or “cmake . --build --target install-python”)

for the python module liblammps.so is expected to be either in a system location or within the python “site-packages” tree.

since “phonolammps” is not part of LAMMPS and we don’t know what it does and how and whether it is set up to correctly work with the LAMMPS python module, there is nothing beyond this general information that we can do. Please try using LAMMPS as provided in the examples in the manual to see if it works as documented and expected.

I have recently posted a notebook to this mailing list that only uses python code from the LAMMPS distribution and that was working for me:
https://sourceforge.net/p/lammps/mailman/message/37233828/

axel.