[lammps-users] compiling issues on Mac OS X 10.5.3


I downloaded the new LAMMPS (May 21, 2008), and tried to build it on my Mac, OSX 10.5.3. I want to build LAMMPS in serial, so I first did make in the STUBS directory, then did "make serial" in the src directory. The code itself appears to compile fine, but I get all sorts of linker errors that look like this:

thermo.o timer.o universe.o update.o variable.o velocity.o verlet.o write_restart.o -lmpi -o ../lmp_serial
Undefined symbols:
   "MPI_Recv(void*, int, int, int, int, int, MPI_Status*)", referenced from:
       LAMMPS_NS::Comm::irregular_create(int, int*, int*, int*)in comm.o
       LAMMPS_NS::Dump::write() in dump.o
       LAMMPS_NS::Temper::command(int, char**)in temper.o
       LAMMPS_NS::WriteRestart::write(char*) in write_restart.o
   "MPI_Wtime()", referenced from:


I'm using the standard Apple GCC 4.0, i.e.
haroldp1:src haroldpark$ gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*/s//-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)

If anyone has any idea why the linking is failing, I would very much appreciate it.


Looks like you are not linking to MPI correctly. If you do a
make clean in STUBS and then re-link LAMMPS, see if
it complains that there is no libmpi.a. If it doesn't that
means it is finding some other MPI lib on your box, which
could be the problem.

If you use STUBS, you want it to find only that MPI.