Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Compiling MPI with VS2017 Linux

Compiling MPI with VS2017 Linux

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++visual-studiolinux
8 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kenneth Haugland
    wrote on last edited by
    #1

    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?

    L 1 Reply Last reply
    0
    • K Kenneth Haugland

      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?

      L Offline
      L Offline
      leon de boer
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • L leon de boer

        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

        K Offline
        K Offline
        Kenneth Haugland
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • K Kenneth Haugland

          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.

          L Offline
          L Offline
          leon de boer
          wrote on last edited by
          #4

          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

          K 1 Reply Last reply
          0
          • L leon de boer

            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

            K Offline
            K Offline
            Kenneth Haugland
            wrote on last edited by
            #5

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

            L 1 Reply Last reply
            0
            • K Kenneth Haugland

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

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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

              K 1 Reply Last reply
              0
              • L Lost User

                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

                K Offline
                K Offline
                Kenneth Haugland
                wrote on last edited by
                #7

                If I read you correctly I can configure VS2017 using MinGW-w64 as the compiler instead of g++?

                L 1 Reply Last reply
                0
                • K Kenneth Haugland

                  If I read you correctly I can configure VS2017 using MinGW-w64 as the compiler instead of g++?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups