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

Fabian.Jakub Fabian.Jakub at physik.uni-muenchen.de
Mon Jul 29 10:13:05 CDT 2019

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.


       call PetscSortInt(N, x, ierr)
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,


P.S. Petsc was compiled with
-------------- next part --------------
include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules

run:: petsc_fortran_sort

petsc_fortran_sort:: petsc_fortran_sort.F90
		${PETSC_FCOMPILE} -c petsc_fortran_sort.F90
		${FLINKER} petsc_fortran_sort.o -o petsc_fortran_sort ${PETSC_LIB}

		rm -rf *.o petsc_fortran_sort
-------------- next part --------------
A non-text attachment was scrubbed...
Name: petsc_fortran_sort.F90
Type: text/x-fortran
Size: 291 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190729/1b4950f2/attachment.bin>

More information about the petsc-dev mailing list