Link mpi.h to Dev-C++ RRS feed

  • Question

  •   Hi,

          I downloaded MSMPI window version and installed it under Program Files (by default).

          I used Dev-C++ to do a simple .cpp program for mpi. I used #include "mpi.h" to call mpi libraries. But I got error messages:  

     6 18 C:\dli\C++\bones_mpi.cpp [Error] mpi.h: No such file or directory,

     after I compiled the program.

         I think I might need to set up something in Dev-C++, but I do not know how.

        Thanks in advance!!



    Sunday, October 25, 2015 3:01 AM

All replies

  • Hi,

    Have you also installed the msmpisdk package (in addition to the MSMPISetup.exe)? You will need the SDK package to have mpi.h and the msmpi.lib file to compile and link your program.

    Assuming you have installed the msmpisdk package, you can add the include directory for Dev-C++ under Project Options\Directories\Include Directories. If you have installed the msmpisdk package using the default option, the header file mpi.h should be in the following directory "C:\Program Files (x86)\Microsoft SDKs\MPI\Include". If you are compiling for 64 bit system, you will need to add "C:\Program Files (x86)\Microsoft SDKs\MPI\Include\x64" into the list of include directories. On the other hand, if you are compiling for 32 bit system, you will need to add "C:\Program Files (x86)\Microsoft SDKs\MPI\Include\x86" into the list of include directories.

    You can also refer to this blog post for more information on how to compile and link a simple MS-MPI program. Note that the blog post uses Visual C++ as the IDE so it might look a bit different from DEV-C++


    Let us know if you have any other issues.



    Tuesday, October 27, 2015 12:45 AM