<div dir="ltr">foo: foo .o<div>      ${CLINKER} -o $@ $^ ${PETSC_LIB}</div><div><br></div><div>   Matt</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 13, 2022 at 9:54 PM Jacob Faibussowitsch <<a href="mailto:jacob.fai@gmail.com">jacob.fai@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Is share/petsc/Makefile.user what you are looking for?<div><br><div><div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div>Best regards,<br><br>Jacob Faibussowitsch<br>(Jacob Fai - booss - oh - vitch)<br></div></div></div>
</div>
<div><br><blockquote type="cite"><div>On Jan 13, 2022, at 21:49, Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:</div><br><div><div style="overflow-wrap: break-word;"><div><br></div><a href="https://petsc.org/release/docs/manual/getting_started/?highlight=user%20makefile" target="_blank">https://petsc.org/release/docs/manual/getting_started/?highlight=user%20makefile</a><div><br></div><div>Search for <span style="font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">Writing Application Codes with PETSc</span></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">Perhaps this needs to clearer or have links to it from the FAQ.</font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br></font><div><br></div><div><br><blockquote type="cite"><div>On Jan 13, 2022, at 9:38 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:</div><br><div><div dir="ltr">I am finding it pretty hard to find an example of a makefile target to build an app with PETSc. <div><br></div><div>I can not find it on the docs page.</div><div><br></div><div>With Google:<br><div><br></div><div>Victor has a little example that looks fine ($PETSC_LIB). (sort of, see below)<div><br></div><div>Another one is bigger and has this at the end:</div><div><br></div><div>    -${CLINKER} $< -o bin.x $(OBJ_FILES) ${PETSC_KSP_LIB} -I$(PETSC_DIR)/include<br></div><div><br></div><div>I recall using PETSC_KSP_LIB the last time I wrote a makefile 20 years ago.</div></div></div><div><br></div><div>Maybe there should be a FAQ that a search would find like "Example of user makefile" with something like Victor's (dropping v2 and updating it, this looks wrong):</div><div><br></div><div><i>PETSc linking<br><br>The easiest way to link PETSc to your code is to have this line in your makefile:<br><br>include ${PETSC_DIR}/conf/base<br><br>This will automatically give you the compilation rules. For linking you then do:<br><br>${CLINKER} -o ex1 ex1.o ${PETSC_LIB}<br><br>(or FLINKER for fortran)<br><br>You can also use this include line:<br><br>include ${PETSC_DIR}/conf/variables<br><br>and then you have to give the compile rules yourself. In this case, do<br>something like<br><br>${CC} -c ex1.c ${PETSC_INCLUDE}<br><br>to compile. (This is for petsc version 3, for version 2 use<br><br>include ${PETSC_DIR}/bmake/common/base<br><br>and replace base by variables to omit petsc’s make rules.)<br><br>If you insist on having all the libraries and includes explicitly, use<br><br>make getlinklibs<br>make getincludedirs<br></i></div><div><i><br></i></div><div><br></div></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br></div></div></div></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>