help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Renaming versions of the libraries?


From: Brian Gough
Subject: Re: [Help-gsl] Renaming versions of the libraries?
Date: Fri, 05 Feb 2010 11:37:45 +0000
User-agent: Wanderlust/2.14.0 (Africa) Emacs/22.1 Mule/5.0 (SAKAKI)

At Thu, 28 Jan 2010 21:00:54 +0000,
Peter Rockett wrote:
> It's not very helpful that configure --help returns this as an option
> when it doesn't work!

In this case the --program-prefix/suffix option provided by autoconf
applies only to programs, rather than libraries.

I believe there's no option for renaming libraries because it would
create more complicated dependency issues (e.g. for programs that use
the library that are installed at the same time).  

> Forgive me but this is not an elegant solution. Having files with the
> same names is a recipe for mix-up. In fact, running configure with the
> --libdir=/usr/local/lib-dbg option to specify a different install
> directory for the libs seems a better bet since you don't get duplicate
> copies of the include files, etc.

In the simplest case, using --libdir to a separate directory will
work.  There are various other files installed though, like pkg-config
files, which will be overwritten--that's why I always use a separate
top-level prefix.

> I agree with Leo! The default library (-g -O2) does not seem to debug
> properly. When I tried stepping into a GSL routine with what I now know
> was this configuration, GDB went to line 1, then line 6, then back to
> line 2, then 3, then back to 1... I now realise that I got it to work
> properly with just the -g option (no -O2 option). I have always regarded
> the debug and optimisation options as a dangerous mix, whatever the
> compiler. (I seem to recall they are incompatible options in MSVC++? Or
> at very least, inlining is ignored in the debug build.)

With gcc, it is possible to use debugging and optimisation at the same
time -- apart from the fact that the code jumps around following the
optimisation and some variables are optimised out. 

Personally I got used to it after a while.  There is no speed cost,
since the debugging symbols are just data and it doesn't change the
execution.  For complicated cases, I agree it can be simpler to turn
off optimisation though -- although one has to keep in mind that can
change the numerical behavior.

> (But I still think it's bad practice to have different libraries with
> the same names! Can anyone who knows autoconf suggest a solution?)

I find it an advantage to use the same names and different directories
rather than different names as it is easy to change the library at
runtime without modifying the executable via LD_LIBRARY_PATH.

-- 
Brian Gough

GNU Scientific Library -
http://www.gnu.org/software/gsl/




reply via email to

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