[petsc-users] makefile changes since release 12

Jed Brown jed at jedbrown.org
Fri Apr 24 11:09:16 CDT 2020


Satish Balay <balay at mcs.anl.gov> writes:

>> Crossing over to dev discussion, I wish we could make these names more
>> standard, like the following predefined ones (see `make -p`).
>> 
>> COMPILE.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
>> %.o: %.F
>> #  recipe to execute (built-in):
>>         $(COMPILE.F) $(OUTPUT_OPTION) $<
>> LINK.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
>> %: %.F
>> #  recipe to execute (built-in):
>>         $(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@
>> 
>> 
>> So we could define PETSC_COMPILE.F, PETSC_LINK.F, etc., and a user could write
>> 
>> COMPILE.F = PETSC_COMPILE.F
>> 
>> if all their *.F sources use PETSc, in which case all the standard rules
>> would work.  Or, they could use PETSc-enabled build only for a subset of
>> their sources:
>> 
>> $(SOURCES_USING_PETSC:%.F=%.o) : %.o : %.F
>> 	$(PETSC_COMPILE.F) $(OUTPUT_OPTION) $<
>
> Hm - I thought we were going to leave the current rules file to be portable - and have gnumakefile syntax available via share/petsc/Makefile.user

I'm suggesting that a user who has some source files that need to be
compiled with PETSc (and some that should not use PETSc flags) could use
this.  What I'm not a fan of is having so many different conventions.
I'm fine with promoting share/petsc/Makefile.user and treating this as
legacy.

lib/petsc/conf/variables has this.  It isn't used, but is (I think) GNU-specific.

PSOURCEC  = $(SOURCEC:%=`pwd`/%)
PSOURCECXX= $(SOURCECXX:%=`pwd`/%)
PSOURCECU = $(SOURCECU:%=`pwd`/%)


More information about the petsc-users mailing list