[ofa-general] [PATCH] add pkgconfig support to ibverbs library

Steven Dake sdake at redhat.com
Mon Jul 20 16:12:34 PDT 2009


On Mon, 2009-07-20 at 16:34 -0600, Jason Gunthorpe wrote:
> On Mon, Jul 20, 2009 at 12:07:19PM -0700, Steven Dake wrote:
> > On Mon, 2009-07-20 at 12:43 -0600, Jason Gunthorpe wrote:
> > > On Mon, Jul 20, 2009 at 11:17:29AM -0700, Steven Dake wrote:
> > > > The attached patch adds support for pkgconfig to the ibverbs library.
> > > > 
> > > > Cloned from Roland's kernel.org git tree.
> > > 
> > > Erm, am I missing something? Shouldn't your patches include some use
> > > of the .pc files for libraries downstream of libibverbs, like
> > > librdmacm?
> > > 
> > 
> > yes librdmacm should use PKG_CHECK_MODULES to determine cflags and
> > ldflags and I will submit a patch for this capability.
> 
> Hmm.. Is this actually usefull? It looks to me like even pkg-config
> doesn't interact with --prefix in a sane way, so instead of doing:
> 
> CPPFLAGS="-I PREFIX" LDFLAGS="-L PREFIX" ./configure --prefix PREFIX
> 
> I'd now do:
> PKG_CONFIG_LIBDIR=PREFIX ./configure --prefix PREFIX
> 
  
> Is this an improvement worth the mess you went on to describe?
> 

The librdmacm maintainer would have to decide if it is worth it for him
to use pkgconfig functionality in his configure scripts.  For other
downstream projects that link against librdmacm or libibverbs that
follow the upstream adoption model of autotools (always use latest
autotools, older versions may have bugs), it has many benefits.

Example:
./configure --includedir=/tmp/abc
make install

How does the downstream adopting application know where the include
files are located in /tmp/abc?  Not all distros put the include files in
the same location.  There are two alternatives for downstream projects.
Have per-distro&version special casing in the configure script to find
the libs and headers which is very painful to maintain and support.
Option B is to specify the cflags and ldflags required for librdmacm and
libibverbs in the configure operation (again requiring the user to be
aware of where those files are stored).  Neither of these mechanisms
help adopting applications of rdmacm and ibverbs "become adopted"
because they are then harder to distribute.

As a downstream adoptor, solving the "what are the flags" in a scalable
easy to use fashion is the main advantage I get with pkgconfig with
minimal upstream rdmacm and ibverbs disruption.

Regards
-steve

> Given that this software is completely Linux only it doesn't seem
> pkg-config will add much. libtool .la files already take care of the
> details for static linking cases, the libraries in the OFA family all
> have correct DT_NEEDED's and libtool adds DT_RPATH for the dynamic
> case, and -I is all that is needed for gcc.
> 
> I've always regarded the autoconf behavior around --prefix as an
> annoying mis-feature..
> 
> Regards,
> Jason




More information about the general mailing list