[Trilinos-Users] Workaround for combining trilinos and mpich at franklin.nersc.gov

Williams, Alan B william at sandia.gov
Tue Jan 29 16:48:27 MST 2008


I've seen this problem before, when compiling another code on a cygwin machine with mpich installed.

The solution is very simple: just add this to your compile flags (at configure time): -DMPICH_IGNORE_CXX_SEEK

Alan


> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov
> [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf
> Of Ernesto Prudencio
> Sent: Tuesday, January 29, 2008 3:55 PM
> To: trilinos-users at software.sandia.gov
> Subject: [Trilinos-Users] Workaround for combining trilinos
> and mpich at franklin.nersc.gov
>
>
> Hi.
>
> Just for the trilinos team to know: while I was compiling
> trilinos packages, the compiler complained about SEEK_SET in
> mpicxx.h, a include file of mpich installation in franklin.
> In that file I found the following comments and code:
>
> // 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.
>
> #ifndef MPICH_IGNORE_CXX_SEEK
> #ifdef SEEK_SET
> #error "SEEK_SET is #defined but must not be for the C++
> binding of MPI"
> //#undef SEEK_SET
> #endif
> #ifdef SEEK_CUR
> #error "SEEK_CUR is #defined but must not be for the C++
> binding of MPI"
> //#undef SEEK_CUR
> #endif
> #ifdef SEEK_END
> //#undef SEEK_END
> #error "SEEK_END is #defined but must not be for the C++
> binding of MPI"
> #endif
> #endif
>
> In order to contour this problem, I just substitute inclusion
> of mpi.h in trilinos by some mpi_intermediate.h of mine, with
> the following contents:
>
> #ifdef SEEK_SET
> #define SEEK_SET_2 0
> #undef SEEK_SET
> #endif
>
> #ifdef SEEK_CUR
> #define SEEK_CUR_2 1
> #undef SEEK_CUR
> #endif
>
> #ifdef SEEK_END
> #define SEEK_END_2 2
> #undef SEEK_END
> #endif
>
> #include <mpi.h>
>
> #ifdef SEEK_END_2
> #define SEEK_END SEEK_END_2
> #endif
>
> #ifdef SEEK_CUR_2
> #define SEEK_CUR SEEK_CUR_2
> #endif
>
> #ifdef SEEK_SET_2
> #define SEEK_SET SEEK_SET_2
> #endif
>
> This solution worked for me, but the trilinos team might
> implement another definite solution in the package.
>
> Or, have you seen this problem before? If yes, is there any
> flag that I need to set during compilation?
>
> Thanks,
>
> Ernesto.
>
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
>



More information about the Trilinos-Users mailing list