Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2161 Discussions

/opt/intel/impi/3.2.0.011/include/mpi.h(35): catastrophic error: #error directive: A wrong version of mpi.h file was included

Keerti_Bhamidipati
775 Views

I am trying to compile a CFD code using the Intel Compiler v 11.1 and Intel MPI 3.2.0.011 on a new cluster. I have previously successfully compiled this code on a RedHat 5 clutser using GCC 4.1.2 and OpenMPI.

I belive I haveI setup the environment properly, but I am getting the error:
/opt/intel/impi/3.2.0.011/include/mpi.h(35): catastrophic error: #error directive: A wrong version of mpi.h file was included. Check include path.

The terminal output from the compile is included at the bottom of this post.

I used CMake to setup the Makefile paths. The paths currently being used are:

CMAKE_CXX_COMPILER:FILEPATH=/opt/intel/11.1/bin/intel64/icpc
CMAKE_C_COMPILER:FILEPATH=/opt/intel/11.1/bin/intel64/icc
CMAKE_Fortran_COMPILER:FILEPATH=/opt/intel/11.1/bin/intel64/ifort
EXTRALIB:STRING=-L/opt/intel/11.1/lib/intel64/ -lifcore -limf -lirc
MPIEXEC:FILEPATH=/opt/intel/impi/3.2.0.011/bin64/mpiexec
MPI_EXTRA_LIBRARY:STRING=/opt/intel/impi/3.2.0.011/lib64/libmpiic4.so;/opt/intel/impi/3.2.0.011/lib64/libmpiif.so;/opt/intel/impi/3.2.0.011/lib64/libmpigi.a;/usr/lib64/librt.so;/usr/lib64/libpthread.so;/usr/lib64/libdl.so
MPI_INCLUDE_PATH:STRING=/opt/intel/impi/3.2.0.011/include
MPI_LIBRARY:FILEPATH=/opt/intel/impi/3.2.0.011/lib64/libmpi.so
MPI_COMPILER:FILEPATH=/opt/intel/impi/3.2.0.011/bin64/mpiicpc

Any help/suggestions on what could be causing this would be greatly appreciated.

Thank you,
Keerti

*** TERMINAL OUTPUT ***

141 harold-l7> make VERBOSE=1 /usr/people/keertib/cmake-2.8.0-Linux-i386/bin/cmake -H/usr/people/keertib/AERO-Suite/aerof.v625-iMPI -B/usr/people/keertib/AERO-Suite/aerof.v625-iMPI --check-build-system CMakeFiles/Makefile.cmake 0
/usr/people/keertib/cmake-2.8.0-Linux-i386/bin/cmake -E cmake_progress_start /usr/people/keertib/AERO-Suite/aerof.v625-iMPI/CMakeFiles /usr/people/keertib/AERO-Suite/aerof.v625-iMPI/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/usr/people/keertib/AERO-Suite/aerof.v625-iMPI'
make -f CMakeFiles/FluidBase.dir/build.make CMakeFiles/FluidBase.dir/depend
make[2]: Entering directory `/usr/people/keertib/AERO-Suite/aerof.v625-iMPI'
cd /usr/people/keertib/AERO-Suite/aerof.v625-iMPI && /usr/people/keertib/cmake-2.8.0-Linux-i386/bin/cmake -E cmake_depends "Unix Makefiles" /usr/people/keertib/AERO-Suite/aerof.v625-iMPI /usr/people/keertib/AERO-Suite/aerof.v625-iMPI /usr/people/keertib/AERO-Suite/aerof.v625-iMPI /usr/people/keertib/AERO-Suite/aerof.v625-iMPI /usr/people/keertib/AERO-Suite/aerof.v625-iMPI/CMakeFiles/FluidBase.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/usr/people/keertib/AERO-Suite/aerof.v625-iMPI'
make -f CMakeFiles/FluidBase.dir/build.make CMakeFiles/FluidBase.dir/build
make[2]: Entering directory `/usr/people/keertib/AERO-Suite/aerof.v625-iMPI'
/usr/people/keertib/cmake-2.8.0-Linux-i386/bin/cmake -E cmake_progress_report /usr/people/keertib/AERO-Suite/aerof.v625-iMPI/CMakeFiles
[ 0%] Building CXX object CMakeFiles/FluidBase.dir/NavierStokesSolver.C.o
/opt/intel/11.1/bin/intel64/icpc -DDO_MODAL -DUSE_MPI -DMPICH_IGNORE_CXX_SEEK -DTEMPLATE_FIX -D__LINUX -DF_NEEDS_UNDSC -DTYPE_PREC=float -O3 -DNDEBUG -I/usr/people/keertib/AERO-Suite/aerof.v625-iMPI/. -I/opt/intel/impi/3.2.0.011/include -fPIC -o CMakeFiles/FluidBase.dir/NavierStokesSolver.C.o -c /usr/people/keertib/AERO-Suite/aerof.v625-iMPI/NavierStokesSolver.C
/opt/intel/impi/3.2.0.011/include/mpi.h(35): catastrophic error: #error directive: A wrong version of mpi.h file was included. Check include path.
# error A wrong version of mpi.h file was included. Check include path.
^

compilation aborted for /usr/people/keertib/AERO-Suite/aerof.v625-iMPI/NavierStokesSolver.C (code 4)
make[2]: *** [CMakeFiles/FluidBase.dir/NavierStokesSolver.C.o] Error 4
make[2]: Leaving directory `/usr/people/keertib/AERO-Suite/aerof.v625-iMPI'
make[1]: *** [CMakeFiles/FluidBase.dir/all] Error 2
make[1]: Leaving directory `/usr/people/keertib/AERO-Suite/aerof.v625-iMPI'
make: *** [all] Error 2
142 harold-l7>

0 Kudos
4 Replies
Andres_M_Intel4
Employee
775 Views

I've never used CMAKE before, but as a first suggestion I would try using mpiicc as compiler.Most MPI applications can be easily compiled out-of-the-box with this wrapper to avoid -I/-L issues like yours.

Also, double check that the environment is not mixed with different compilers and MPI implementations. I would recommend sourcing the different environment setup scripts on your ~/.bashrc.

0 Kudos
Keerti_Bhamidipati
775 Views

Yup, that fixed it!

I removed the -I/opt/intel/impi/3.2.0.011/include and made sure the compiler used was /opt/intel/impi/3.2.0.011/bin64/mpiicpc and that error disappeared.

Interestingly, simply changing the compiler to /opt/intel/impi/3.2.0.011/bin64/mpiicpc did not make the error disappear.

Thank you,
Keerti

0 Kudos
Gergana_S_Intel
Employee
775 Views

Interestingly, simply changing the compiler to /opt/intel/impi/3.2.0.011/bin64/mpiicpc did not make the error disappear.

Hi Keerti,

The reason is, you should have included "-I/opt/intel/impi/3.2.0.011/include64" instead. You're using the 64-bit library, but not the 64-bit headers. That's most likely the cause of the error.

I'm glad you have it working either way.

Regards,
~Gergana

0 Kudos
Keerti_Bhamidipati
775 Views

This is correct. Modifying that line, is another way to fix the MPI compile issue.

Thank you,
Keerti

0 Kudos
Reply