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

Satish Balay balay at mcs.anl.gov
Mon Oct 21 14:35:45 CDT 2013


On Mon, 21 Oct 2013, Anthony Vergottis 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.
> 
> 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

you need:

LIBS=-L/home/adonis/Dropbox/ParallelSolver -Wl,-rpath,/home/adonis/Dropbox/ParallelSolver -lpro

Satish

> 
> 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
> 



More information about the petsc-users mailing list