[petsc-dev] Issues with Fortran Interfaces for PetscSort routines

Zhang, Junchao jczhang at mcs.anl.gov
Mon Jul 29 11:44:54 CDT 2019


I will have a look. I simply changed PetscSortInt(PetscInt n,PetscInt i[]) to PetscSortInt(PetscInt n,PetscInt *X). Don't know why it caused that.
--Junchao Zhang


On Mon, Jul 29, 2019 at 10:14 AM Fabian.Jakub via petsc-dev <petsc-dev at mcs.anl.gov<mailto:petsc-dev at mcs.anl.gov>> wrote:
Dear Petsc,

Commit 051fd8986cf23c0556f4229193defe128fafa1f7 changed the C signature
of the sorting routines and as a result I cannot compile against them
anymore from Fortran.
I tried to rebuild Petsc from scratch and did a make allfortranstubs but
still to no avail.

I attach a simple fortran program that calls PetscSortInt and gives the
following error at compile time.




petsc_fortran_sort.F90:15:27:

       call PetscSortInt(N, x, ierr)
                           1
Error: Rank mismatch in argument ‘b’ at (1) (scalar and rank-1)

Same applies for other routines such as PetscSortIntWithArrayPair...

I am not sure where to find the FortranInterfaces and currently had no
time to dig deeper.

Please let me know if I have missed something stupid.

Many thanks,

Fabian


P.S. Petsc was compiled with
--with-fortran
--with-fortran-interfaces
--with-shared-libraries=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190729/41a128d9/attachment.html>


More information about the petsc-dev mailing list