Bug#805829: r-cran-gsl: Fails to build with GSL 2
Sebastiaan Couwenberg
sebastic at xs4all.nl
Thu Dec 3 15:49:42 UTC 2015
Control: tags -1 patch fixed-upstream
Hi Andreas,
On 24-11-15 22:14, Andreas Tille wrote:
> thanks for working on the libgsl migration. I commited a patch to SVN[1]
> to circumvent the check by configure but that's not sufficient to do the
> migration. The build fails with
>
> In file included from ellint.c:1:0:
> /usr/include/gsl/gsl_sf_ellint.h:84:5: note: expected 'gsl_sf_result * {aka struct gsl_sf_result_struct *}' but argument is of type 'int'
> int gsl_sf_ellint_D_e(double phi, double k, gsl_mode_t mode, gsl_sf_result * result);
> ^
> ellint.c:82:17: error: too many arguments to function 'gsl_sf_ellint_D_e'
> status[i] = gsl_sf_ellint_D_e(phi[i], k[i], n[i], sf_mode[*mode], &result) ;
> ^
>
> Anybody with some gsl experience might perhaps know what to do next
> hopefully.
The attached patch add support for GSL 2.x and make r-cran-gsl build
successfully with GSL 2.1.
The changes were taken from yesterdays 1.9-10.1 upstream release, so
you'll want to package that instead.
https://cran.r-project.org/web/packages/gsl/
https://cran.r-project.org/src/contrib/gsl_1.9-10.1.tar.gz
Make sure to update the build dependency to libgsl-dev to not pull in
the old GSL 1.x packages via libgsl0-dev.
Kind Regards,
Bas
--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
-------------- next part --------------
diff -Nru r-cran-gsl-1.9-10/debian/changelog r-cran-gsl-1.9-10/debian/changelog
--- r-cran-gsl-1.9-10/debian/changelog 2014-06-23 12:25:00.000000000 +0200
+++ r-cran-gsl-1.9-10/debian/changelog 2015-11-22 21:58:37.000000000 +0100
@@ -1,3 +1,10 @@
+r-cran-gsl (1.9-10-1.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Update build dependencies for GSL 2, change libgsl0-dev to libgsl-dev.
+
+ -- Bas Couwenberg <sebastic at debian.org> Sun, 22 Nov 2015 21:58:32 +0100
+
r-cran-gsl (1.9-10-1) unstable; urgency=low
* Initial release (Closes: #752387).
diff -Nru r-cran-gsl-1.9-10/debian/control r-cran-gsl-1.9-10/debian/control
--- r-cran-gsl-1.9-10/debian/control 2014-06-23 10:58:32.000000000 +0200
+++ r-cran-gsl-1.9-10/debian/control 2015-11-22 21:58:30.000000000 +0100
@@ -6,7 +6,7 @@
Build-Depends: debhelper (>= 9.0),
cdbs,
r-base-dev,
- libgsl0-dev
+ libgsl-dev
Standards-Version: 3.9.5
Vcs-Browser: http://anonscm.debian.org/viewvc/debian-science/packages/R/trunk/packages/r-cran-gsl/trunk/
Vcs-Svn: svn://anonscm.debian.org/debian-science/packages/R/trunk/packages/r-cran-gsl/trunk/
diff -Nru r-cran-gsl-1.9-10/debian/patches/gsl-2.patch r-cran-gsl-1.9-10/debian/patches/gsl-2.patch
--- r-cran-gsl-1.9-10/debian/patches/gsl-2.patch 1970-01-01 01:00:00.000000000 +0100
+++ r-cran-gsl-1.9-10/debian/patches/gsl-2.patch 2015-12-03 16:41:16.000000000 +0100
@@ -0,0 +1,116 @@
+Description: Add support for GSL (taken from upstream release 1.9-10.1)
+Origin: https://cran.r-project.org/src/contrib/gsl_1.9-10.1.tar.gz
+Bug-Debian: https://bugs.debian.org/805829
+
+--- a/MD5
++++ b/MD5
+@@ -35,8 +35,8 @@ f2606a5708629a1b4ebc401b857ba00d *R/psi.
+ db9a953c82fb5bcad9aee1bc7c6c053a *R/zzz.R
+ c49ad1d44c0b69af5e210633fcaddcf6 *build/vignette.rds
+ 67c9db5dc1a8e12ccf5880ffe206ce56 *cleanup
+-98d0b4377dad6dcd1014786f247027b5 *configure
+-afdb66942750b3ac5417d2484e59bbfe *configure.ac
++9a9891f695e4676eb2f69fb50f393f57 *configure
++b0a09ce66804c989dc28f289db46011c *configure.ac
+ 4f92f503d9c4f423a6e89a9eaf63b63a *inst/CITATION
+ e2b59fe3fff2bcb30599893a7e590f33 *inst/doc/gslpaper.R
+ 3301d42c84eae58199688edf0b89e67b *inst/doc/gslpaper.Rnw
+@@ -83,7 +83,7 @@ f58e8ead369ee94387edc38f1330ada1 *src/co
+ b9e67aa3572a60fc8cfe5651d386a251 *src/dawson.c
+ 07b6bc201b1956c4a5dd90172fdb6cb2 *src/debye.c
+ 5b5cabf6031c19224e7e7ef4ac9e2b6a *src/dilog.c
+-e8e7cb31ab73cc4f04402445d607965a *src/ellint.c
++ca96b38cdc06b5c35fee02b26b2bff4d *src/ellint.c
+ bb037c708bd7e7ba735b83b8f5166e0a *src/elljac.c
+ 803c371059fc2b48262c6a611f10e48e *src/error.c
+ 23e873053f5e1544a259ef8444d268f8 *src/expint.c
+@@ -93,7 +93,7 @@ f183cb92f62f2132ebcd6c6e87dadbe9 *src/fe
+ 42f6f901e8451ca0b1aa6c24b292a3b8 *src/hyperg.c
+ dfa461e5ad77313a206f82f677ee3cac *src/laguerre.c
+ 5c539738e044a51c33f3916873543392 *src/lambert.c
+-1fe19b728d6a3eb673d94d95ce5e0347 *src/legendre.c
++4c21539636e69450c7ab4da6684dc7c9 *src/legendre.c
+ a60c1c9bc368e9c50a8545aab6ca67bc *src/log.c
+ 8768413013d9891c716a3fe0f60826bd *src/multimin.c
+ d108215b94072249889c251a8e9e6f37 *src/poly.c
+--- a/configure
++++ b/configure
+@@ -2635,7 +2635,7 @@ int main() {
+ if ((sscanf(gslv, "%d.%d", &major, &minor)) != 2) {
+ exit (1);
+ }
+- exit (minor < 12);
++ exit (major == 1 && minor < 12);
+ #else
+ exit(1);
+ #endif
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,7 +33,7 @@ int main() {
+ if ((sscanf(gslv, "%d.%d", &major, &minor)) != 2) {
+ exit (1);
+ }
+- exit (minor < 12);
++ exit (major == 1 && minor < 12);
+ #else
+ exit(1);
+ #endif
+--- a/src/ellint.c
++++ b/src/ellint.c
+@@ -1,3 +1,4 @@
++#include <gsl/gsl_version.h>
+ #include <gsl/gsl_sf_ellint.h>
+ #include <gsl/gsl_errno.h>
+
+@@ -79,7 +80,11 @@ void ellint_D_e(double *phi, double *k,
+ gsl_set_error_handler_off();
+
+ for(i = 0; i< *nk ; i++){
++#if defined(GSL_MAJOR_VERSION) && GSL_MAJOR_VERSION >= 2
++ status[i] = gsl_sf_ellint_D_e(phi[i], k[i], sf_mode[*mode], &result) ;
++#else
+ status[i] = gsl_sf_ellint_D_e(phi[i], k[i], n[i], sf_mode[*mode], &result) ;
++#endif
+ val[i] = result.val;
+ err[i] = result.err;
+ }
+--- a/src/legendre.c
++++ b/src/legendre.c
+@@ -1,3 +1,5 @@
++#include <stdlib.h> // for size_t
++#include <gsl/gsl_version.h>
+ #include <gsl/gsl_sf_legendre.h>
+ #include <gsl/gsl_errno.h>
+
+@@ -182,6 +184,7 @@ void legendre_Plm_e(int *l, int *m, doub
+ }
+ }
+
++#if ((GSL_MAJOR_VERSION < 2) || (GSL_MAJOR_VERSION == 2 && GSL_MINOR_VERSION == 0))
+ void legendre_Plm_array(int *lmax, int *m, double* x, int* len, double* out, int* status)
+ {
+ int i;
+@@ -191,6 +194,7 @@ void legendre_Plm_array(int *lmax, int *
+ status[i] = gsl_sf_legendre_Plm_array(*lmax, *m, x[i], out+i*(*lmax- *m +1));
+ }
+ }
++#endif
+
+ void legendre_sphPlm(int *l, int *m, double *x, int *len, double *out)
+ {
+@@ -214,6 +218,7 @@ void legendre_sphPlm_e(int *l, int *m, d
+ }
+ }
+
++#if ((GSL_MAJOR_VERSION < 2) || (GSL_MAJOR_VERSION == 2 && GSL_MINOR_VERSION == 0))
+ void legendre_sphPlm_array(int *lmax, int *m, double* x, int* len, double* out, int* status)
+ {
+ int i;
+@@ -223,6 +228,7 @@ void legendre_sphPlm_array(int *lmax, in
+ status[i] = gsl_sf_legendre_Plm_array(*lmax, *m, x[i], out+i*(*lmax- *m +1));
+ }
+ }
++#endif
+
+ void conicalP_half_e(double *lambda, double *x, int *len, double *val, double *err, int *status)
+ {
diff -Nru r-cran-gsl-1.9-10/debian/patches/series r-cran-gsl-1.9-10/debian/patches/series
--- r-cran-gsl-1.9-10/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ r-cran-gsl-1.9-10/debian/patches/series 2015-12-03 16:40:24.000000000 +0100
@@ -0,0 +1 @@
+gsl-2.patch
More information about the debian-science-maintainers
mailing list