[petsc-dev] snes/ex56 target is gone

Barry Smith bsmith at mcs.anl.gov
Wed Jun 28 13:40:35 CDT 2017


   Jed,

    Aside from its name and location this is a very useful thing. Should it be in $PETSC_DIR/lib/petsc/conf/ ? since it cannot stay in $PETSC_DIR for --prefix installs? 

  Barry



> On Jun 28, 2017, at 11:36 AM, Jed Brown <jed at jedbrown.org> wrote:
> 
> Satish Balay <balay at mcs.anl.gov> writes:
> 
>> Yeah - that part of the interface in now more complex - so we'll have
>> to figure out how that can be improved..
> 
> I have the following file just sitting in PETSC_DIR/Makefile.user.  I
> build code with
> 
> $ make -f $PETSC_DIR/Makefile.user ex56
> 
> from any directory (no need to have a local Makefile; just copy the
> example wherever you want or leave it in the source directory if you
> insist).  I like this because there are no includes, thus no mysterious
> make variables, and it's clear how one would compose it with other
> packages that provide pkgconfig files.
> 
> $ cat $PETSC_DIR/Makefile.user
> PETSc.pc := $(PETSC_DIR)/$(PETSC_ARCH)/lib/pkgconfig/PETSc.pc
> 
> CC := $(shell pkg-config --variable=ccompiler $(PETSc.pc))
> CXX := $(shell pkg-config --variable=cxxcompiler $(PETSc.pc))
> FC := $(shell pkg-config --variable=fcompiler $(PETSc.pc))
> CFLAGS := $(shell pkg-config --variable=cflags_extra $(PETSc.pc)) $(shell pkg-config --cflags-only-other $(PETSc.pc))
> CPPFLAGS := $(shell pkg-config --cflags-only-I $(PETSc.pc))
> LDFLAGS := $(shell pkg-config --libs-only-L --libs-only-other $(PETSc.pc))
> LDFLAGS += $(patsubst -L%, $(shell pkg-config --variable=ldflag_rpath $(PETSc.pc))%, $(shell pkg-config --libs-only-L $(PETSc.pc)))
> LDLIBS := $(shell pkg-config --libs-only-l $(PETSc.pc)) -lm
> 
> print:
> 	@echo CC=$(CC)
> 	@echo CFLAGS=$(CFLAGS)
> 	@echo CPPFLAGS=$(CPPFLAGS)
> 	@echo LDFLAGS=$(LDFLAGS)
> 	@echo LDLIBS=$(LDLIBS)
> 
> 
>> 
>> Satish
>> 
>> On Wed, 28 Jun 2017, Mark Adams wrote:
>> 
>>> Oh right I noticed the stuff at the bottom. It was nice being able to tell
>>> people to just copy the source file and makefile and run it...
>>> 
>>> On Tue, Jun 27, 2017 at 7:43 PM, Satish Balay <balay at mcs.anl.gov> wrote:
>>> 
>>>> On Tue, 27 Jun 2017, Matthew Knepley wrote:
>>>> 
>>>>> On Tue, Jun 27, 2017 at 6:24 PM, Matthew Knepley <knepley at gmail.com>
>>>> wrote:
>>>>> 
>>>>>> On Tue, Jun 27, 2017 at 6:22 PM, Mark Adams <mfadams at lbl.gov> wrote:
>>>>>> 
>>>>>>> I looks like the target (runex56) for snes/ex56.c is not in the
>>>> makefile.
>>>>>>> Anyone know why that happened?
>>>>>>> 
>>>>>> 
>>>>>> I took it out and converted all tests to the new format.
>>>>>> 
>>>>> 
>>>>> cd $PETSC_DIR
>>>>> make -f ./gmakefile test pysearch="snes_tutorials-runex56*"
>>>> 
>>>> Or use echo_test to print the targets and then run the tests.
>>>> 
>>>> balay at asterix /home/balay/petsc (master=)
>>>> $ make -f gmakefile echo_test search=sys%ex1
>>>> sys_tutorials-runex1 sys_tests-runex1
>>>> balay at asterix /home/balay/petsc (master=)
>>>> $ make -f gmakefile echo_test search=snes% searchin=ex56
>>>> snes_tutorials-runex56_hypre snes_tutorials-runex56_ml
>>>> snes_tutorials-runex56_0
>>>> balay at asterix /home/balay/petsc (master=)
>>>> $ make -f gmakefile snes_tutorials-runex56_0
>>>> Use "/usr/bin/gmake V=1" to see verbose compile lines, "/usr/bin/gmake
>>>> V=0" to suppress.
>>>>     CLINKER arch-linux2-c-debug/tests/src/snes/examples/tutorials/ex56
>>>>        TEST snes_tutorials-runex56_0
>>>> ok snes_tutorials-ex56_0
>>>> ok diff-snes_tutorials-ex56_0
>>>> balay at asterix /home/balay/petsc (master=)
>>>> 
>>>> Satish
>>>> 
>>> 




More information about the petsc-dev mailing list