Skip to content

Setup Win32 development environment

Kelly (KT) Thompson edited this page May 17, 2021 · 13 revisions

Custom Configuration for some development tools

Microsoft MPI

  • 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).

  • 64-bit support

    • Start a MSYS64/MinGW64 shell
      • Ensure that a 64-bit versions of gendef and dlltool are installed.
      • Navigate to a working directory: cd $TEMP
      • Generate a msmpi.def file from msmpi.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 to C:\work\vcpkg\installed\x64-windows\debug\lib and C:\work\vcpkg\installed\x64-windows\lib
      • Clean up temporary files: rm msmpi.def*
  • 32-bit support

    • Start a MSYS64/MinGW32 shell
      • Ensure that a 32-bit versions of gendef and dlltool are installed.
      • Navigate to a working directory: cd $TEMP
      • Generate a msmpi.def file from msmpi.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*

Links