[petsc-dev] getting rid of TESTEXAMPLES_XXX_XXX stuff

Jed Brown jedbrown at mcs.anl.gov
Mon Dec 2 22:33:28 CST 2013


Barry Smith <bsmith at mcs.anl.gov> writes:
> tests: $(shell grep ":" makefile | grep runex | grep -v makefile | sed "s/://g” )
>
> Unfortunately it is not that simple because for each runexX we need to
> compile the example and we only want to compile it once for all its
> uses and we need to rm it as soon as it is no longer needed. Perhaps
> we can list them in the correct order
>
> ex1:  REQUIRE = ccx

For normal examples, we don't need special targets because this will
work for all of them.

ex%: ex%.o | chkopts
	-${CLINKER} -o $@ $< ${PETSC_TS_LIB}

With pattern rules like this, the intermediate files ex*.o are
automatically deleted after compilation, so we would not need the hack
of deleting it explicitly (which has the undesirable side-effect of
returning success even when linking fails).  When switching PETSC_ARCH,
users can add -B to ensure recompilation.

Note that it is natural to state the dependency

runex123 : ex123

so that the examples are automatically built.  If we also use

.INTERMEDIATE: ex123

then "make runex123 runex123_2" would build ex123 (once), run the two
examples (in parallel if you used -j), and delete the executable ex123.


But for testing, I would much prefer to compile one executable per
package.  I have code for this, and it builds all the examples in PETSc
in 30 seconds, but I stalled on the test harness.  I can push the proof
of concept in a branch.  Simply compiling all the examples fast in a
single target would be useful to root out issues with API changes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131202/b34174ba/attachment.sig>


More information about the petsc-dev mailing list