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

Barry Smith bsmith at mcs.anl.gov
Mon Oct 21 14:56:54 CDT 2013


  Please cut and paste everything you've done in this process, the make, the running of ldd etc

   Barry

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

> Thanks for the replies. Unfortunatly this has still not worked. When using the ldd command the shared library libpro.so is not listed there. Any other ideas why this may be not linking?
> 
> Thanks again.
> 
> 
> On 21 October 2013 20:35, Satish Balay <balay at mcs.anl.gov> wrote:
> 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
> >
> 
> 
> 
> 
> 
> 
> -- 
> Anthony Vergottis
> 
> PhD Student
> Department of Mechanical Engineering
> University College London
> Gower Street
> London 
> WC1E 6BT
> 
> E-mail: a.vergottis at ucl.ac.uk  
> Tel (UK Mobile): (+44) 079 1263 0064



More information about the petsc-users mailing list