This is the mail archive of the
mailing list for the GSL project.
Re: Stupid question...
- From: "Robert G. Brown" <rgb at phy dot duke dot edu>
- To: GSL Discussion list <gsl-discuss at sources dot redhat dot com>
- Date: Sun, 11 Oct 2009 10:06:00 -0400 (EDT)
- Subject: Re: Stupid question...
- References: <alpine.LFD.2.00.0910110947130.7810@lilith>
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.])])
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.
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:email@example.com