[mpich-discuss] Trouble linking mpich2 libraries

Daniel Fulton dfulton at uci.edu
Tue Oct 18 06:15:35 CDT 2011


Hi,

I've just compiled and installed mpich2-1.4.1p1 on my workstation, but I'm having trouble linking it to my application.   I'm running on an Intel Core i3, using openSUSE 11.4.  The version in the repositories is old, hence the install from source.

When I try to make my program, I get errors:

In file included from ../TOOPAC/src/ArrayFunctions.cpp:9:0:
../TOOPAC/src/MPIInclude.h:6:11: error: ‘MPI’ does not name a type
In file included from ../TOOPAC/src/Converter.cpp:11:0:
../TOOPAC/src/MPIInclude.h:6:11: error: ‘MPI’ does not name a type
In file included from ../TOOPAC/src/ArrayFunctions.cpp:18:0:
../TOOPAC/src/MPIFunctions.h:16:19: error: ‘MPI’ does not name a type
../TOOPAC/src/MPIFunctions.h:19:1: error: expected unqualified-id before ‘int’
../TOOPAC/src/MPIFunctions.h:34:12: error: ‘MPI’ does not name a type

...
and many many similar.  The program has been compiled successfully before, so I know it is just a problem with my mpich2 install.

Compile options are as follows:
COMPILE  = mpicxx -c -O -DUSE_FORTRAN_DOUBLE -DUSE_HDF5 -DH5_USE_16_API -DUSE_MPI -DUSE_PETSC -I. -I../TOOPAC/src -I../TOOPAC/tests -I../utils/src -I/usr/include -I/usr/local/include -I/usr/local/petsc-3.1-p8/include -I/usr/local/petsc-3.1-p8/linux-gnu-c-debug/include
FCOMPILE = mpif90 -c -O -w
LINKER   = mpicxx
LIBTOOL  = ar r
CLIBS    = ../utils/lib/lib.a -lhdf5 -L/usr/local/lib -lmpich -lmpichcxx -L/usr/local/petsc-3.1-p8/linux-gnu-c-debug/lib -lpetsc -lflapack -lfblas -lgfortran -ldl

And I believe all the header files are in the appropriate place in /usr/local include:
dfulton at stoat:~> ls /usr/local/include/
mpi_base.mod       mpif.h   mpiof.h          mpix.h            opa_queue.h
mpi_constants.mod  mpi.h    mpio.h           opa_config.h      opa_util.h
mpicxx.h           mpi.mod  mpi_sizeofs.mod  opa_primitives.h  primitives

Any thoughts on where I'm going wrong?

Dan



More information about the mpich-discuss mailing list