[petsc-users] Petsc makefile and PETSC_COMPILE variable

Alex Koshkarov okoshkarov at tae.com
Tue Dec 15 11:18:31 CST 2020


Hi All,

I have been using trivial makefile (see below) for the code which uses petsc. The makefile relies on variable PETSC_COMPILE which disappeared in new petsc version (absent in 3.14.2, but present in 3.13.4). What would be the right way to fix the makefile? (should I use something like PETSC_COMPILE_SINGLE ?). Is it a very bad practice to use such makefile?

p.s. sorry if this is a duplicate message, I believe I sent the first one to the wrong address.

Thank you very much,
Alex Koshkarov.


Example of makefile, it assumes sources in “src” and creats objects in “objects”:

CPP := $(wildcard src/*.c)
DEP := $(wildcard src/*.h)
OBJ := $(addprefix objects/,$(notdir $(CPP:.c=.o)))

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules

driver: $(OBJ)
                -${CLINKER} -o $@ $^ ${PETSC_LIB} ${EXTRALIBS} ${CFLAGS}

objects/%.o: src/%.c $(DEP)
                ${PETSC_COMPILE} -c $< -o $@

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


More information about the petsc-users mailing list