[Trilinos-Users] icpc: "Include mpi.h before stdio.h"

Littlewood, David John djlittl at sandia.gov
Fri Dec 24 13:43:42 MST 2010


If you're using MPICH, this might help,

-D CMAKE_CXX_FLAGS:STRING="-DMPICH_IGNORE_CXX_SEEK"

Dave


On 12/24/10 1:23 PM, "Nico Schlömer" <nico.schloemer at ua.ac.be> wrote:

Hi all,

a little compiler weirdness appears here when building on of my Trilinos
apps on the university HPC (with icpc (ICC) 11.1 20090630)

/apps/antwerpen/turing/harpertown/software/impi/3.2.1.009/include64/mpicxx.h(45):
catastrophic error: #error directive: "SEEK_SET is #defined but must not
be for the C++ binding of MPI. Include mpi.h before stdio.h"
   #error "SEEK_SET is #defined but must not be for the C++ binding of
MPI. Include mpi.h before stdio.h"

Somehow, the compiler doesn't like the inclusion of mpi.h to be preceded
by stdio.h, which is what happens though when including, e.g.,

Tpetra_Vector.hpp
  --> Tpetra_Vector_decl.hpp
    --> Tpetra_ConfigDefs.hpp
      --> Teuchos_ConfigDefs.hpp
        --> cstdio

I'm not sure what the proper fix for this would be. For now I just put

#include <Teuchos_config.h>
#ifdef HAVE_MPI
     #include <mpi.h>
#endif

at the start of the respective header file. Anyone else with this?

Cheers,
Nico

_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov
http://software.sandia.gov/mailman/listinfo/trilinos-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20101224/b7f44c71/attachment.html 


More information about the Trilinos-Users mailing list