I tried with given flag and it still gave me an error ( cannot find -lpetsc )<div>When I did "make test" I got an error </div><div>/usr/bin/ld : cannot find -lpetsc</div><div><br></div><div>Thank you</div><div><br>
</div><div><br><div class="gmail_quote">On Thu, Sep 6, 2012 at 12:25 PM, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also first confirm 'make test' works for this build of petsc.<br>
<span class="HOEnZb"><font color="#888888"><br>
Satish<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, 6 Sep 2012, Matthew Knepley wrote:<br>
<br>
> On Thu, Sep 6, 2012 at 10:29 AM, <<a href="mailto:0sabio00@gmail.com">0sabio00@gmail.com</a>> wrote:<br>
><br>
> > I tried<br>
> ><br>
> > make PETSC_DIR=$PWD PETSC_ARCH=arch-linux2-c-debug getlinklibs<br>
> ><br>
> > and it printed out<br>
> ><br>
> > -Wl, -rpath, /PETSC_DIR/PETSC_ARCH/lib -L//PETSC_DIR/PETSC_ARCH/lib<br>
> > -lpetsc -lpthread -Wl -rpath, /PETSC_DIR/PETSC_ARCH/lib -lflapack -lfblas<br>
> > -lm -L/usr/lib/gcc/i486-linux-gnu/4.4.5 -L/usr/lib/i486-linux-gru<br>
> > -lmpichf90 -lgfortran -lm -lm -ldl -lmpich -lopa -lmpl -lrt -lpthread<br>
> > -lgcc_s -ldl<br>
> ><br>
> > I gor rid of all ',' and used the flag above and it had error with -Wl and<br>
> > -rpath flags<br>
> ><br>
><br>
> Why did you do that? These commas are meaningful. See the gcc manual.<br>
><br>
> Matt<br>
><br>
> gcc: unrecognized option -rpath<br>
> > cclplus: error : unrecognized command line option "-Wl"<br>
> ><br>
> > so i got rid of those two flags and compiled and I still get the same<br>
> > error with DMGetMatrix not being declared.<br>
> ><br>
> > I checked the location of all the libraries listed above. (with find -name<br>
> > lib'blahblah'.*) at "/"<br>
> ><br>
> > But There was no library for petsc "libpetsc.*" anywhere.<br>
> ><br>
> > Am I missing something??<br>
> ><br>
> > Thank you<br>
> ><br>
> ><br>
> ><br>
> > On Thu, Sep 6, 2012 at 6:28 AM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> wrote:<br>
> ><br>
> >> The routine is spelled DMCreateMatrix()<br>
> >> On Sep 6, 2012 12:23 AM, <<a href="mailto:0sabio00@gmail.com">0sabio00@gmail.com</a>> wrote:<br>
> >><br>
> >>> I think i'm having a trouble linking to the petsc library.<br>
> >>><br>
> >>> gcc main.cpp -I /path to /petsc-3.3-p3/include -I /path<br>
> >>> to/petsc-3.3-p3/arch-linux2-c-debug/include<br>
> >>> -L/path to /petsc-3.3-p3/arch-linux2-c-debug/lib/ -lpetsc-o test<br>
> >>><br>
> >>> I get an error => DMGetMatrix not declared in this scope.<br>
> >>><br>
> >>> and I realized that I can't find libpetsc.a or libpetsc.so anywhere.<br>
> >>> Where is the petsc library exactly? if I find the location of the petsc<br>
> >>> library and link it would it fix the problem?<br>
> >>><br>
> >>> Thanks<br>
> >>><br>
> >><br>
> ><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>