help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Building a shared library that links with GSL


From: Joseph Wakeling
Subject: Re: [Help-gsl] Building a shared library that links with GSL
Date: Thu, 03 May 2007 14:23:35 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070403)

Fantastic, thank you to all who replied!

John D Lamb wrote:
>> Secondly, do I need to reference -lgsl -lgslcblas when compiling my
>> library, or can I leave this in the hands of the person compiling a
>> program that makes use of it?  I have created an appropriate .pc file
>> for pkg-config.
> 
> I don't use pkg-config. The AC_CHECK_LIB macro in configure.ac will
> prepend -lgsl to the list of compiler flags. It will also define the
> preprocessor macro HAVE_LIBGSL so that you can use, for example,
> 
> #ifdef HAVELIBGSL
> // smart code
> #else
> // alternative code
> #endif
> 
> Since this is useless to me (aut GSL aut nihil) I've simply put out
> errors and forced an exit in the absence of GSL.

This raises another question I forgot to ask.  When I build my library
should I build it with -lgsl -lgslcblas flags, or should I leave that in
the hands of the person linking to it?  I see that when linking to GSL,
the -lm option is not required.




reply via email to

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