Can't find MPI C library for Windows

Hi,

I’m very new to using CMake trying to do something similar to this user and their post. Hopefully this is the right place to ask for help.

I’m trying to include Microsoft MPI (MSMPI) into this build which is the library I’m having difficulties with. I have MSMPI installed from a previous build of the program and haven’t been able to find the corresponding library in the program files for MSMPI.

If someone has been able to include MSMPI into their builds successfully for a Windows machine and help me out I would be super appreciative? Thanks in advance!

cmake -G “MSYS Makefiles” -DWITH_ELMERGUI:BOOL=TRUE -DWITH_MPI:BOOL=TRUE -DWITH_Hypre:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=…/install -DCMAKE_Fortran_COMPILER=/mingw64/bin/gfortran.exe -DQWT_INCLUDE_DIR=C:/msys64/mingw64/include/qwt-qt5/ -DWIN32:BOOL=TRUE -DCPACK_BUNDLE_EXTRA_WINDOWS_DLLS:BOOL=TRUE …/elmerfem
CMake Warning (dev) at CMakeLists.txt:17 (PROJECT):
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.

– The Fortran compiler identification is GNU 13.2.0
– The C compiler identification is GNU 13.2.0
– The CXX compiler identification is GNU 13.2.0
– Detecting Fortran compiler ABI info
– Detecting Fortran compiler ABI info - done
– Check for working Fortran compiler: C:/msys64/mingw64/bin/gfortran.exe - skipped
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:20 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 2.4 is not supported by CMake >= 3.0.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Deprecation Warning at CMakeLists.txt:20 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a … suffix to tell
CMake that the project does not need compatibility with older versions.

– Checking whether GFortran version >= 7 – yes
CMake Warning at cmake/Modules/FindMPI.cmake:406 (message):
Unable to find MPI library :libmsmpi.dll.a
Call Stack (most recent call first):
cmake/Modules/FindMPI.cmake:597 (interrogate_mpi_compiler)
CMakeLists.txt:227 (FIND_PACKAGE)

CMake Error at cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find MPI_C (missing: MPI_C_LIBRARIES)
Call Stack (most recent call first):
cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindMPI.cmake:615 (find_package_handle_standard_args)
CMakeLists.txt:227 (FIND_PACKAGE)

Are you sure that MSMPI is compatible with a MinGW toolchain?

It seems to be searching for a MinGW build of MSMPI, not the .lib that actually exists in the SDK.