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

Nico Schlömer nico.schloemer at ua.ac.be
Fri Dec 24 13:23:12 MST 2010


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



More information about the Trilinos-Users mailing list