[petsc-dev] PETSc.pc: missing rpath ?

Franck Houssen franck.houssen at inria.fr
Tue Jan 2 08:29:19 CST 2018


----- Mail original -----

> De: "Matthew Knepley" <knepley at gmail.com>
> À: "Franck Houssen" <franck.houssen at inria.fr>
> Cc: "Jed Brown" <jed at jedbrown.org>, "For users of the development version of
> PETSc" <petsc-dev at mcs.anl.gov>
> Envoyé: Mardi 2 Janvier 2018 15:18:08
> Objet: Re: [petsc-dev] PETSc.pc: missing rpath ?

> On Tue, Jan 2, 2018 at 9:15 AM, Franck Houssen < franck.houssen at inria.fr >
> wrote:

> > ----- Mail original -----
> 
> > > De: "Jed Brown" < jed at jedbrown.org >
> 
> > > À: "Franck Houssen" < franck.houssen at inria.fr >, "For users of the
> > > development version of PETSc"
> 
> > > < petsc-dev at mcs.anl.gov >
> 
> > > Envoyé: Mardi 2 Janvier 2018 15:02:17
> 
> > > Objet: Re: [petsc-dev] PETSc.pc: missing rpath ?
> 
> > >
> 
> > > Some people don't want RPATH. It was discussed here.
> 
> > >
> 

> > OK
> 

> > > https://mid.mail-archive.com/CAEymZafiQtwKDxh0myQ1LD_uByGKv5JyQ9PGzK3ZTmFPcOR=Kw@mail.gmail.com
> 
> > >
> 
> > > The RPATH flag is stored in a variable ldflag_rpath in PETSc.pc so you
> 
> > > can add it to PETSc paths, as done in this sample makefile.
> 

> > Reading PETSC.pc from cmake, ldflag_rpath is ignored.
> 
> That is hard to believe from the world's best build system CMake ;)

Like everything in computer science, "stuffs" are supposed to ease your life most of the time... And sometimes not ! :D Another example would be CI : upgrading from ubuntu12 (TravisCI/CircleCI) is an everyday problem... Where cmake can help a lot ! 

> Matt

> > > PETSc.pc := $(PETSC_DIR)/$(PETSC_ARCH)/lib/pkgconfig/PETSc.pc
> 
> > >
> 
> > > CC := $(shell pkg-config --variable=ccompiler $(PETSc.pc))
> 
> > > CXX := $(shell pkg-config --variable=cxxcompiler $(PETSc.pc))
> 
> > > FC := $(shell pkg-config --variable=fcompiler $(PETSc.pc))
> 
> > > CFLAGS := $(shell pkg-config --variable=cflags_extra $(PETSc.pc)) $(shell
> 
> > > pkg-config --cflags-only-other $(PETSc.pc))
> 
> > > FFLAGS := $(shell pkg-config --variable=fflags_extra $(PETSc.pc))
> 
> > > CPPFLAGS := $(shell pkg-config --cflags-only-I $(PETSc.pc))
> 
> > > LDFLAGS := $(shell pkg-config --libs-only-L --libs-only-other
> > > $(PETSc.pc))
> 
> > > LDFLAGS += $(patsubst -L%, $(shell pkg-config --variable=ldflag_rpath
> 
> > > $(PETSc.pc))%, $(shell pkg-config --libs-only-L $(PETSc.pc)))
> 
> > > LDLIBS := $(shell pkg-config --libs-only-l $(PETSc.pc)) -lm
> 
> > >
> 
> > > print:
> 
> > > @echo CC=$(CC)
> 
> > > @echo CFLAGS=$(CFLAGS)
> 
> > > @echo CPPFLAGS=$(CPPFLAGS)
> 
> > > @echo LDFLAGS=$(LDFLAGS)
> 
> > > @echo LDLIBS=$(LDLIBS)
> 
> > >
> 
> > > Franck Houssen < franck.houssen at inria.fr > writes:
> 
> > >
> 
> > > > I believe -rpath is missing in PETSc.pc: is this intented ? Or
> > > > forgotten
> > > > ?
> 
> > > > If so, can someone add this to the PETSc.pc and push that in
> > > > master/maint
> 
> > > > ?
> 
> > > > As PETSc is a lib to be used from user-defined applications, rpath is
> 
> > > > really critical !..
> 
> > > >
> 
> > > > Franck
> 
> > > >
> 
> > > >>> grep "Libs:" petsc/local/lib/pkgconfig/PETSc.pc
> 
> > > >>> slepc/local/lib/pkgconfig/SLEPc.pc
> 
> > > > petsc/local/lib/pkgconfig/PETSc.pc:16:Libs: -L${libdir} -lpetsc
> 
> > > > slepc/local/lib/pkgconfig/SLEPc.pc:11:Libs: -Wl,-rpath,${libdir}
> 
> > > > -L${libdir} -lslepc
> 
> > >
> 

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

> https://www.cse.buffalo.edu/~knepley/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20180102/213de0ef/attachment.html>


More information about the petsc-dev mailing list