[petsc-users] Petsc makefile and PETSC_COMPILE variable

Jed Brown jed at jedbrown.org
Wed Dec 16 09:18:55 CST 2020


Victor Eijkhout <eijkhout at tacc.utexas.edu> writes:

> On , 2020Dec15, at 21:41, Barry Smith <bsmith at petsc.dev<mailto:bsmith at petsc.dev>> wrote:
>
> So if your code is C you can use
>
>
> ${CC} -c $< -o $@ ${CC_FLAGS} ${CPP_FLAGS}

Makefile.user is intended to be used with the default rules or any similar convention.

$ make -f /dev/null -p
[snipped]

COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
OUTPUT_OPTION = -o $@

%.o: %.c
#  recipe to execute (built-in):
        $(COMPILE.c) $(OUTPUT_OPTION) $<

> For completeness, what would be the F rule?

COMPILE.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c

%.o: %.F
#  recipe to execute (built-in):
        $(COMPILE.F) $(OUTPUT_OPTION) $<


More information about the petsc-users mailing list