autoconf
[Top][All Lists]
Advanced

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

Re: AC_SEARCH_LIBS for GSL fails with -lgslcblas


From: Ralf Wildenhues
Subject: Re: AC_SEARCH_LIBS for GSL fails with -lgslcblas
Date: Tue, 21 Aug 2007 19:54:33 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Rutger,

* Rutger van Haasteren wrote on Tue, Aug 21, 2007 at 11:46:53AM CEST:
> 
> Now, if I would use the recommended way to link to the GSL library with the
> GSL blas library, I would write in my configure.ac:
> 
> AC_CHECK_LIB(m,main)

Please avoid checking for the `main' function other than to work around
some issue you know of (it may be useful for checking for presence of
C++ symbols (not `extern "C"' ones!) in some cases).  Here I'd use:
  AC_CHECK_LIB([m], [cos])

> AC_CHECK_LIB([gslcblas], [cblas_dgemm])
> AC_SEARCH_LIBS(gsl_atanh, gsl)
> Which gives:
> checking for main in -lm... yes
> checking for cblas_dgemm in -lgslcblas... yes
> checking for gsl_atanh in -lgsl... yes

Good.

> However, the following should also work:
> 
> AC_CHECK_LIB(m,main)
> AC_SEARCH_LIBS(gsl_atanh, gsl, [], [], -lgslcblas)
> Which gives:
> checking for main in -lm... yes
> checking for gsl_atanh in -lgsl... no

Each configure run creates a file config.log with more verbose output.
Usually, that also contains the reasons why some tests fail.  Please
look into it and search the respective section to find out.  If that
doesn't help yet, then please post the part of that file that belongs
to above tests.

It would be prudent and good style if GSL offered to its users a macro
or a couple, say gsl_CHECK_GSL that would check for presence of the
library (and needed libs) and headers.  Maybe even add a switch
--with-gsl[=PREFIX] or so.  And the best thing is: such a thing already
exists: on my Debian system it's at /usr/share/aclocal/gsl.m4 and part
of the package libgsl0, the macro is named AM_PATH_GSL (too bad it
invades Automake name space...).

Cheers,
Ralf




reply via email to

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