Skip to content

Instantly share code, notes, and snippets.

@MVoz
Last active May 13, 2018 16:43
Show Gist options
  • Save MVoz/03347fd4cd3890ebbcee3b6420f5549d to your computer and use it in GitHub Desktop.
Save MVoz/03347fd4cd3890ebbcee3b6420f5549d to your computer and use it in GitHub Desktop.
msmpi on Linux

https://www.symscape.com/configure-msmpi-for-mingw-w64

https://www.symscape.com/configure-msmpi-v8-1-for-mingw-w64

Gather MPI distribution from Windows

Copy C:\Program Files\Microsoft HPC Pack 2012 to a temp location (e.g., D:\projects\mpi\ms-hpc) then copy C:\Windows\System32\msmpi.dll to \Lib\amd64.

Transfer to Linux. Create libmsmpi.a on Linux

Assuming the MSMPI distribution copied over from Windows, in the previous step, is located at (e.g., $HOME/projects/msmpi/ms-hpc) create libmsmpi.a using:

cd <msmpi-linux-home>/Lib/amd64
gendef msmpi.dll - creates msmpi.def
x86_64-w64-mingw32-dlltool -d msmpi.def -l libmsmpi.a -D msmpi.dll - creates libmsmpi.a

Fix missing __int64 definition

You will need to add #include <stdint.h> to /Inc/mpi.h:127 to define __int64.

Set compiler flags for user code

Compile in Linux using MinGW-w64 (e.g., x86_64-w64-mingw32-gcc) with compiler flags:

-I<msmpi-linux-home>/Inc
-L<msmpi-linux-home>/Lib/amd64
-lmsmpi

7z x mpi_64.msi

gendef msmpi64.dll

x86_64-w64-mingw32-dlltool -d msmpi64.def -l libmsmpi.a -D msmpi64.dll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment