[petsc-users] missing libpetsc.a

0sabio00 at gmail.com 0sabio00 at gmail.com
Thu Sep 6 10:33:45 CDT 2012


With new flag and DMGetMatrix --> DMCreateMatrix. I get an error

/usr/bin/ld : cannot find -lpetsc
collect2: ld returned 1 exit status



On Thu, Sep 6, 2012 at 10:29 AM, <0sabio00 at gmail.com> wrote:

> I tried
>
> make PETSC_DIR=$PWD PETSC_ARCH=arch-linux2-c-debug getlinklibs
>
> and it printed out
>
> -Wl, -rpath, /PETSC_DIR/PETSC_ARCH/lib -L//PETSC_DIR/PETSC_ARCH/lib
> -lpetsc -lpthread -Wl -rpath, /PETSC_DIR/PETSC_ARCH/lib -lflapack -lfblas
> -lm -L/usr/lib/gcc/i486-linux-gnu/4.4.5 -L/usr/lib/i486-linux-gru
> -lmpichf90 -lgfortran -lm -lm -ldl -lmpich -lopa -lmpl -lrt -lpthread
> -lgcc_s -ldl
>
> I gor rid of all ',' and used the flag above and it had error with -Wl and
> -rpath flags
>
> gcc: unrecognized option -rpath
> cclplus: error : unrecognized command line option "-Wl"
>
> so i got rid of those two flags and compiled and I still get the same
> error with DMGetMatrix not being declared.
>
> I checked the location of all the libraries listed above. (with find -name
> lib'blahblah'.*) at "/"
>
> But There was no library for petsc "libpetsc.*" anywhere.
>
> Am I missing something??
>
> Thank you
>
>
>
> On Thu, Sep 6, 2012 at 6:28 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>
>> The routine is spelled DMCreateMatrix()
>> On Sep 6, 2012 12:23 AM, <0sabio00 at gmail.com> wrote:
>>
>>> I think i'm having a trouble linking to the petsc library.
>>>
>>> gcc  main.cpp  -I /path to /petsc-3.3-p3/include -I /path
>>> to/petsc-3.3-p3/arch-linux2-c-debug/include
>>> -L/path to /petsc-3.3-p3/arch-linux2-c-debug/lib/ -lpetsc-o test
>>>
>>> I get an error => DMGetMatrix not declared in this scope.
>>>
>>> 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?
>>>
>>> Thanks
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120906/0c5d682f/attachment-0001.html>


More information about the petsc-users mailing list