Bug 466333

Summary: mvapich2's mpicxx compiler has errors
Product: Red Hat Enterprise Linux 5 Reporter: Gurhan Ozen <gozen>
Component: mvapich2Assignee: Doug Ledford <dledford>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.3CC: jburke, peterm
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-11-10 15:22:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gurhan Ozen 2008-10-09 19:17:37 UTC
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:

Comment 1 Doug Ledford 2008-11-10 15:22:50 UTC
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.

Comment 2 Gurhan Ozen 2008-11-10 16:55:18 UTC
(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.

Comment 3 Doug Ledford 2008-11-10 17:04:14 UTC
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.