compile lammps with the MBX error

64 views
Skip to first unread message

Canjun Zhao

unread,
Nov 3, 2024, 12:58:02 AM11/3/24
to MBX-users
Dear developer,

I've tried multiple solutions on Google, but still get the following error message. Could you please help me point out the problem? The mpi I'm using for the whole process is mpicxx. i'm going crazy.

mpicxx -g -O3 -fopenmp -std=c++11  main.o      -L. -llammps_mpi_mbx   -L/lib -lfftw3 -lfftw3f    /16T_2/zcj/LAMMPS/MBX/lib/libmbx.a -o ../lmp_mpi_mbx
/usr/bin/ld: ./liblammps_mpi_mbx.a(platform.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Makefile:109: recipe for target '../lmp_mpi_mbx' failed
make[1]: *** [../lmp_mpi_mbx] Error 1
make[1]: Leaving directory '/16T_2/zcj/LAMMPS/lammps/src/Obj_mpi_mbx'
Makefile:381: recipe for target 'mpi_mbx' failed
make: *** [mpi_mbx] Error 2

MBX-users

unread,
Nov 4, 2024, 5:04:51 PM11/4/24
to MBX-users
Dear Canjun,
         This issue is a bit more on the LAMMPS side, but one we know how to solve. In your LAMMPS src/ directory, please modify both USER-MBX/Makefile.mpi_mbx and MAKE/Makefile.mpi_mbx.

On line 36 of both of these files, you will need to add a new line including the following:
LIB += -ldl

This will explicitly link the -ldl so that the dlclose is defined. We've noticed this issue in the past sporadically depending both on the LAMMPS and compiler version being used. Hopefully this fix will resolve your issue!

All the best,
The MBX Team
Reply all
Reply to author
Forward
0 new messages