[petsc-users] petsc-users Digest, Vol 200, Issue 3
Satish Balay
balay.anl at fastmail.org
Mon Aug 4 12:12:50 CDT 2025
my suggestion was to "compare compile commands" between a petsc
example (via petsc makefile) and your application - with your makefile
Its best to use petsc formatted makefiles to avoid issues with compiler option mismatch
https://urldefense.us/v3/__https://petsc.org/release/manual/getting_started/*writing-c-c-or-fortran-applications__;Iw!!G_uCfscf7eWS!fLLihqTez1EMMjLzlLEt8-aKcPazlSe4eGJSEfCb2j3P02GdALJLZKL-JF1E3SXUP8LjG4aB2jocfKGtWIR-Yqfxclk$
Either way - you might want to start with a currently working PETSc
example (using a PETSc makefile) - and modify the makefile to your
desired format - and see if it still works (with this petsc exampe
code, and then use this updated makefile format with your application
code)
Also if your code was with v3.9 - then there are many changes in
v3.23, so you would have to check the current example codes wrt how to
use '#include', 'use' directives and other usages.
Satish
On Mon, 4 Aug 2025, kiran hegde wrote:
> Hi Satish,
>
> I have tried the options ex5f, but getting the same error.
> The code was running without any issues long back and I was using petsc
> ver 3.9 using gcc 12.X.X.
> My makefile flags are :
>
> FFLAGS = -march=native -O3 -pipe -ffree-form -cpp -ffree-line-length-none \
> -Wall -Wextra -Wtabs -Wintrinsics-std -Wsurprising
> -Waliasing \
> -Wno-unused-parameter -Wno-unused-dummy-argument \
> -D$(MODEL) \
> -DVERSION=\"$(GIT_VERSION)\" \
> -I$(PETSC_DIR)/include
> FPPFLAGS = -cpp -E -dM -C -P -D$(MODEL)
> LDFLAGS = -lpetsc -L$(PETSC_DIR)/lib
> LDFLAGS += -Wl,-rpath=$(PETSC_DIR)/lib
>
> Have i missed anything?
>
>
> Regards,
> Kiran
>
>
>
>
> On Sun, Aug 3, 2025 at 9:56 PM Satish Balay <balay.anl at fastmail.org> wrote:
>
> > On Sun, 3 Aug 2025, kiran hegde wrote:
> >
> > > Hi,
> > >
> > > Please find the attached configure.log file.
> > > PETSC installation successfully completes with make check, without any
> > > error.
> > > But, when compiling fortan codes with petsc library+include in the
> > > makefile i get this error.
> >
> > Then likely your compile command is missing some options. you can:
> >
> > - compile a petsc example - say:
> > cd src/snes/tutorials
> > make ex5f
> >
> > - now compile your application
> >
> > - And compare the compile commands and see if there are any differences
> > (missing options, wrong order of include files etc..)
> >
> > Satish
> >
>
>
>
More information about the petsc-users
mailing list