[petsc-users] Fortran interface of some petsc routines seem to be missing

Natacha BEREUX natacha.bereux at gmail.com
Tue Nov 27 09:28:31 CST 2018


Hello,
I work on a Fortran software that uses PETSc for linear solvers. Therefore,
we have a PETSc interface to convert our matrices to PETSc Mat.
I have noticed several compiler warnings ( I use gfortran with
-Wimplicit-interface)  during compilation. The warnings point out that some
(but not all) fortran interfaces are missing.

The behaviour is the same when I compile a PETSC example. Below is
src/vec/vec/examples/tutorials/ex9f.F compiled with gfortran.

mpif90 -c -fPIC -Wall -ffree-line-length-0 -Wno-unused-dummy-argument
-Wimplicit-interface  -g -O
-I/home/H03755/Librairies/petsc-3.10.1/include
-I/home/H03755/Librairies/petsc-3.10.1/linux-opt-mumps-ml-hypre-superlu/include
-I/home/H03755/dev/codeaster-prerequisites/v14/prerequisites/Mumps-512_consortium_aster3/MPI/include
-I/home/H03755/local/petsc/petsc-3.10.1/include    -o ex9f.o ex9f.F90
ex9f.F90:34.53:

      call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
                                                     1
Warning: Procedure 'petscinitialize' called with an implicit interface at
(1)
ex9f.F90:42.91:

      if (size .ne. 2) then; call PetscError(PETSC_COMM_WORLD,1,0,'Requires
2 processors'); call MPIU_Abort(PETSC_COMM_WORLD,1); endif

1
Warning: Procedure 'petscerror' called with an implicit interface at (1)
ex9f.F90:42.128:

      if (size .ne. 2) then; call PetscError(PETSC_COMM_WORLD,1,0,'Requires
2 processors'); call MPIU_Abort(PETSC_COMM_WORLD,1); endif

1
Warning: Procedure 'mpiu_abort' called with an implicit interface at (1)
ex9f.F90:81.56:

     &        PETSC_DECIDE,nghost,ifrom,tarray,gxs,ierr)
                                                        1
Warning: Procedure 'veccreateghostwitharray' called with an implicit
interface at (1)
ex9f.F90:99.53:

       call VecGetOwnershipRange(gx,rstart,rend,ierr)
                                                     1
Warning: Procedure 'vecgetownershiprange' called with an implicit interface
at (1)
ex9f.F90:115.93:

       call
PetscViewerGetSubViewer(PETSC_VIEWER_STDOUT_WORLD,PETSC_COMM_SELF,subviewer,ierr)

1
Warning: Procedure 'petscviewergetsubviewer' called with an implicit
interface at (1)
ex9f.F90:117.97:

       call
PetscViewerRestoreSubViewer(PETSC_VIEWER_STDOUT_WORLD,PETSC_COMM_SELF,subviewer,ierr)

1
Warning: Procedure 'petscviewerrestoresubviewer' called with an implicit
interface at (1)
ex9f.F90:121.31:

       call PetscFinalize(ierr)
                               1
Warning: Procedure 'petscfinalize' called with an implicit interface at (1)


Why does the compiler complain  ?
Did I miss something when I compiled PETSc library ? Is there a way to
properly generate all the Fortran interfaces in the compiled library ?
Or is it normal that PETSc only generates some interfaces but not all ?
In this case, is there a way to know which interfaces are explicitly and
automatically  defined  in PETSc library ?  So that I can provide manually
the missing ones in my code ?

Thanks a lot for your help !
Best regards,
Natacha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181127/b64ac046/attachment-0001.html>


More information about the petsc-users mailing list