From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19701 invoked by alias); 11 Oct 2009 14:06:07 -0000 Received: (qmail 19561 invoked by uid 22791); 11 Oct 2009 14:06:06 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail.phy.duke.edu (HELO mail.phy.duke.edu) (152.3.182.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Oct 2009 14:06:03 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.phy.duke.edu (Postfix) with ESMTP id 8366B78096 for ; Sun, 11 Oct 2009 10:06:02 -0400 (EDT) Received: from mail.phy.duke.edu ([127.0.0.1]) by localhost (mail.phy.duke.edu [127.0.0.1]) (amavisd-new, port 10026) with LMTP id e3bFMOb5bZ5h for ; Sun, 11 Oct 2009 10:06:02 -0400 (EDT) Received: from lilith.rgb.private.net (client212-5.dsl.intrex.net [209.42.212.5]) by mail.phy.duke.edu (Postfix) with ESMTP id 244F27807F for ; Sun, 11 Oct 2009 10:06:02 -0400 (EDT) Date: Sun, 11 Oct 2009 14:06:00 -0000 From: "Robert G. Brown" To: GSL Discussion list Subject: Re: Stupid question... In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2009-q4/txt/msg00013.txt.bz2 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