|
From: | Mohammad Akhlaghi |
Subject: | Re: [Help-gsl] change in gsl_multifit_linear_svd |
Date: | Thu, 22 Sep 2016 12:16:48 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 09/21/2016 09:10 PM, Timothée Flutre wrote:
Moreover, does someone know how I can use conditionals with the Autotools (via ./configure) so that, if the user has GSL <= 1.16, the compiled code uses gsl_multifit_linear_svd whereas if the user has GSL >= 2.0 the compiled code uses gsl_multifit_linear?
Once installed, GSL also installs an executable script called "gsl-config". If you run it with the "--version" option, this script will print the installed version of GSL:
$ gsl-config --versionYou can use the output of this command, along with "AX_COMPARE_VERSION" (from the GNU Autoconf Archives) to check for the version. The link bellow shows how we do it in GNU Astronomy Utilities when we need to check the version of Ghostscript:
http://git.savannah.gnu.org/cgit/gnuastro.git/tree/configure.ac (See the part that starts with the "Check Ghostscript:" comment)You don't be needing the check on existance like our Ghostscript check, since I assume you will be using `AC_SEARCH_LIBS' for GSL's existance. You just need the indented part after `AC_MSG_CHECKING(Ghostscript version)'.
You can then pass the check's result into `config.h' and use the information in your programming to decide which function to use.
Cheers, Mohammad
[Prev in Thread] | Current Thread | [Next in Thread] |