<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Oct 23, 2018 at 11:37 AM Yingjie Wu <<a href="mailto:yjwu16@gmail.com">yjwu16@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear Petsc developer:<div>Hi,</div><div>Thank you very much for your continuous help, I recently encountered some difficulties in developing programs on Petsc.</div><div><br></div><div>1. I want to use my class definition (class1. h) and class functions (class1. cpp) files in my Petsc program (myprogram. c) and compile my program. I have written other program before: <br></div><div><div>g++ -c class1.cpp myprogram.c </div><div>g++ -o myprogram *.o</div></div><div>I also have some knowledge of Makefile, but I don't know how to modify it to achieve compilation. I really want your help. </div></div></div></div></div></div></div></blockquote><div><br></div><div>With PETSc makefiles, we have automatic rules, so you can use</div><div><br></div><div>myprogram: class1.o myprogram.o</div><div> ${CLINKER} -o myprogram class1.o myprogram.o ${PETSC_LIB}</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>2. In my class definition and function implementation program, I want to use Petsc data structures, such as PetscInt, PetscReal. In order to maintain consistency of the main program. What kind of header files should I add to my code, or do I need to add any code? </div></div></div></div></div></div></div></blockquote><div><br></div><div>The easiest thing to do is just</div><div><br></div><div>#include <petsc.h></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Thanks,</div><div>Yingjie</div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="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>