<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:977955704;
        mso-list-type:hybrid;
        mso-list-template-ids:1673934670 -1 68157443 68157445 68157441 68157443 68157445 68157441 68157443 68157445;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style>
</head>
<body lang="IT" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I think I made the first step of having mingw64 from msys2 working with ms-mpi.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I found that the issue I was having was related to:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91556">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91556</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">and, probably (but impossible to check now), I was using an msys2 and/or mingw mpi package before this fix:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://github.com/msys2/MINGW-packages/commit/11b4cff3d2ec7411037b692b0ad5a9f3e9b9978d#diff-eac59989e3096be97d940c8f47b50fba">https://github.com/msys2/MINGW-packages/commit/11b4cff3d2ec7411037b692b0ad5a9f3e9b9978d#diff-eac59989e3096be97d940c8f47b50fba</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Admittedly, I never used gcc 10 before on any machine. Still, I feel that reporting that sort of error in that way is,<o:p></o:p></p>
<p class="MsoNormal">at least, misleading (I would have preferred the initial implementation as mentioned in the gcc bug track).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">A second thing that I was not used to, and made me more uncertain of the procedure I was following, is having to compile myself the mpi module. There are several version of this out there, but I decided to stick with this one:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://www.scivision.dev/windows-mpi-msys2/">https://www.scivision.dev/windows-mpi-msys2/</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">even if there seems to be no need to include -fno-range-check and the current mpi.f90 version is different from the mpif.h as reported here:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://github.com/microsoft/Microsoft-MPI/issues/33">https://github.com/microsoft/Microsoft-MPI/issues/33</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">which, to me, are both signs of lack of attention on the fortran side by those that maintain this thing.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In summary, this is the procedure I followed so far (on a 64 bit machine with Windows 10):<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Install MSYS2 from https://www.msys2.org/ and just follow the install wizard<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Open the MSYS2 terminal and execute: pacman -Syuu<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Close the terminal when asked and reopen it<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Keep executing ‘pacman -Syuu’ until nothing else needs to be updated<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Close the MSYS2 terminal and reopen it (I guess because was in paranoid mode), then install packages with:<o:p></o:p></li></ul>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S base-devel git gcc gcc-fortran bsdcpio lndir pax-git unzip<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-toolchain<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-msmpi<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-cmake<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-freeglut<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-gsl<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-libmicroutils<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-hdf5<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-openblas<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-arpack<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">pacman -S mingw-w64-x86_64-jq<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph">This set should include all the libraries mentioned by Pierre and/or used by his Jenkins, as the final scope here is to have PETSc and dependencies working. But I think that for pure MPI one could stop to msmpi (even, maybe, just
 install msmpi and have the dependencies figured out by pacman). Honestly, I don’t remember the exact order I used to install the packages, but this should not affect things. Also, as I was still in paranoid mode, I kept executing ‘pacman -Syuu’ after each
 package was installed. After this, close the MSYS2 terminal.<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Open the MINGW64 terminal and create the .mod file out of the mpi.f90 file, as mentioned here
<a href="https://www.scivision.dev/windows-mpi-msys2/"><span class="apple-converted-space"><span style="color:windowtext;text-decoration:none">https://www.scivision.dev/windows-mpi-msys2/</span></span></a>, with:<o:p></o:p></li></ul>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">cd /mingw64/include<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:70.8pt">gfortran mpif90 -c -fno-range-check -fallow-invalid-boz<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph">This is needed to ‘USE mpi’ (as opposed to INCLUDE ‘mpif.h’)<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Install the latest MS-MPI (both sdk and setup) from
<a href="https://www.microsoft.com/en-us/download/details.aspx?id=100593"><span class="apple-converted-space"><span style="color:windowtext;text-decoration:none">https://www.microsoft.com/en-us/download/details.aspx?id=100593</span></span></a><o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">At this point I’ve been able to compile (using the MINGW64 terminal) different mpi test programs and they run as expected in the classical Windows prompt. I added this function to my .bashrc in MSYS2 in order to easily copy the required
 dependencies out of MSYS:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">function copydep() { ldd $1 | grep "=> /$2" | awk '{print $3}' | xargs -I '{}' cp -v '{}' .; }<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">which can be used, with the MINGW64 terminal, by navigating to the folder where the final executable, say, my.exe, resides (even if under a Windows path) and executing:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">copydep my.exe mingw64<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This, of course, must be done before actually trying to execute the .exe in the windows cmd prompt.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hopefully, I should now be able to follow Pierre’s instructions for PETSc (but first I wanna give a try to the system python before removing it)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Paolo<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>