[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool adds an annoying -L/usr/lib in link command

From: Gary V. Vaughan
Subject: Re: libtool adds an annoying -L/usr/lib in link command
Date: Wed, 9 Jun 2010 19:57:30 +0700

Hi Christian,

On 9 Jun 2010, at 19:27, christian caremoli wrote:
> I resend my question from gmail.

Thanks :)

> Most likely your has -L/usr/libs in its dependency_libs entry.  You 
> can fix that by editing the file to pass the library name by its 
> full path, or by adjusting the install process of libhdf not to record 
> -L/usr/libs there.
> dependency_libs in does not contain -L/usr/lib. I have already 
> checked that.
> dependency_libs=' -lpthread -lz -lm'

Are you using a stock libtool?  Or a patched version packaged by your OS vendor?

Have you looked along the entire dependency tree of the libraries you pass on 
the link line to see whether one of the .la files libtool finds contains a 
-L/usr/lib?  Or with ldd(1)/objdump(1) or equivalent to see whether one of the 
libraries along that path has /usr/lib in it's RPATH?

While it's possible that libtool is adding the -L/usr/lib spuriously, when this 
has happened to other users it has always turned out to be due to the 

If you have root access to the machine in question, you can always rename the 
.la files on your machine temporarily to hide them from libtool to see whether 
the link works then... and if so, it's just a matter of tracking down which .la 
file has the -L/usr/lib entry inside when you've put them back again.

Hope that helps.

> I link 3 libraries with libtool. The first one is linked with hdf lib that is 
> in system (/usr/lib), the
> second one is linked with vtk lib that is not in system ($VTKHOME) and the 
> third one is linked 
> with the 2 previous libs.
> The problem is that there is another vtlk lib in system (/usr/lib) and 
> libtool adds an -L/usr/lib when adding
> hdf dependency so my third lib is linked with the two vtk libs (in system and 
> in VTKHOME).
> I have not found a way to handle this situation. What would be  the right way 
> ?
> Here is a simplified script of my link:
> cd src/p1
> /bin/sh ../../libtool --tag=CXX --mode=link g++ -o -rpath 
> /local/cchris/pkg/libtool/test22/myinstall/lib hello.lo -lhdf5
> cd ../p2
> /bin/sh ../../libtool --tag=CXX --mode=link g++ -o -rpath 
> /local/cchris/pkg/libtool/test22/myinstall/lib prog.lo 
> -L/local/cchris/pkg/vtk/install/lib/vtk-5.6 -lvtkCommon
> cd ../p3
> /bin/sh ../../libtool --tag=CXX --mode=link g++ -o -rpath 
> /local/cchris/pkg/libtool/test22/myinstall/lib viewer.lo ../p1/ 
> ../p2/
> Regards 
> Christian Caremoli

Gary V. Vaughan (address@hidden)        

reply via email to

[Prev in Thread] Current Thread [Next in Thread]