GSL 2 introduces some API changes triggering build failures;
In file included from /usr/include/sys/types.h:25:0,
from /usr/lib64/perl5/CORE/perl.h:699,
from ELLINT.xs:22:
/usr/include/features.h:331:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^
In file included from ELLINT.xs:39:0:
ELLINT.xs: In function 'pdl_gsl_sf_ellint_D_readdata':
ELLINT.xs:1736:8: error: too many arguments to function 'gsl_sf_ellint_D_e'
GSLERR(gsl_sf_ellint_D_e,((phi_datap)[0] PDL_COMMENT("ACCESS()") ,(k_datap)[0] PDL_COMMENT("ACCESS()") ,(n_datap)[0] PDL_COMMENT("ACCESS()") ,GSL_PREC_DOUBLE,&r))
^
../gslerr.h:5:35: note: in definition of macro 'GSLERR'
#define GSLERR(x,y) if ((status = x y)) {snprintf(buf,200,"Error in %s: %s", #x, gsl_strerror(status));barf("%s", buf);}
^
In file included from /usr/include/gsl/gsl_sf.h:17:0,
from ELLINT.xs:38:
/usr/include/gsl/gsl_sf_ellint.h:84:5: note: declared here
int gsl_sf_ellint_D_e(double phi, double k, gsl_mode_t mode, gsl_sf_result * result);
^
Makefile:325: recipe for target 'ELLINT.o' failed
Attached is the patch to PDL/Lib/GSL/SF/ellint/gsl_sf_ellint.pd that I use to get around this problem.
But, there's another gotcha - there are some deprecated functions in PDL's SF/legendre code so the gsl library needs to have been built without GSL_DISABLE_DEPRECATED being defined, and that does not happen by default.
To that end, I've been manually removing that define from config.h after running configure, and before running make. (Alternatively, I suspect one could just remove that define from config.h.in prior to running configure.)
Better, of course, for the deprecated functions in PDL to be replaced with their new counterparts.
Cheers,
Rob
Thanks, that seems to do the trick for me. I'm not seeing the issue with deprecated gsl functions myself.
That's encouraging - especially if you've installed gsl-2.x via a package manager.
If you built gsl yourself, could you tell me what configure command you ran , please.
Cheers,
Rob
This is all being done here: https://copr-fe.cloud.fedoraproject.org/coprs/orion/gsl2/ So it's building against an updated gsl 2.1 package.
Specifically, the Legendre functions that were deprecated in gsl 2.0 are:
gsl_sf_legendre_Plm_array
gsl_sf_legendre_Plm_deriv_array
gsl_sf_legendre_sphPlm_array
gsl_sf_legendre_sphPlm_deriv_array
gsl_sf_legendre_array_size
But PDL only uses gsl_sf_legendre_Plm_array and gsl_sf_legendre_sphPlm_array.
Branch sf#407_gsl2.0 contains changes that should take care of all the issues raised here. Please check!
Appears to build fine here.
Is there a way to tell what the value of GSL_DISABLE_DEPRECATED was when the current instance of gsl was compiled? I don't see anything in the output of 'gsl-config'.
Not that I can tell. However, since I can't see how you can build gsl without GSL_DISABLE_DEPRECATED=1, I think it's fairly safe to assume that it was defined.
From: Orion Poplawski
Sent: Friday, April 22, 2016 1:53 AM
To: [pdl:bugs]
Subject: [pdl:bugs] #407 Build failures with GSL 2.1
I, too, can't see any way of telling whether GSL_DISABLE_DEPRECATED was
defined, other than writing a program that uses a deprecated function and
see if it throws an error.
I guess one could examine the symbol table of the gsl library, but that's
also hardly satisfactory.
To build without GSL_DISABLE_DEPRECATED one can simply remove the definition
from Config.h before running make (or, I presume, remove the definition from
Config.h.in before running configure).
Cheers,
Rob
I decided to just ignore it--thought it would be an easy gsl-config check. We, like GSL, will not build the deprecated functions by default. And if users wants to muck around with GSL to build the deprecated ones, they can muck around with PDL too, I suppose.
Marking pending-fixed until PDL-2.016 is released.
Closing now that 2.016 is released.