<div dir="ltr">You need to link to all of the libraries. At the petsc top directory issue:<div><br></div><div>make PETSC_DIR=$PWD PETSC_ARCH=<span style="color:rgb(51,51,51);font-family:'Lucida Grande','Trebuchet MS',Verdana,Helvetica,Arial,sans-serif;font-size:13px;line-height:18px">arch-linux2-c-</span><span style="color:rgb(51,51,51);font-family:'Lucida Grande','Trebuchet MS',Verdana,Helvetica,Arial,sans-serif;font-size:13px;line-height:18px">debug getlinklibs</span></div>
<div><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18px"><br></span></font></div><div><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18px">That'll give you all the libraries that need to be linked to the executable<br>
</span></font><br><div class="gmail_quote">On Thu, Sep 6, 2012 at 12:23 AM, <span dir="ltr"><<a href="mailto:0sabio00@gmail.com" target="_blank">0sabio00@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I think i'm having a trouble linking to the petsc library.</div><div><br></div><div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px">gcc main.cpp -I /path to /petsc-3.3-p3/include -I /path to/petsc-3.3-p3/arch-linux2-c-debug/include </span></font></div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px">-L/path to /petsc-3.3-p3/arch-linux2-c-debug/lib/ -lpetsc-o test </span></font></div>
</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px"><br>
</span></font></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px">I get an error => DMGetMatrix not declared in this scope. </span></font></div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px"><br>
</span></font></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px">and I realized that I can't find libpetsc.a or libpetsc.so anywhere. Where is the petsc library exactly? if I find the location of the petsc library and link it would it fix the problem?</span></font></div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px"><br>
</span></font></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><font color="#333333" face="Lucida Grande, Trebuchet MS, Verdana, Helvetica, Arial, sans-serif"><span style="line-height:18.200000762939453px">Thanks</span></font></div>
</blockquote></div><br></div></div>