[gmx-users] Compiling with MPICH

Amadeu Sum akwsum at gmail.com
Sun Sep 26 17:50:49 CEST 2004

I am having some problems compiling Gromacs with MPICH. When I run
configure, it stops at:

checking whether the MPI cc command works... configure: error: Cannot
compile and link MPI code with mpicc

I have read previous posting with similar problem, but I believe I
have been setting the correct path and variables as suggested. Here is
how I am running configure:

> PATH=$PATH:/usr/local/mpich/bin CPPFLAGS="-I/usr/local/fftw-mpi/include -I/usr/local/mpich/include -I/usr/local/gm/include" LDFLAGS="-L/usr/local/fftw-mpi/lib -L/usr/local/mpich/lib -L/usr/local/gm/lib" LIBS="-lmpich -lgm -lm -static"  ./configure --prefix=/usr/local/gromacs_mpi --disable-float --enable-mpi --enable-all-static --without-x --without-xml

I have also tried to export those variables instead of specifying as
show above and I still get the same problem. I also tried not
specifying the path to mpicc, but instead use MPICC=cc, and that got
me to the same place too.

If I look at the config.log file, I see:

configure:3422: mpicc -o conftest -g -O2 -I/usr/local/fftw-mpi/include -I/usr/lo
cal/mpich/include -I/usr/local/gm/include -L/usr/local/fftw-mpi/lib -L/usr/local
/mpich/lib -L/usr/local/gm/lib conftest.c -lmpich -lgm -lm -static >&5
/usr/local/mpich/lib/libmpich.a(gmpi_malloc.o)(.text+0x46): In function `malloc_
: undefined reference to `pthread_self'
/usr/local/mpich/lib/libmpich.a(gmpi_malloc.o)(.text+0xa9): In function `malloc_
(** and a bunch more of similar undefined references **)

Can anyone give me some clues to what may be the problem?

I am doing this in a P4 machine with RH9 and the GNU compiler.

Thanks in advance,


More information about the gromacs.org_gmx-users mailing list