[petsc-users] calling PETSc from C++
Francis Poulin
fpoulin at uwaterloo.ca
Mon Mar 12 16:49:06 CDT 2012
Hello,
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'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.
Do you have a suggestion as to how I can most easily adapt the makefile from the examples into the code we are building?
Thanks for the help,
Francis
On 2012-03-12, at 4:41 PM, Jed Brown wrote:
> On Mon, Mar 12, 2012 at 15:37, Francis Poulin <fpoulin at uwaterloo.ca> wrote:
> I am trying to call Petsc from a C++ program and having difficulties. I'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
>
> 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'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.
>
> 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120312/2bd6a1f2/attachment.htm>
More information about the petsc-users
mailing list