[petsc-users] makefile changes since release 12

Aldo Bonfiglioli aldo.bonfiglioli at unibas.it
Fri Apr 24 03:33:13 CDT 2020


Hi there,

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

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

-------------- next part --------------
VERSION		= 3.12.0
PROGRAM		= eulfs$(VERSION)-$(PETSC_ARCH)
all: 		$(PROGRAM)
FFLAGS	        = -I../../include/ -I.
FCPPFLAGS	= $(FCPPFLAGS) -I../../include/ -I.
CFLAGS	        =
#
# ad hoc fix for SP3
#
#FCPPFLAGS       = ${PETSC_INCLUDE} ${PCONF} ${PETSCFLAGS} ${PETSC_PARCH} \
		${FPPFLAGS} -I$(FSPL_DIR)/include/

include $(PETSC_DIR)/lib/petsc/conf/variables
include $(PETSC_DIR)/lib/petsc/conf/rules


DEST		= $(HOME)/bin/$(PETSC_ARCH)
INSTALL		= cp
SOURCEC	        =
SOURCEF	        = \
		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
SOURCEH	        =
OBJSC	        =
OBJSF	        = \
		getidx.o \
		ApplicationFunction.o \
		ApplicationFunction_t.o \
		bndry_iset.o \
		JacobianBoundaryConditions.o \
		RHSFunction.o \
		RHSFunction_t.o \
		RHSJacobian.o \
		RHSJacobian_t.o \
		blockdata.o \
		bndvflx.o \
		clearmem.o \
		lhsbc5.o \
		lhsbc6.o \
		exgeo.o \
		newgeo.o \
		ghost.o \
		ghost2.o \
		init.o \
		iset.o \
		iset_t.o \
		main.o \
		matsch.o \
		MotionSolver.o \
		myTS.o \
		nodres.o \
		nodres_t.o \
		noname.o \
		printmat2.o \
		printmat.o \
		printmatmm.o \
		qb.o \
		rdat.o \
		readat.o \
		rgrdpts.o \
		rhsbc1.o \
		rhsbc4.o \
		rhsbc5.o \
		rhsbc5c.o \
		sclsch.o \
		setbc4laplace.o \
		setibc.o \
		seterr.o \
		setupRHS.o \
		setupRHS_t.o \
		setupLHS_b.o \
		solzne.o \
		MatAllocaSeq.o \
		test.o \
		tmodel.o \
		turbini.o \
		turbsch.o \
		update2.o \
		update3.o \
		update4.o \
		weakbc.o
LIBBASE	        =
#LIBFLAGS      = -L$(HOME)/lib/$(PETSC_ARCH) -lfxdr -lport -lmynag -lskit
LIBFLAGS      = -L$(HOME)/lib/$(PETSC_ARCH) -lfxdr -lport -lsparse-blas -lskit -ltirpc
LIBS		= \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libscalar.a \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libeuler.a \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libspl.a \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libns.a \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libturbo.a \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libgeo.a \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libchem.a \
		$(FSPL_DIR)/lib/$(PETSC_ARCH)/libutil.a
#
# CLDFILES to be defined only for CRAY
#
#CLDFILES	= dp_lapack.cld dp_blas.cld pat.cld
#CLDFILES	= dp_lapack.cld dp_blas.cld

#look:;	@echo $(SOURCEALL) $(OBJSF)
look:;	@echo "Look man! Isn't it weird? " $(PETSC_FCOMPILE)


$(PROGRAM): $(OBJSF) $(OBJSC) $(LIBS)
	-$(FLINKER) $(CLDFILES) -o $(PROGRAM) $(OBJSF) $(OBJSC) $(LIBS) \
	$(PETSC_FORTRAN_LIB) $(PETSC_LIB) $(LIBFLAGS)


$(FSPL_DIR)/lib/$(PETSC_ARCH)/libgeo.a:
		cd $(FSPL_DIR)/src/geometry; $(MAKE) install
$(FSPL_DIR)/lib/$(PETSC_ARCH)/libeuler.a:
		cd $(FSPL_DIR)/src/euler; $(MAKE) install
$(FSPL_DIR)/lib/$(PETSC_ARCH)/libspl.a:
		cd $(FSPL_DIR)/src/schemes; $(MAKE) install
$(FSPL_DIR)/lib/$(PETSC_ARCH)/libns.a:
		cd $(FSPL_DIR)/src/navier-stokes; $(MAKE) install
$(FSPL_DIR)/lib/$(PETSC_ARCH)/libscalar.a:
		cd $(FSPL_DIR)/src/scalar; $(MAKE) install
$(FSPL_DIR)/lib/$(PETSC_ARCH)/libturbo.a:
		cd $(FSPL_DIR)/src/turbo; $(MAKE) install
$(FSPL_DIR)/lib/$(PETSC_ARCH)/libchem.a:
		cd $(FSPL_DIR)/src/chemistry; $(MAKE) install
$(FSPL_DIR)/lib/$(PETSC_ARCH)/libutil.a:
		cd $(FSPL_DIR)/src/util; $(MAKE) install


#.SUFFIXES:
#.F.o:
#	$(U_FC) -c $(FFLAGS) $(FCPPFLAGS) $<
#.f.o:
#	$(U_FC) -c $(FFLAGS) $<
#########


checkout:;      @co $(SOURCEF)

install:        $(PROGRAM)
		@echo Installing $(PROGRAM) in $(DEST)
		@if [ $(DEST) != . ]; then \
		(rm -f $(DEST)/$(PROGRAM); $(INSTALL) $(PROGRAM) $(DEST)); fi
###
blockdata.o: ../../include/paramt.h ../../include/bnd.h \
	../../include/constants.h ../../include/bnd.com \
	../../include/conv.com ../../include/implicit.h \
	../../include/nboun.com ../../include/three.com
bndvflx.o: ../../include/paramt.h ../../include/constants.h \
	../../include/implicit.h ../../include/bnd.h ../../include/bnd.com \
	../../include/three.com ../../include/nloc.com ../../include/flags.com \
	../../include/stream.com ../../include/io.com
exgeo.o: ../../include/io.com ../../include/constants.h ../../include/nloc.com
iset.o: ../../include/iset.com
lhsbc5.o: ../../include/iset.com
main.o:	../../include/stack.com
matsch.o: ../../include/flags.com
mshcnt.o: ../../include/verbose.com ../../include/io.com
nodres.o: ../../include/paramt.h ../../include/bnd.h ../../include/constants.h \
	../../include/bnd.com ../../include/nloc.com ../../include/flags.com \
	../../include/stream.com ../../include/conv.com \
	../../include/nboun.com ../../include/implicit.h ../../include/io.com
psub.o: ../../include/constants.h ../../include/paramt.h ../../include/nloc.com \
	../../include/flags.com
rdat.o: ../../include/paramt.h ../../include/bnd.h ../../include/implicit.h \
	../../include/visco.com ../../include/constants.h \
	../../include/conv.com ../../include/stream.com \
	../../include/chorin.com ../../include/scalar.com \
	../../include/flags.com ../../include/turb.com \
	../../include/bnd.com ../../include/io.com \
	../../include/verbose.com
readat.o: ../../include/constants.h ../../include/bnd.h ../../include/paramt.h \
	../../include/io.com ../../include/nloc.com ../../include/flags.com \
	../../include/stream.com
rhsbc1.o: ../../include/paramt.h ../../include/constants.h \
	../../include/iset.com
rhsbc4.o: ../../include/paramt.h ../../include/constants.h \
	../../include/iset.com
rhsbc5.o: ../../include/paramt.h ../../include/iset.com \
	../../include/constants.h
sclsch.o: ../../include/flags.com
solzne.o: ../../include/io.com
turbcomp.o: ../../include/paramt.h ../../include/constants.h ../../include/nloc.com \
	../../include/three.com ../../include/flags.com ../../include/turb.com \
	../../include/trip.com ../../include/visco.com \
	../../include/nboun.com ../../include/implicit.h ../../include/io.com
update2.o: ../../include/constants.h ../../include/paramt.h \
	../../include/conv.com ../../include/nloc.com ../../include/verbose.com \
	../../include/implicit.h ../../include/iset.com \
	../../include/flags.com ../../include/io.com
update3.o: ../../include/constants.h ../../include/paramt.h \
	../../include/implicit.h ../../include/conv.com ../../include/nloc.com \
	../../include/verbose.com ../../include/iset.com \
	../../include/flags.com ../../include/io.com
update4.o: ../../include/constants.h ../../include/paramt.h \
	../../include/conv.com ../../include/nboun.com ../../include/nloc.com \
	../../include/verbose.com ../../include/implicit.h ../../include/io.com
weakbc.o: ../../include/paramt.h ../../include/constants.h ../../include/bnd.h \
	../../include/bnd.com ../../include/three.com ../../include/nloc.com \
	../../include/implicit.h rotaterhs.f rotaterhs2.f


More information about the petsc-users mailing list