On Mon, Mar 12, 2012 at 4:49 PM, Francis Poulin <span dir="ltr">&lt;<a href="mailto:fpoulin@uwaterloo.ca">fpoulin@uwaterloo.ca</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hello,<div><br></div><div>Yes my examples work fine.   I have looked in the makefile for the examples and it looks fairly complicated.  One thing I noticed is that I wasn&#39;t  using the mpicc that is in my petsc directory.  I went back and made sure that I am using the mpicc that was build by PETSc.  That changes things, but now I cannot compile the code whereas before I could.</div>
<div><br></div><div>Do you have a suggestion as to how I can most easily adapt the makefile from the examples into the code we are building?</div></div></blockquote><div><br></div><div>The makefiles are simple. Here is building an executable:</div>
<div><br></div><div>myProg: myProg.o otherSource.o anotherSource.o</div><div>       ${CLINKER} -o myProg ${PETSC_TS_LIB}</div><div><br></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 style="word-wrap:break-word"><div>Thanks for the help,</div><div>Francis</div><div> <br><div><div>On 2012-03-12, at 4:41 PM, Jed Brown wrote:</div><br><blockquote type="cite"><div class="gmail_quote">On Mon, Mar 12, 2012 at 15:37, Francis Poulin <span dir="ltr">&lt;<a href="mailto:fpoulin@uwaterloo.ca" target="_blank">fpoulin@uwaterloo.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I am trying to call Petsc from a C++ program and having difficulties.  I&#39;m using v3.2.6 and I can run all the examples so I assumed that everything was installed ok.  The body of the function is very simple, see below.  I get a segmentation fault.   In my installation I used mpich<br>


<br>
I have a colleague who also installed openmp and this works for him on the same version of Petsc.  Could it be that Petsc is confused because I have two different MPI&#39;s installed?  I am hoping that it will use the one that it configured but I do have the other MPI in the same path.</div>

</blockquote></div><br><div>Yes, the most likely scenario is that your application was linked with a different MPI than PETSc was compiled with. It is probably a makefile that uses the wrong MPI. Can you build PETSc examples?</div>

</blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>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<br>