[MPICH] about C++ and SEEK_SET

Zaiwen Wen zw2109 at columbia.edu
Mon Nov 21 11:31:08 CST 2005




Thank you for your message.

Jim kindly told me to add CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" during 
configuration and finally, I solved the problem. Anyway, thanks for your 
replying.

Regards!
Zaiwen

----------------------------------------------
Date: Mon, 21 Nov 2005 10:50:03 -0600
From: James Willenbring <jmwille at sandia.gov>
To: 'Zaiwen' <zw2109 at columbia.edu>, 'trilinos-help' 
<trilinos-help at software.sandia.gov>
Subject: RE: [Trilinos-Help] error during building: C++ and SEEK_SET

Zaiwen,

Please try adding

CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK"

to the list of options to pass to configure.

Jim

--------------------------------------

On Mon, 21 Nov 2005, Rajeev Thakur wrote:

> You can include mpi.h before including stdio.h or iostream.
> OR
> You can pass -DMPICH_IGNORE_CXX_SEEK as an argument when compiling your
> program.
>
> Rajeev
>
>
>> -----Original Message-----
>> From: owner-mpich-discuss at mcs.anl.gov
>> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of Zaiwen
>> Sent: Monday, November 21, 2005 10:24 AM
>> To: mpich-discuss
>> Subject: [MPICH] about C++ and SEEK_SET
>>
>>
>>
>> Hi, I encountered a problem during making package "Trilinos"
>> with mpi. The error information was:
>>
>> SEEK_SET is #defined but must not be for the C++ binding of MPI
>>
>>
>> The following is the solution from mpich2 FAQ:
>> ------------------------------------------------
>> C++ and SEEK_SET
>> Some users may get error messages such as
>>     SEEK_SET is #defined but must not be for the C++ binding of MPI
>>
>> The problem is that both stdio.h and the MPI C++ interface
>> use SEEK_SET, SEEK_CUR, and SEEK_END. This is really a bug in
>> the MPI-2 standard. You can try adding
>>     #undef SEEK_SET
>>     #undef SEEK_END
>>     #undef SEEK_CUR
>>
>> before mpi.h is included, or add the definition
>>     -DMPICH_IGNORE_CXX_SEEK
>>
>> to the command line (this will cause the MPI versions of
>> SEEK_SET etc. to be skipped).
>> ------------------------------------------------
>>
>>
>> I've tried the first solution -- modify every include file
>> and c++ source file which errors occured. However, I can't
>> get through compiling a file "ml_agg_min_energy.cpp". It
>> required definitions of "SEEK_SET, SEEK_END, SEEK_CUR" for
>> "stdio.h". I can not figure out which ".h" file introduced
>> such confliction although I change the order of declaration
>> of "stdio.h" and "mpi.h" in some files.
>>
>>
>> My questions is :
>> 	1.  Is there any simple solution rather modifing file by file?
>>
>> 	2.  How to figure out the second solution, say, how to
>> add the definition  "  -DMPICH_IGNORE_CXX_SEEK" to the
>> command line ? The meaning is vague here.   Is this solution
>> simpler than the first solution?
>>
>>
>> Thank you so much!
>>
>>
>> With my Best!
>> Zaiwen
>>
>>
>>
>>
>>
>




More information about the mpich-discuss mailing list