Compiling MPI with VS2017 Linux
-
Using any MPI library, how do I configure the settings and build a mpi.h file (Can be a library from the Intel MPI or Open MPI) that I can use with the Linux C++ in VS?
-
Using any MPI library, how do I configure the settings and build a mpi.h file (Can be a library from the Intel MPI or Open MPI) that I can use with the Linux C++ in VS?
There is a whole section on it on MSDN Microsoft MPI[^] The windows native setup is well described How to compile and run a simple MS-MPI program – The Microsoft HPC & Batch Team Blog[^] I have never done the cross compile to linux I assume you just retarget However the forum and team contact links are on that page, start there.
In vino veritas
-
There is a whole section on it on MSDN Microsoft MPI[^] The windows native setup is well described How to compile and run a simple MS-MPI program – The Microsoft HPC & Batch Team Blog[^] I have never done the cross compile to linux I assume you just retarget However the forum and team contact links are on that page, start there.
In vino veritas
Cant use it, I asked the Microsoft MPI guys, and MSMPI only targets Windows. So in order to use MPI on Linux machines, you have to use some other MPI implementation, like Open MPI or Intel MPI.
-
Cant use it, I asked the Microsoft MPI guys, and MSMPI only targets Windows. So in order to use MPI on Linux machines, you have to use some other MPI implementation, like Open MPI or Intel MPI.
I guess the easy way then is don't cross it ... compile it under a linux distro. Is there any specific reason you wanted to cross it from Visual Studio?
In vino veritas
-
I guess the easy way then is don't cross it ... compile it under a linux distro. Is there any specific reason you wanted to cross it from Visual Studio?
In vino veritas
I want to be able to use the same MPI C++ code from both Windows and Linux, as it would effectively cut development time in half (its a rather complicated project).
-
I want to be able to use the same MPI C++ code from both Windows and Linux, as it would effectively cut development time in half (its a rather complicated project).
Hi, I've never done this. However I don't see any reason for this not to work. Try following the instructions here using gendef and dlltool for generating the Linux shared lib with the MinGW-w64 Cross-Compiler. TUTORIAL: Adapting MS-MPI for MinGW64[^] Ignore the fact that the tutorial is for GFortran. The lib portion of the tutorial is what you need. I am almost positive this should work... allowing you to have a single code base that compiles for both Windows and Linux. Best Wishes, -David Delaune
-
Hi, I've never done this. However I don't see any reason for this not to work. Try following the instructions here using gendef and dlltool for generating the Linux shared lib with the MinGW-w64 Cross-Compiler. TUTORIAL: Adapting MS-MPI for MinGW64[^] Ignore the fact that the tutorial is for GFortran. The lib portion of the tutorial is what you need. I am almost positive this should work... allowing you to have a single code base that compiles for both Windows and Linux. Best Wishes, -David Delaune
If I read you correctly I can configure VS2017 using MinGW-w64 as the compiler instead of g++?
-
If I read you correctly I can configure VS2017 using MinGW-w64 as the compiler instead of g++?
Yes.[^] If you spend some time setting this up... you will also only need 1 workstation to do the entire project. You can run your Linux binary on Windows Linux Subsystem. Install the Linux Subsystem on Windows 10 | Microsoft Docs[^] Spending 1/2 days setting this up may save you weeks in the long run... you can avoid multiple OS installations... multiple compilers... and do all your work in Visual Studio on Windows. Best Wishes, -HAL 9000