[Top][All Lists]

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

Re: [Toon-members] pkgconfig support

From: Michael Marner
Subject: Re: [Toon-members] pkgconfig support
Date: Wed, 23 Jun 2010 14:31:14 +0930
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100217 Shredder/3.0.3pre

On 22/06/10 17:16, Pekka Paalanen wrote:
> On Tue, 22 Jun 2010 12:04:35 +0930
> Michael Marner <address@hidden> wrote:
>> I have been attempting to package TooN a bit nicer for Ubuntu/Debian.
>> One of the things I've done is add support for pkg-config. This is
>> needed so that projects using TooN will correctly link against lapack,
>> etc. when using pkg-config to set linker flags. Attached is a diff of
>> the cvs repository which adds support for pkg-config. All that is
>> needed is to re-execute autoconf to bring the configure script up to
>> date.
>> It would be good if other people could test this, and maybe get the
>> changes added to the cvs repository. If there are any problems let me
>> know.
> Hi,
> I haven't tested this, but I have some comments.
> --- TooN/   1970-01-01 09:30:00.000000000 +0930
> +++ TooN_new/       2010-06-22 11:49:23.460045915 +0930
> @@ -0,0 +1,10 @@
> address@hidden@
> address@hidden@
> address@hidden@
> address@hidden@
> +
> +Name: TooN
> +Description: Tom's Object-oriented numerics library
> +Version: @VERSION@
> +Libs: -L${libdir} -llapack -lblas -lg2c
> +Cflags: -I${includedir}
> Isn't $libdir here the directory where TooN is, not where
> lapack is? That is, is it necessary?
> You are hardcoding, what libraries to link for LAPACK, I don't
> think this is good, since different LAPACK implementations
> need different libraries, for instance, see the discussion:
> If you look at the original levmar Makefile, you see many
> different configurations for linking to different LAPACK
> implementations.
> For instance, with lapack-atlas, I do not need -lg2c, but
> the library itself links to libgfortran. On Gentoo
> 'pkg-config --libs lapack' gives "-llapack -lblas -lcblas -latlas", but
> that seems redundant, since already links blas, cblas and
> atlas.
> I'm just saying that this is not as trivial as it may look like.
> Since Ubuntu does not provide (to my knowledge, I use only Gentoo)
> a lapack.pc file, I'm not sure there is a good solution.
> Since TooN has autoconf, why not use an autoconf LAPACK macro?
> Perhaps
> I'm sure there are also ready-made macros for pkg-config.
> It would be excellent if this whole LAPACK linking issue was solved in
> TooN, and other projects could simply use 'pkg-config --libs TooN'.
> Just my 2c.
> Cheers.

Thanks for the feedback.

Re. libdir - Yes you are correct. I copied the file from another
project and forgot to remove it.

Re. Hard coding. - Again, this was a mistake on my part. I was using the
TooN readme when deciding what linker flags needed to be included. I
completely overlooked the fact that LAPACK probably has some linker
requirements in addition to these. You are right that on Ubuntu there is
no .pc file included with LAPACK. However, the macro in the autoconf
archive seems to work.

I've attached another diff, this time with the hard coding removed.


./make install

I haven't included the M4 macro that checks for LAPACK, since it is
included in the pkgconfig-archive package in Ubuntu's repository.


Attachment: TooN-pkgconfig2.diff
Description: Text Data

reply via email to

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