This container is used to build binaries for all three platforms (linux, darwin (MacOS) and windows).
For Linux and MacOs it uses custom build MPICH libraries using the x86-64-linux-gnu or x86-64-apple-darwin toolchains (set with the --host argument for the configure script). See Dockerfile and download_compile_mpich.sh.
For Windows the MSMPI library is used.
MPI is linked statically.
The toolchains can be used by providing meson with an appropriate hostfile (--cross-file) which can be found at /hostfiles:
hostfile_windowshostfile_windows_mpihostfile_linuxhostfile_linux_mpihostfile_darwinhostfile_darwin_mpi
In order for meson to use the correct static MPI libraries, the -Dcustom-mpi=true option must be given if any of the *_mpi hostfiles is used. Otherwise MPI cannot be found.
The OSX SDK is created using OSXCROSS: https://github.com/tpoechtrager/osxcross#packaging-the-sdk
Here you'll find the instructions on how to create libmsmpi.a for the MinGW-w64 cross-compiler to link against for MPI applications, given the free MS-MPI Redistributable Package. Note: this requires a Windows installation
- Download and install Microsoft MPI (SDK and Setup) from https://www.microsoft.com/en-us/download/details.aspx?id=100593 on a Windows machine
- Copy the file
C:\Windows\System32\msmpi.dlltoC:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64 - Transfer the folder
C:\Program Files (x86)\Microsoft SDKs\MPI\to a Linux machine
Make sure to install the mingw32 on your linux machine (Ubuntu packages: mingw-64, mingw-64-tools).
Assuming the MSMPI distribution copied over from Windows, in the previous step, is located at <msmpi-linux-home> execute the following steps in a terminal:
cd <msmpi-linux-home>/Lib/x64gendef msmpi.dllx86_64-w64-mingw32-dlltool -d msmpi.def -l libmsmpi.a -D msmpi.dll- Create an archive of folder
<msmpi-linux-home>namedmsmpi_v<version_number>.tar.gz