bug-libtool
[Top][All Lists]
Advanced

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

BUG: library type search order


From: Markus Diesmann
Subject: BUG: library type search order
Date: Thu, 22 Jan 2004 19:49:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

We would like to report a malfunction
of libtool 1.5.

Situation:

The following libraries are installed
/usr/lib/libmpi.a           (LAM MPI)
/usr/lib/libmpi.la

/opt/scali/lib/libmpi.a     (MPI by other manufacturer)
/opt/scali/lib/libmpi.so
We have to link against /opt/scali/lib/libmpi.so.
At the same time we cannot remove the LAM MPI from
/usr/lib.

Running

/bin/sh ./libtool --mode=link g++  -o foo foo.o -L/opt/scali/lib -lmpi

yields

g++ -o foo foo.o -L/opt/scali/lib /usr/lib/libmpi.a

Note that /usr/lib/libmpi.a was chosen by libtool in spite of
the -L/opt/scali/lib commandline option to libtool.

We have traced this to the code in lines
1805 to 1870 of ltmain.in:
This code first searches all directories in the search path
for libtool libraries (*.la). If a libtool library is found, the
corresponding directory is chosen immediately.
Thus, in our case /usr/lib is chosen since /opt/scali/lib/libmpi is
not available as a libtool library.

Suggested fix:

Modify search strategy such that each directory in the search path
is searched  *.la *.so *.a before the next directory is searched.
This ensures that if a requested library is available in any format
in an early directory that directory (and library) will be chosen.
The -L command line option will thus work as the user expects it to.

Regards,
Hans Ekkehard Plesser,
Markus Diesmann

--
Dr. Markus Diesmann             Computational Neurophysics
Tel:    +49 (0)761 203 9550     Dept. Neurobiology & Biophysics
Fax:    +49 (0)761 203 2860     Biology III, Albert-Ludwigs-University
Mobile: +49 (0)151 12153069     Schaenzlestr. 1, 79104 Freiburg, Germany






reply via email to

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