[petsc-users] Petsc not work in Windows-10

Matthew Knepley knepley at gmail.com
Tue Mar 31 13:49:08 CDT 2020


On Tue, Mar 31, 2020 at 2:42 PM Qin Lu via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> My program has multiple files in a single directory, and there are some
> other dependencies. Are you talking about /petsc-3.12.4/makefile? Is there
> any instructions on how to compile my code using petsc makefile?
>

Yes, there is a chapter in the manual.

  Thanks,

    Matt


> Thanks,
> Qin
>
> On Tuesday, March 31, 2020, 12:16:31 PM CDT, Satish Balay <
> balay at mcs.anl.gov> wrote:
>
>
> Is your code a single source file?  multiple sourcefiles in a single dir?
> any external dependencies other than petsc?
>
> If possible - try compiling your code with petsc makefile. Does the code
> run correctly this way?
>
> Satish
>
> On Tue, 31 Mar 2020, Qin Lu via petsc-users wrote:
>
> >  I built and tested ex1f.F90 and ex2f.F90, both call KSPCreate(), both
> work well.
> > My program is built using either MS Visual Studio or my own makefile.
> Are there any special compilation/link options required for my program in
> order to link with Petsc lib in Win-10?
> > Thanks,Qin
> >    On Tuesday, March 31, 2020, 11:51:43 AM CDT, Satish Balay <
> balay at mcs.anl.gov> wrote:
> >
> >  And use 'CHKERRA(ierr)' in your code to catch such failures early.
> >
> > Refer to example src/ksp/ksp/examples/tutorials/ex7f.F90
> >
> > >>>>>>>>>
> >       call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
> >       if (ierr /= 0) then
> >         write(6,*)'Unable to initialize PETSc'
> >         stop
> >       endif
> >
> >       call
> PetscOptionsGetInt(PETSC_NULL_OPTIONS,PETSC_NULL_CHARACTER,'-m',m,flg,ierr)
> >       CHKERRA(ierr)
> > <<<<<<
> >
> > etc..
> >
> > Satish
> >
> > On Tue, 31 Mar 2020, Satish Balay via petsc-users wrote:
> >
> > > Try PETSc examples with KSPCreate() - do they run correctly?
> > >
> > > How do you build your code - do you use petsc formatted makefile?
> > >
> > > Look for differences. Also run your code in valgrind on linux. Or you
> need to debug further on windows..
> > >
> > > Satish
> > >
> > > On Tue, 31 Mar 2020, Qin Lu via petsc-users wrote:
> > >
> > > >
> > > > In the MS Visual Studio debugger, I can see there are 2 calls
> before KSPSetType:
> > > >
> > > > call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
> > > >
> > > > call KSPCreate(PETSC_COMM_WORLD,ksp_solver,ierr)
> > > >
> > > > It turns out KSPCreate returns ierr=1, so it is the first Petsc call
> that got error.
> > > >
> > > > My program in Linux (also built with Intel compilers 2018) works
> without problem.
> > > >
> > > > Thanks,
> > > >
> > > > Qin
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >    On Tuesday, March 31, 2020, 11:01:56 AM CDT, Satish Balay <
> balay at mcs.anl.gov> wrote:
> > > >
> > > >  Do PETSc examples that use KSPSetType() say
> src/ksp/ksp/tutorials/ex7f.F90 compile/run with this install?
> > > >
> > > > Its probably best to run your code in a debugger to determine the
> problem.
> > > >
> > > > [If your code can compile on linux - I'll also suggest running it
> with valgrind]
> > > >
> > > > Satish
> > > >
> > > > On Tue, 31 Mar 2020, Qin Lu wrote:
> > > >
> > > > >  Hello,
> > > > > I moved Intel-MPI libs to a directory without space, now the
> configuration/build of Petsc-3.12.4 worked with Intel-MPI, and test of ex2
> worked well with mpiexec. However, my Fortran-90 program linked with this
> Petsc lib still crashed at calling KSPSetType(ksp_solver,KSPBCGS,ierr),
> same as what happened when using MPICH2. I suspect the issue is not in MPI,
> but in how Petsc is configured/built in Windows-10 using Intel compilers
> (the same program in Win-7 works without problem). The configuration is
> attached below.
> > > > >
> > > > > Do you any suggestions how to proceed?
> > > > > Thanks,Qin
> > > > > ============./configure --with-cc='win32fe icl' --with-fc='win32fe
> ifort' --with-cxx='win32fe icl'
> --with-petsc-arch="arch-win64-release-intel-mpi"
> --prefix=/cygdrive/c/cygwin_cache/petsc-3.12.4-release-win-64bit-intel-mpi
> --with-blas-lapack-dir="/cygdrive/c/Program Files
> (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> --with-mpi-include="/cygdrive/c/cygwin_cache/Intel-mpi-2019.6.166/intel64/include"
> --with-mpi-lib="/cygdrive/c/cygwin_cache/Intel-mpi-2019.6.166/intel64/lib/release/impi.lib"
> --with-mpi-compilers=0--with-debugging=0 --useThreads=0 --with-x=0
> --with-x11=0 --with-xt=0 --with-shared-libraries=0
> > > > >
> > > > >
> > > > >    On Tuesday, March 31, 2020, 08:39:01 AM CDT, Satish Balay via
> petsc-users <petsc-users at mcs.anl.gov> wrote:
> > > > >
> > > > >  On Mon, 30 Mar 2020, Jacob Faibussowitsch wrote:
> > > > >
> > > > > > >> We just cannot cope with spaces in paths. Can you use the
> shortened
> > > > > > >> contiguous name instead of "Program File"?
> > > > > >
> > > > > > FYI: Program Files or Program Files(x86) is where windows
> installs all of its applications (from OS or installed by user). It is best
> to install your MPI and other packages in root dir C:. Thats why for
> example MinGW installs itself in there, so it doesn’t have to deal with the
> space in the path.
> > > > >
> > > > > No need to do this alternate install if using cygpath - as per
> installation instructions
> https://www.mcs.anl.gov/petsc/documentation/installation.html
> > > > >
> > > > > Satish
> > > > >
> > > > > >
> > > > > > Best regards,
> > > > > >
> > > > > > Jacob Faibussowitsch
> > > > > > (Jacob Fai - booss - oh - vitch)
> > > > > > Cell: (312) 694-3391
> > > > > >
> > > > > > > On Mar 30, 2020, at 9:18 PM, Satish Balay via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
> > > > > > >
> > > > > > > On Mon, 30 Mar 2020, Matthew Knepley wrote:
> > > > > > >
> > > > > > >> On Mon, Mar 30, 2020 at 9:28 PM Qin Lu <lu_qin_2000 at yahoo.com>
> wrote:
> > > > > > >>
> > > > > > >>> Hi,
> > > > > > >>>
> > > > > > >>> I installed Intel-MPI 2019, and configured petsc-3.12.4 using
> > > > > > >>> --with-mpi-dir="/cygdrive/c/Program Files
> > > > > > >>> (x86)/IntelSWTools/mpi/2019.6.166/intel64", it didn't work.
> So I change to
> > > > > > >>> use --with-mpi-include and --with-mpi-lib, still didn't
> work. The
> > > > > > >>> config.log is attached.
> > > > > > >>>
> > > > > > >>> The following is my configuration:
> > > > > > >>> ===============
> > > > > > >>>
> > > > > > >>> ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort'
> > > > > > >>> --with-cxx='win32fe icl'
> --with-petsc-arch="arch-win64-release-intel-mpi"
> > > > > > >>>
> --prefix=/cygdrive/c/cygwin_cache/petsc-3.12.4-release-win-64bit-intel-mpi
> > > > > > >>> --with-blas-lapack-dir="/cygdrive/c/Program Files
> > > > > > >>>
> (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> > > > > > >>> --with-mpi-include="/cygdrive/c/Program Files
> > > > > > >>> (x86)/IntelSWTools/mpi/2019.6.166/intel64/include"
> --with-mpi-lib="/cygdrive/c/Program
> > > > > > >>> Files
> (x86)/IntelSWTools/mpi/2019.6.166/intel64/lib/impicxx.lib"  --with-
> > > > > > >>> mpi-compilers=0 --with-debugging=0 --useThreads=0 --with-x=0
> --with-x11=0
> > > > > > >>> --with-xt=0 --with-shared-libraries=0
> > > > > > >>>
> > > > > > >>> =============
> > > > > > >>>
> > > > > > >>> Thanks for any suggestions.
> > > > > > >>>
> > > > > > >> We just cannot cope with spaces in paths. Can you use the
> shortened
> > > > > > >> contiguous name instead of "Program File"?
> > > > > > >
> > > > > > >
> > > > > > > Yeah - the config/examples/arch-ci-mswin*.py lists paths
> without spaces - and https://www.mcs.anl.gov/petsc/documentation/installation.html
> <https://www.mcs.anl.gov/petsc/documentation/installation.html> has the
> instructions
> > > > > > >
> > > > > > > The way to get this is: (for example)
> > > > > > >
> > > > > > > balay at ps5 ~
> > > > > > > $ cygpath -u `cygpath -ms '/cygdrive/C/Program Files/Microsoft
> MPI/Bin/mpiexec'`
> > > > > > > /cygdrive/c/PROGRA~1/MICROS~2/Bin/mpiexec.exe
> > > > > > >
> > > > > > > Satish
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >>
> > > > > > >>  Thanks,
> > > > > > >>
> > > > > > >>    Matt
> > > > > > >>
> > > > > > >>> Regards,
> > > > > > >>>
> > > > > > >>> Qin
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> On Monday, March 30, 2020, 04:15:14 PM CDT, Matthew Knepley <
> > > > > > >>> knepley at gmail.com> wrote:
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> On Mon, Mar 30, 2020 at 4:43 PM Qin Lu via petsc-users <
> > > > > > >>> petsc-users at mcs.anl.gov> wrote:
> > > > > > >>>
> > > > > > >>> Hi Satish,
> > > > > > >>>
> > > > > > >>> The ex2.exe works with "mpiexec -np 2" when I ran it from
> command line.
> > > > > > >>> Then I ran "which mpiexec", it actually points to Intel-MPI
> instead of
> > > > > > >>> MPICH2, probably because I have set the former's path in
> environment
> > > > > > >>> variable PATH in Win-10. I will try to reinstall Intel-MPI
> and build Petsc
> > > > > > >>> with Intel-MPI.
> > > > > > >>>
> > > > > > >>> As for the crash of calling to
> KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) in
> > > > > > >>> my Fortran-90 program, do you have any idea what can be
> wrong? Can it be
> > > > > > >>> related to MPI?
> > > > > > >>>
> > > > > > >>> I tested config/examples/arch-ci-mswin-intel.py as you
> suggested, but got
> > > > > > >>> the following output:
> > > > > > >>>
> > > > > > >>> ============
> > > > > > >>> python ./arch-ci-mswin-intel.py
> > > > > > >>> Traceback (most recent call last):
> > > > > > >>>  File "./arch-ci-mswin-intel.py", line 10, in <module>
> > > > > > >>>    import configure
> > > > > > >>> ImportError: No module named configure
> > > > > > >>> ============
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> You have to run those from $PETSC_DIR.
> > > > > > >>>
> > > > > > >>>  Matt
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> Thanks,
> > > > > > >>> Qin
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> I will try to use Intel-MPI and see what will happen.
> > > > > > >>>
> > > > > > >>> Thanks,
> > > > > > >>> Qin
> > > > > > >>>
> > > > > > >>> On Monday, March 30, 2020, 01:47:49 PM CDT, Satish Balay <
> > > > > > >>> balay at mcs.anl.gov> wrote:
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> Please preserve cc: to the list
> > > > > > >>>
> > > > > > >>>> shared libraries: disabled
> > > > > > >>>
> > > > > > >>> So PETSc  is correctly built as static.
> > > > > > >>>
> > > > > > >>>>> C:/Program Files/mpich2x64/bin/mpiexec.exe: error while
> loading shared
> > > > > > >>> libraries: ?: cannot open shared object file: No such file
> or directory
> > > > > > >>>
> > > > > > >>> So its not clear which shared library this error is
> referring to. But then
> > > > > > >>> - this error was with petsc-3.4.2
> > > > > > >>>
> > > > > > >>> You can always try to run the code manually without mpiexec
> - and see if
> > > > > > >>> that works.
> > > > > > >>>
> > > > > > >>> cd src/ksp/ksp/examples/tutorials
> > > > > > >>> make ex2
> > > > > > >>> ./ex2
> > > > > > >>>
> > > > > > >>> Wrt MSMPI - yes its free to download
> > > > > > >>>
> > > > > > >>> And PETSc does work with Intel-MPI. It might be a separate
> > > > > > >>> download/install. [so I can't say if what you have is the
> correct install
> > > > > > >>> of IntelMPI or not]
> > > > > > >>>
> > > > > > >>> Check the builds we use for testing - for ex:
> > > > > > >>> config/examples/arch-ci-mswin-*.py
> > > > > > >>>
> > > > > > >>> Satish
> > > > > > >>>
> > > > > > >>> On Mon, 30 Mar 2020, Qin Lu wrote:
> > > > > > >>>
> > > > > > >>>> Hi Satish,
> > > > > > >>>> The configure.log and RDict.log of  Petsc-3.12.4 build is
> attached.
> > > > > > >>>> Is the MSMPI free to use in Windows-10?
> > > > > > >>>> Does Petsc support Intel-MPI? I have it in my machine, but
> for some
> > > > > > >>> reason I only find the /mpi/intel64/bin, but not
> /mpi/intel64/include
> > > > > > >>> subdirectory of it.
> > > > > > >>>> Thanks a lot for your help.Qin
> > > > > > >>>>  On Monday, March 30, 2020, 12:26:09 PM CDT, Satish Balay <
> > > > > > >>> balay at mcs.anl.gov> wrote:
> > > > > > >>>>
> > > > > > >>>> MPICH is unsupported - and we haven't tested with it for a
> long time.
> > > > > > >>>>
> > > > > > >>>> And petsc-3.4.2 is from 2013 - and untested with current gen
> > > > > > >>> os/compilers/libraries.
> > > > > > >>>>
> > > > > > >>>> Can you send logs from Petsc-3.12.4 build [or try latest
> Petsc-3.13.0]?
> > > > > > >>>>
> > > > > > >>>> We recommend 64bit MSMPI for windows.
> > > > > > >>>>
> > > > > > >>>> Satish
> > > > > > >>>>
> > > > > > >>>> On Mon, 30 Mar 2020, Qin Lu via petsc-users wrote:
> > > > > > >>>>
> > > > > > >>>>> Hello,
> > > > > > >>>>> I am trying to build Petsc-3.4.2 in my Windows-10
> workstation using
> > > > > > >>> Cygwin, with Intel-2018 compilers and MKL, and MPICH2. The
> > > > > > >>> configuration/compilation/installation seem to finish
> without problem, but
> > > > > > >>> test program (ex19) failed since it could not find a shared
> lib. Then I
> > > > > > >>> linked the libpetsc.lib with my program (in Fortran-90), but
> it got run
> > > > > > >>> time crash when it calls
> KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) or other
> > > > > > >>> Petsc subroutines. Note that this package was built, tested
> and worked well
> > > > > > >>> with the same Fortran-90 program in my Windows-7 workstation.
> > > > > > >>>>>
> > > > > > >>>>> Also tried Petsc-3.12.4 but got the same errors.
> > > > > > >>>>>
> > > > > > >>>>> The following is my configuration:
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>> ===============
> > > > > > >>>>>
> > > > > > >>>>> ./configure --with-cc='win32fe icl' --with-fc='win32fe
> ifort'
> > > > > > >>> --with-cxx='win32fe icl'
> --with-petsc-arch="arch-win64-release"
> > > > > > >>>
> --prefix=/cygdrive/c/cygwin_cache/petsc-3.4.2-release-win-64bit
> > > > > > >>> --with-blas-lapack-dir="/cygdrive/c/Program Files
> > > > > > >>>
> (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> > > > > > >>> --with-mpi-dir="/cygdrive/c/Program Files/mpich2x64"
> --with-debugging=0
> > > > > > >>> --useThreads=0 --with-x=0 --with-x11=0 --with-xt=0
> --with-shared-libraries=0
> > > > > > >>>>>
> > > > > > >>>>> ===============
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>> The error message of running ex19 is:
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>> =================
> > > > > > >>>>>
> > > > > > >>>>> $ make
> PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit
> > > > > > >>> test
> > > > > > >>>>>
> > > > > > >>>>> Running test examples to verify correct installation
> > > > > > >>>>>
> > > > > > >>>>> Using
> PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit
> > > > > > >>> and PETSC_ARCH=arch-win64-debug
> > > > > > >>>>>
> > > > > > >>>>> Possible error running C/C++
> src/snes/examples/tutorials/ex19 with 1
> > > > > > >>> MPI process
> > > > > > >>>>>
> > > > > > >>>>> See http://www.mcs.anl.gov/petsc/documentation/faq.html
> > > > > > >>>>>
> > > > > > >>>>> C:/Program Files/mpich2x64/bin/mpiexec.exe: error while
> loading shared
> > > > > > >>> libraries: ?: cannot open shared object file: No such file
> or directory
> > > > > > >>>>>
> > > > > > >>>>> =================
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>> Thanks a lot for any suggestions.
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>> Best Regards,
> > > > > > >>>>>
> > > > > > >>>>> Qin
> > > > > > >>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> --
> > > > > > >>> What most experimenters take for granted before they begin
> their
> > > > > > >>> experiments is infinitely more interesting than any results
> to which their
> > > > > > >>> experiments lead.
> > > > > > >>> -- Norbert Wiener
> > > > > > >>>
> > > > > > >>> https://www.cse.buffalo.edu/~knepley/
> > > > > > >>> <http://www.cse.buffalo.edu/~knepley/ <
> http://www.cse.buffalo.edu/~knepley/>>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200331/4e649d2f/attachment-0001.html>


More information about the petsc-users mailing list