Error compiling lammps with the lepton package

Dear LAMMPS developers and users,

I am trying to compile LAMMPS with the LEPTON package installed, and the following error occurs:

/usr/bin/ld: ../../lib/lepton/liblepton.a(core.virtmem.o): undefined reference to symbol 'shm_unlink@@GLIBC_2.2.5'
//usr/lib64/librt.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [../lmp_mpi] Error 1
make[1]: Leaving directory `/home/duy4/lammps-2Aug2023/src/Obj_mpi'
make: *** [mpi] Error 2

I have installed lepton library with “make lib-lepton args=”-m mpi"" and it returned sucessful, error occurs when I compile with “make mpi”.

I have tried compiling without the lepton package and it compiled without error.

The LAMMPS version I’m working with is 2 Aug 2023, the OS is CentOS Linux 7 .

Would you kindly review the problem and let me know if there’s a solution? Any insight is greatly appreciated.

Best regards,

Yiyang

As the error message is hinting at, you are missing a “-lrt” flag when linking.

You can copy src/MAKE/Makefile.mpi to src/MAKE/MINE/Makefile.mpi and then edit the latter by changing the line LIB = to LIB= -lrt and then make mpi should complete without error.

1 Like

Thank you very much! That has solved the problem.