Bug 466333 - mvapich2's mpicxx compiler has errors
mvapich2's mpicxx compiler has errors
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mvapich2 (Show other bugs)
5.3
All Linux
high Severity high
: rc
: ---
Assigned To: Doug Ledford
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-09 15:17 EDT by Gurhan Ozen
Modified: 2013-11-03 20:37 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-10 10:22:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gurhan Ozen 2008-10-09 15:17:37 EDT
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 10:22:50 EST
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 11:55:18 EST
(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 12:04:14 EST
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.

Note You need to log in before you can comment on or make changes to this bug.