This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stupid question...


On Sun, 11 Oct 2009, Robert G. Brown wrote:

I'm trying to get gsl to be correctly detected in a configure.ac
(something that has never quite worked, for reasons I don't understand).

Sorry to answer my own question, but GIYF and I found a hint, made a guess, and here it is. (Apparently) library check order matters, and one has to put the rightmost library dependencies first. -lgsl will not compile unless -lgslcblas is present, but -lgslcblas will compile without -lgsl, so inverting the order of the two lines to:

#==================================================================
# Checks for libraries, and headers.  Test for cblas FIRST.
#==================================================================
AC_CHECK_HEADER([gsl/gsl_sf_gamma.h],,[AC_MSG_ERROR([Couldn't find GSL headers! Please install gsl-devel.])])
AC_CHECK_LIB([gslcblas], [main])
AC_CHECK_LIB([gsl],[gsl_sf_gamma])

checking gsl/gsl_sf_gamma.h usability... yes
checking gsl/gsl_sf_gamma.h presence... yes
checking for gsl/gsl_sf_gamma.h... yes
checking for main in -lgslcblas... yes
checking for gsl_sf_gamma in -lgsl... yes

works charm-like.  Makes sense, I suppose, but pretty hard to find in
the documentation for autoconf; I could as easily have thought each
library check was independent, but the output in config.log left me
nothing else to try and it worked.

rgb

Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb@phy.duke.edu



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]