I was trying to compile a c++ program using Intel compiler and Intel MPI 3.2. The compilation was successful, but during linking, I got the following error message:
: undefined reference to `MPI::INTEGER'
Is this a c++ binding problem, but isn't MPI 3.2 supposed to support C++ binding automatically? Could someone help me? Thanks!
Thanks for posting.
Certainly, the Intel MPI Library 3.2 supports theC++ bindings by default.
It'll be interesting to know how you're doing your compilation. Could you provide your command line & flags?
In general, we recommend you use one of the provided compiler drivers for the Intel MPI Library: such as mpigxx for the GNU* C++ compiler, or mpiicpc for the Intel C++ Compiler. Is that what you're doing?
More info on usage and so forth is available from the Intel MPI Library Reference Manual located in the
Are you including the correct header files when compiling? For example, this is what I would use to compile/link a simple Hello World C++ program:
icpc test.cpp -o testcpp -I/opt/intel/impi/3.2.1.009/include64 -L/opt/intel/impi/3.2.1.009/lib64 -lmpiic4 -lmpi -lmpiif -lmpigi -lrt -lpthread -ldl
Can you also make sure that MPI_ROOT is defined correctly in your environment? By default, if you source one of the mpivars.
Finally, it seems like you're actually linking with some of the MPICH-specific libraries; is this for a particular reason? (By the way, there's no -lpmpich library, perhaps you mean -lmpich).
Would you be willing to send me your Makefile and/or the code you're trying to compile? It might be easier for me to try it locally. My e-mail address is in the signature below. Just replace the "_at_" with "@". Thanks!