Search code examples
c++windowsmingwms-mpi

Compiling MPI with mingw


I don't seem to be finding anything on this, or quite like this. I have this code that we want working with windows, so I've been using mingw and working to modify the code so it compiles. However, I ran into a big issue. The issue is entirely with Microsoft MPI. Our code includes and uses MPI for parallelization code. When the mingw compiler gets to the mpi portion, it tries to compile mpi.h and fails right away, because the overhead like (MPI_Offset and MPI_Count) are not declared in the header file (IIRC, they're usually done during compile time by mpicc or whatever, but MS-MPI doesn't do things that way, not really sure how it does things), it comes up with a bunch of "has not been declared" errors. How can I fix this? I really have no clue how MS-MPI works and the microsoft resources I've found do not help. I keep seein something about a cross platform mingw compiler, but I'm not sure what that is or how I'd use it. I have pretty much no experience compiling things outside of visual studio, and am only beginning to get familiar with mingw. Even pointers on where to look would be appreciated.


Solution

  • Interestingly enough, adding #include to the top of MS-MPI's mpi.h worked.