[petsc-users] Including user made shared library in makefile.

Matthew Knepley knepley at gmail.com
Mon Oct 21 14:34:35 CDT 2013


On Mon, Oct 21, 2013 at 2:31 PM, Anthony Vergottis <a.vergottis at ucl.ac.uk>wrote:

> Dear All,
>
> I was wondering how does one include a .so object when compiling with a
> PETSc makefile? I have made various .so object for many projects and they
> work properly by specifying the -L location and the -lLibrary name. But
> when I try to link the .so object via a PETSc make file (after compilation
> with no errors) the ldd command does not show the library as being linked.
>

If you are in Linux (it looks like you are), then you will need -rpath
along with -L to get the shared library picked up. Look at the PETSc link
line.

   Matt


> Is there any internal behaviour of PETSc I should be aware of?  Have tried
> everything possible.
>
> I have configure PETSc with the following flags (if this helps).
>
> --download-mpich --with-clanguage=c++ --download-f-blas-lapack
> --download-metis --download-parmetis --with-shared-libraries=1
> --with-dynamic-loading=1
>
> This is the sample makefile:
>
> include ${PETSC_DIR}/conf/variables
> include ${PETSC_DIR}/conf/rules
> LIBS=-L/home/adonis/Dropbox/ParallelSolver -lpro
>
> pro: pro.o 2D_CBS_Solver.o
>             ${CLINKER} -o pro pro.o 2D_CBS_Solver.o ${PETSC_LIB} ${LIBS}
>             ${RM} pro.o 2D_CBS_Solver.o
>
> After this makefile is run still ldd does not show linkage.
>
> Any help would be appreciated. Thanks in advance.
>
> Best regards,
> Anthony
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131021/612b29b8/attachment-0001.html>


More information about the petsc-users mailing list