[petsc-users] R: PETSc and Windows 10

Paolo Lampitella paololampitella at hotmail.com
Mon Jun 29 03:32:44 CDT 2020


Thanks Pierre,

I’ll give a shot at it as soon as I have everything in place again

Paolo

Inviato da Posta<https://go.microsoft.com/fwlink/?LinkId=550986> per Windows 10

Da: Pierre Jolivet<mailto:pierre.jolivet at enseeiht.fr>
Inviato: domenica 28 giugno 2020 17:32
A: Paolo Lampitella<mailto:paololampitella at hotmail.com>
Cc: Satish Balay<mailto:balay at mcs.anl.gov>; petsc-users<mailto:petsc-users at mcs.anl.gov>
Oggetto: Re: [petsc-users] PETSc and Windows 10




On 28 Jun 2020, at 5:13 PM, Paolo Lampitella <paololampitella at hotmail.com<mailto:paololampitella at hotmail.com>> wrote:

Hello Pierre,

thank you very much. Knowing that you actually test it on a daily basis is already enough for me to then focus on the MSYS2-MinGw64 toolchain, which would be more straighforward to deploy (instead of having someone install cygwin) and valuable to reuse.

I already had the impression that your work on it was recent but, knowing that your actual code is C++, and seeing some recent issues with MS-MPI and gfortran, say

https://github.com/microsoft/Microsoft-MPI/issues/33

gave me the impression that the overall toolchain was poorly mantained/tested by Microsoft on the fortran side and maybe this could go undetected in non fortran projects.

It may be poorly tested, but it’s working, at least with MUMPS, see attached screenshot.
What I’d suggest is:
1) start from scratch with MSYS2 MS-MPI + mingw-w64-x86_64-toolchain, mingw-w64-x86_64-openblas, flex, gawk, gcc, gcc-fortran, gcc-libs, stuff like that (all installed by pacman, cf. https://github.com/FreeFem/FreeFem-sources/blob/master/etc/jenkins/deployRelease/README.md#windows-system)
2) you need to explicitly _remove_ mingw-w64-x86_64-python because PETSc ./configure cannot work with it (there has been recent changes w.r.t. Python 3 so maybe it’s better now): pacman -R mingw-w64-x86_64-python mingw-w64-x86_64-gdb
3) then use the same makefile as we use for PETSc
Do not hesitate if you run into issues.

Thanks,
Pierre

[cid:image001.png at 01D64D76.54C49F60]



I can also confirm that my problems with MSYS2 and MinGW64 already started at the MPI level and had nothing to do with PETSc… yet.

At this point, I guess, we can either go off radar (if there really isn’t much love for MSYS2 here 😉) or keep it going.

I will try to rework everything from scratch with MSYS2 and first make extensive MPI tests again. Maybe expect to be bothered again when I try to reuse your Makefile 😉

Thanks again

Paolo

Inviato da Posta<https://go.microsoft.com/fwlink/?LinkId=550986> per Windows 10

Da: Pierre Jolivet<mailto:pierre.jolivet at enseeiht.fr>
Inviato: domenica 28 giugno 2020 16:42
A: Paolo Lampitella<mailto:paololampitella at hotmail.com>
Cc: Satish Balay<mailto:balay at mcs.anl.gov>; petsc-users<mailto:petsc-users at mcs.anl.gov>
Oggetto: Re: [petsc-users] PETSc and Windows 10

Hello Paolo,



On 28 Jun 2020, at 4:19 PM, Satish Balay <balay at mcs.anl.gov<mailto:balay at mcs.anl.gov>> wrote:

On Sun, 28 Jun 2020, Paolo Lampitella wrote:



 1.  MSYS2+MinGW64 compilers. I understood that MinGW is not well supported, probably because of how it handles paths, but I wanted to give it a try, because it should be more “native” and there seems to be relevant examples out there that managed to do it. I first tried with the msys2 mpi distribution, produced the .mod file out of the mpi.f90 file in the distribution (I tried my best with different hacks from known limitations of this file as also present in the official MS-MPI distribution) and tried with my code without petsc, but it failed in compiling the code with some strange MPI related error (argument mismatch between two unrelated MPI calls in the code, which is non sense to me). In contrast, simple mpi tests (hello world like) worked as expected. Then I decided to follow this:



https://doc.freefem.org/introduction/installation.html#compilation-on-windows

Sorry, our (FreeFEM) documentation is not the best…

MSYS2+MinGW64 is a fantastic tool to deploy .exe with PETSc.
For example, in this .exe https://github.com/FreeFem/FreeFem-sources/releases/download/v4.6/FreeFEM-4.6-win7-64.exe, we ship PETSc + SLEPc (in real + complex) with MS-MPI, hypre, MUMPS, ScaLAPACK, SuperLU, SuiteSparse, ParMETIS, METIS, SCOTCH, TetGen, HPDDM, all compiled by PETSc, needless to say :)
There are some tricks, that you can copy/paste from https://github.com/FreeFem/FreeFem-sources/blob/master/3rdparty/ff-petsc/Makefile#L99-L120
Basically, hypre + MinGW64 does not work if you don’t supply '--download-hypre-configure-arguments=--build=x86_64-linux-gnu --host=x86_64-linux-gnu' and all CMake packages need an additional flag as well:
'--download-metis-cmake-arguments=-G "MSYS Makefiles"' '--download-parmetis-cmake-arguments=-G "MSYS Makefiles"' '--download-superlu-cmake-arguments=-G "MSYS Makefiles"'

This is tested on a daily basis on Windows 7 and Windows 10, so I’m a little puzzled by your MPI problems.
I’d suggest you stick to MS-MPI (that’s what we use and it’s trivial to install on MSYS2 https://packages.msys2.org/package/mingw-w64-x86_64-msmpi).

I’m not sure this is specific to PETSc, so feel free to have a chat in private.
But I guess we can continue on the mailing list as well, it’s just that there is not much love for MSYS2 over here, sadly.

Thanks,
Pierre




but the exact same type of error came up (MPI calls in my code were different, but the error was the same). Trying again from scratch (i.e., without all the things I did in the beginning to compile my code) the same error came up in compiling some of the freefem dependencies (this time not even mpi calls).



As a side note, there seems to be an official effort in porting petsc to msys2 (https://github.com/okhlybov/MINGW-packages/tree/whpc/mingw-w64-petsc), but it didn’t get into the official packages yet, which I interpret as a warning



 1.  Didn’t give a try to cross compiling with MinGw from Linux, as I tought it couldn’t be any better than doing it from MSYS2
 2.  Didn’t try PGI as I actually didn’t know if I would then been able to make PETSc work.

So, here there are some questions I have with respect to where I stand now and the points above:


    *   I haven’t seen the MSYS2-MinGw64 toolchain mentioned at all in official documentation/discussions. Should I definitely abandon it (despite someone mentioning it as working) because of known issues?

I don't have experience with MSYS2-MinGw64, However Pierre does - and perhaps can comment on this. I don't know how things work on the fortran side.



    *   What about the PGI route? I don’t see it mentioned as well. I guess it would require some work on win32fe

Again - no experience here.



    *   For my Cygwin-GNU route (basically what is mentioned in PFLOTRAN documentation), am I expected to then run from the cygwin terminal or should the windows prompt work as well? Is the fact that I require a second Enter hit and the mismanagement of serial executables the sign of something wrong with the Windows prompt?

I would think Cygwin-GNU route should work. I'll have to see if I can reproduce the issues you have.

Satish



    *   More generally, is there some known working, albeit non official, route given my constraints (free+fortran+windows+mpi+petsc)?

Thanks for your attention and your great work on PETSc

Best regards

Paolo Lampitella


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200629/4aefecad/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DFA1D24AE6EB426B872BCEF219F6A1AD.png
Type: image/png
Size: 668154 bytes
Desc: DFA1D24AE6EB426B872BCEF219F6A1AD.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200629/4aefecad/attachment-0001.png>


More information about the petsc-users mailing list