Error when compiling C++ aps using Intel® MPI Library compilation driver mpiicpc

Issue

When compiling certain C++ applications using the Intel® MPI Library compilation driver mpiicpc, I encounter an error message that looks something like the following:


/opt/intel/mpi/3.1/include/mpicxx.h(45): catastrophic error: #error directive: "SEEK_SET is #defined but must not be for the C++ binding of MPI"
#error "SEEK_SET is #defined but must not be for the C++ binding of MPI"


Compilation aborted for my_mpi_program.cpp (code 4)
make: *** [my_mpi_program.o] Error 4

Solution

For the application my_mpi_program.cpp, you have two options:

  1. Try organizing the include files such that mpi.h comes before stdio.h
  2. Use the -DMPICH_IGNORE_CXX_SEEK and -DMPICH_SKIP_MPICXX options at compile time. This issue is inherited from the MPICH source code. According to that website, 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. The latest versions of the Intel MPI Library have resolved this internally.
Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.