[lammps-users] how to solve "/usr/bin/ld: cannot find -lmpi"

when compile lammps on my linux system, I encountered this problem:

g++ -O -L…/STUBS *****.o … ******.o -lmpi -o …/lmp_serial

/usr/bin/ld: cannot find -lmpi
collect2: ld returned 1 exit status
make[1]: *** […/lmp_serial] Error 1

My mpich’s intalled path is /usr/local/mpich-1.2.5/

My system is Linux 2.4.18

does it need a mpi.o file? but i cann’t find it in my system
can you help me?
thank you in advance

hai xiang

You need to type "make" within the STUBS sub-dir to create a libmpi.a
before making LAMMPS from the src dir.

This is explained in the "Making LAMMPS" section of the manual.