[petsc-dev] getting rid of TESTEXAMPLES_XXX_XXX stuff
Barry Smith
bsmith at mcs.anl.gov
Tue Dec 3 08:13:44 CST 2013
Ok, there are requirements sometimes for compiling examples as well, so presumably you would need to list the requirements twice once for the runexX but also for the exX: and your compile rules would need to do the checking also ?
Can we have “built in” rules for .F, .cxx, .cu so we don’t have to list require fc for each fortran example etc?
Also what about a “built in” rule for mpiexec -n n > 1 so we don’t have to put a requirement of MPI for each parallel test?
This sounds much better than the current model, the less redundant REQUIRE we need to list the better.
Barry
On Dec 3, 2013, at 7:10 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
>>>> runex123: REQUIRE = parmetis mumps 64-bit-indices
>>
>> Ok, I don’t understand this syntax at all, there is no mention of
>> REQUIRE used in this way in the gnumake manual. How are you
>> proposing to use this variable?
>
> REQUIRE is just a normal (target-specific) variable, it is not
> interpreted specially by make. Consider the attached makefile.
>
> $ make allrun
> Creating executable foo.exe
> Running runfoo1
> Skipping runfoo2 due to unmet requirements: C
> Creating executable bar.exe
> Running runbar1
> rm bar.exe foo.exe
>
> ENABLED = A B
>
> # Helper function
> unmet_requirements = $(filter-out $(ENABLED),$(REQUIRE))
>
> %.exe :
> @echo Creating executable $@
> @touch $@
>
> run% :
> @$(if $(unmet_requirements),echo "Skipping $@ due to unmet requirements:" $(unmet_requirements),echo Running $@)
>
> runfoo1 : REQUIRE = A B
> runfoo1 : foo.exe
>
> runfoo2 : REQUIRE = A C
> runfoo2 : foo.exe
>
> runbar1 : REQUIRE = A
> runbar1 : bar.exe
>
> allrun : runfoo1 runfoo2 runbar1
>
> .INTERMEDIATE: foo.exe bar.exe
More information about the petsc-dev
mailing list