[petsc-users] 64bit indices and revolve compiler warnings

Zhang, Hong hongzhang at anl.gov
Tue Feb 23 23:12:27 CST 2021



On Feb 23, 2021, at 5:32 AM, Anton Glazkov <anton.glazkov at chch.ox.ac.uk<mailto:anton.glazkov at chch.ox.ac.uk>> wrote:

Good morning,

I have been trying to compile PETSc with 64bit indices and revolve. It compiles ok but gives out warnings of the kind:

{PETSCDIR PATH REMOVED}/src/ts/trajectory/impls/memory/trajmemory.c:1479:130: warning: incompatible pointer types passing 'PetscInt *' (aka 'long long *') to parameter of type 'int *' [-Wincompatible-pointer-types]
    whattodo = revolve_action(&tjsch->rctx->check,&tjsch->rctx->capo,&tjsch->rctx->fine,tjsch->rctx->snaps_in,&tjsch->rctx->info,&tjsch->rctx->where); /* must return 1 or 3 or 4*/
                                                                                                                                 ^~~~~~~~~~~~~~~~~~~
{PETSCDIR PATH REMOVED}/lib/include/revolve_c.h:14:49: note: passing argument to parameter here
int  revolve_action(int*,int*,int*,int,int*,int*);

Is revolve incompatible with 64bit indices by design?

Yes, Revolve uses int32 only. But we can fix the warnings by downcasting. You can check out this MR:

https://gitlab.com/petsc/petsc/-/merge_requests/3654

Thanks,
Hong (Mr.)


Best wishes,
Anton

PS the compile line is this:
./configure –prefix={PREFIX REMOVED}  --with-cc=cc --with-cxx=CC --with-fc=ftn --with-debugging=0 --with-clib-autodetect=0 --with-cxxlib-autodetect=0 --with-fortranlib-autodetect=0 --COPTFLAGS=-g -O3 --CXXOPTFLAGS=-g -O3 --FOPTFLAGS=-g -O3 --with-64-bit-indices --with-scalar-type=complex --download-hypre-shared --download-moab-shared --download-superlu_dist-shared --download-revolve=1 --with-hdf5-dir=/opt/cray/pe/hdf5-parallel/1.12.0.2/CRAYCLANG/9.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210224/ade97e84/attachment.html>


More information about the petsc-users mailing list