Description of problem: /usr/lib64/mvapich2/1.0.3-gcc/bin/mpicxx sendrec.cc -o sendrec In file included from /usr/lib64/mvapich2/1.0.3-gcc/include/mpi.h:1104, from sendrec.cc:12: /usr/lib64/mvapich2/1.0.3-gcc/include/mpicxx.h:26:2: error: #error "SEEK_SET is #defined but must not be for the C++ binding of MPI" /usr/lib64/mvapich2/1.0.3-gcc/include/mpicxx.h:30:2: error: #error "SEEK_CUR is #defined but must not be for the C++ binding of MPI" /usr/lib64/mvapich2/1.0.3-gcc/include/mpicxx.h:35:2: error: #error "SEEK_END is #defined but must not be for the C++ binding of MPI" Version-Release number of selected component (if applicable): # rpm -qf /usr/lib64/mvapich2/1.0.3-gcc/bin/mpicxx mvapich2-1.0.3-2.el5 How reproducible: Very Steps to Reproduce: 1. Try to compile a program with mpicxx. Additional info:
This is a case of user error. The mpi.h must be included *before* iostream in the source code or else you get this error. If you include mpi.h before iostream.h, then things work fine.
(In reply to comment #1) > This is a case of user error. The mpi.h must be included *before* iostream in > the source code or else you get this error. If you include mpi.h before > iostream.h, then things work fine. Interesting, that's correct. Looks as if mvapich2 behaves differently on this aspect than the rest of the mpi implementations we ship then, as on others this didn't cause an issue.
It's an implementation specific issue. From the mpicxx.h file: // There is a name conflict between stdio.h and the MPI C++ binding // with respect to the names SEEK_SET, SEEK_CUR, and SEEK_END. MPI // wants these in the MPI namespace, but stdio.h will #define these // to integer values. #undef'ing these can cause obscure problems // with other include files (such as iostream), so we instead use // #error to indicate a fatal error. Users can either #undef // the names before including mpi.h or include mpi.h *before* stdio.h // or iostream.