<div dir="ltr"><div dir="ltr">On Tue, Dec 15, 2020 at 12:46 PM Alex Koshkarov <<a href="mailto:okoshkarov@tae.com">okoshkarov@tae.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thank you! <br>
<br>
It makes sense to use share/petsc/Makefile.user - I will try to understand it. However, can you please tell me what is the meaning of "_SINGLE" in "PETSC_COMPILE_SINGLE"? Does it mean compile only one source file?<br></blockquote><div><br></div><div>Yes.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     MAtt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Best regards,<br>
Alex Koshkarov.<br>
<br>
On 12/15/20, 9:25 AM, "Satish Balay" <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
<br>
    On Tue, 15 Dec 2020, Alex Koshkarov wrote:<br>
<br>
    > Hi All,<br>
    > <br>
    > I have been using trivial makefile (see below) for the code which uses petsc. The makefile relies on variable PETSC_COMPILE which disappeared in new petsc version (absent in 3.14.2, but present in 3.13.4). What would be the right way to fix the makefile? (should I use something like PETSC_COMPILE_SINGLE ?).<br>
<br>
    Yes - this change was a bugfix.<br>
<br>
    > Is it a very bad practice to use such makefile?<br>
<br>
    For most use cases the default targets work. However this usage [where sources and obj files are in different dirs] is not covered by them.<br>
<br>
    So - I think using such targets is appropriate.<br>
<br>
    There is also share/petsc/Makefile.user - which attempts to provide a portable way to create user makefiles [that don't rely on internals like PETSC_COMPILE_SINGLE] - but requires gnumake and pkgconfig<br>
<br>
    Satish<br>
<br>
<br>
    > <br>
    > p.s. sorry if this is a duplicate message, I believe I sent the first one to the wrong address.<br>
    > <br>
    > Thank you very much,<br>
    > Alex Koshkarov.<br>
    > <br>
    > <br>
    > Example of makefile, it assumes sources in “src” and creats objects in “objects”:<br>
    > <br>
    > CPP := $(wildcard src/*.c)<br>
    > DEP := $(wildcard src/*.h)<br>
    > OBJ := $(addprefix objects/,$(notdir $(CPP:.c=.o)))<br>
    > <br>
    > include ${PETSC_DIR}/lib/petsc/conf/variables<br>
    > include ${PETSC_DIR}/lib/petsc/conf/rules<br>
    > <br>
    > driver: $(OBJ)<br>
    >                 -${CLINKER} -o $@ $^ ${PETSC_LIB} ${EXTRALIBS} ${CFLAGS}<br>
    > <br>
    > objects/%.o: src/%.c $(DEP)<br>
    >                 ${PETSC_COMPILE} -c $< -o $@<br>
    > <br>
    > <br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>