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 link will take you off of the Intel Web site. Intel does not control the content of the destination Web Site.

有关编译器优化的更完整信息,请参阅优化通知