[petsc-users] makefile changes since release 12

Matthew Knepley knepley at gmail.com
Fri Apr 24 06:19:17 CDT 2020


On Fri, Apr 24, 2020 at 4:34 AM Aldo Bonfiglioli <aldo.bonfiglioli at unibas.it>
wrote:

> Hi there,
>
> the makefile I have been using for ages (up to 11.4) now fails with 12.5.
>

Yep, it is not that easy to reconstruct. I believe that the Fortran build
rule used to be generated by configure. We
stopped doing that, and added a generic rule in, but since we have no
Fortran code in PETSc, it did not get
properly tested.

I think the fix is that this rule, like the rules for C and CXX, should use
PETSC_FCOMPILE_SINGLE. However,
that does not exist. Can you try the branch below?

  https://gitlab.com/petsc/petsc/-/commits/knepley/fix-fortran-rule

  git checkout knepley/fix-fortran-rule

If it works for you, I will put in an MR for it.

  Thanks,

     Matt


> I noticed that there have been several changes in
>
> include $(PETSC_DIR)/lib/petsc/conf/variables
> include $(PETSC_DIR)/lib/petsc/conf/rules
>
> btw. the two aforementioned versions.
>
> If I'm not wrong, *.F files should now be compiled with:
>
> >
> > .F.o .F90.o .F95.o:
> >         ${PETSC_FCOMPILE} -o $@ $<
> However,  in ${PETSC_FCOMPILE} there are also my ${SOURCEF} fortran
> sources,
>
> so that I get the following compilation error:
>
> > gfortran -c -fPIC -Wall -ffree-line-length-0
> > -Wno-unused-dummy-argument -g -I../../include/ -I.
> > -I/home/abonfi/src/petsc-3.12.5/include
> > -I/home/abonfi/src/petsc-3.12.5/linux_gnu/include     getidx.f
> > ApplicationFunction.F ApplicationFunction_t.F bndry_iset.F
> > JacobianBoundaryConditions.F RHSFunction.F RHSFunction_t.F
> > RHSJacobian.F RHSJacobian_t.F blockdata.f bndvflx.F clearmem.F
> > lhsbc5.F lhsbc6.F exgeo.F newgeo.F ghost.F ghost2.F init.F iset.F
> > iset_t.F main.F matsch.F MotionSolver.F myTS.F nodres.F nodres_t.F
> > noname.f printmat2.F printmat.F printmatmm.F qb.F rdat.F readat.F
> > rgrdpts.F rhsbc1.F rhsbc4.F rhsbc5.F rhsbc5c.F sclsch.F
> > setbc4laplace.F setibc.F seterr.F setupRHS.F setupRHS_t.F setupLHS_b.F
> > solzne.F MatAllocaSeq.F test.F tmodel.F turbini.F turbsch.F update2.F
> > update3.F update4.F weakbc.F -o ApplicationFunction_t.o
> > ApplicationFunction_t.F
> > gfortran: fatal error: cannot specify ‘-o’ with ‘-c’, ‘-S’ or ‘-E’
> > with multiple files
> > compilation terminated.
>
> If I remove ${SOURCEF} from the ${PETSC_FCOMPILE} definition in
>
> $(PETSC_DIR)/lib/petsc/conf/variables
>
> things work, but I am not sure that this is the right thing to do.
>
> Thanks,
>
> Aldo
>
> PS My makefile is attached
>
> --
> Dr. Aldo Bonfiglioli
> Associate professor of Fluid Machines
> Scuola di Ingegneria
> Universita' della Basilicata
> V.le dell'Ateneo lucano, 10 85100 Potenza ITALY
> tel:+39.0971.205203 fax:+39.0971.205215
> web: http://docenti.unibas.it/site/home/docente.html?m=002423
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200424/7b22b960/attachment-0001.html>


More information about the petsc-users mailing list