-
Notifications
You must be signed in to change notification settings - Fork 0
Setup Win32 development environment
Kelly (KT) Thompson edited this page May 17, 2021
·
13 revisions
-
MS MPI works out of the box for Visual Studio projects. However, Draco will use the CMakeAddFortranSubdirectory feature to generate Makefile+gfortran CMake external projects to support Fortran components. These Fortran components must link against a compatible MPI library. These instructions explain how to create a
libmpi.a
library from MS MPI's dll library that can be used in MinGW. -
Patch MS MPI's Fortran Header (may or may not be needed).
- Consider pulling the version of this file from https://github.com/microsoft/Microsoft-MPI/pull/44.
-
64-bit support
- Start a MSYS64/MinGW64 shell
- Ensure that a 64-bit versions of
gendef
anddlltool
are installed. - Navigate to a working directory:
cd $TEMP
- Generate a
msmpi.def
file frommsmpi.dll
:/c/msys64/mingw32/bin/gendef.exe /c/windows/system32/msmpi.dll
- Use the dll and the def file to generate a static library:
dlltool -d msmpi.def -l libmsmpi.a -D msmpi.dll
- Install the new MinGW compatible MS MPI library to a standard location
cp libmsmpi.a /c/Program Files (x86)/Microsoft SDKs/MPI/Lib/x64/.
- If msmpi is provided by vcpkg, also copy
libmsmpi.a
toC:\work\vcpkg\installed\x64-windows\debug\lib
andC:\work\vcpkg\installed\x64-windows\lib
- Clean up temporary files:
rm msmpi.def
*
- Ensure that a 64-bit versions of
- Start a MSYS64/MinGW64 shell
-
32-bit support
- Start a MSYS64/MinGW32 shell
- Ensure that a 32-bit versions of
gendef
anddlltool
are installed. - Navigate to a working directory:
cd $TEMP
- Generate a
msmpi.def
file frommsmpi.dll
:gendef /c/windows/system32/msmpi.dll
- Use the dll and the def file to generate a static library:
dlltool -d msmpi.def -l libmsmpi.a -D msmpi.dll
- Install the new MinGW compatible MS MPI library to a standard location
cp libmsmpi.a /c/Program Files (x86)/Microsoft SDKs/MPI/Lib/x86/.
- Clean up temporary files:
rm msmpi.def
*
- Ensure that a 32-bit versions of
- Start a MSYS64/MinGW32 shell
- Previous - Download and install basic tools
- Next - Setup development directories