[petsc-users] Incompatible pointer type

Ivan Luthfi ivanluthfi5 at gmail.com
Fri Jul 12 03:41:02 CDT 2024


I get a warning about an incompatible pointer type when compile a code,
anyone know how to fix this?

make bin_MsFEM_poisson2D_DMDA
mpicc -Wall -c PCMsFEM.c -isystem/home/ivan/petsc/opt-3.21.2/include
PCMsFEM.c: In function ‘PCCreate_MsFEM’:
PCMsFEM.c:59:33: warning: assignment to ‘PetscErrorCode (*)(struct _p_PC *,
PetscOptionItems *)’ {aka ‘int (*)(struct _p_PC *, struct
_p_PetscOptionItems *)’} from incompatible pointer type ‘PetscErrorCode
(*)(struct _p_PC *)’ {aka ‘int (*)(struct _p_PC *)’}
[-Wincompatible-pointer-types]
   59 |         pc->ops->setfromoptions = PCSetFromOptions_MsFEM;
      |                                 ^
mpicc -o bin_MsFEM_poisson2D_DMDA MsFEM_poisson2D_DMDA.o UserParameter.o
FormFunction.o MsFEM.o PCMsFEM.o
/home/ivan/petsc/opt-3.21.2/lib/libpetsc.so \
        /home/ivan/petsc/opt-3.21.2/lib/libsuperlu_dist.so \
        /home/ivan/petsc/opt-3.21.2/lib/libparmetis.so \
        /home/ivan/petsc/opt-3.21.2/lib/libmetis.so \
        /usr/lib64/atlas/liblapack.a /usr/lib64/libblas.so.3
/usr/bin/ld: cannot find /usr/lib64/atlas/liblapack.a: No such file or
directory
/usr/bin/ld: cannot find /usr/lib64/libblas.so.3: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [makefile:18: bin_MsFEM_poisson2D_DMDA] Error 1

-- 
Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240712/40d094a6/attachment-0001.html>


More information about the petsc-users mailing list