Bug#805801: mathgl: Fails to build with GSL 2

Sebastiaan Couwenberg sebastic at xs4all.nl
Thu Dec 3 16:43:37 UTC 2015


Control: tags -1 patch fixed-upstream

On 22-11-15 18:36, Bas Couwenberg wrote:
> Your package fails to build with GSL 2:
> 
>  /tmp/buildd/mathgl-2.3.3/src/fit.cpp: In function 'mreal mgl_fit_base(mglFitData&, mreal*)':
>  /tmp/buildd/mathgl-2.3.3/src/fit.cpp:196:25: error: 'struct gsl_multifit_fdfsolver' has no member named 'J'
>    gsl_multifit_covar (s->J, 0.0, covar );
>                           ^
> 
> This needs to be fixed for the ongoing gsl transition (#804246).

GSL 2 compatibility was recently fixed upstream in:

 http://sourceforge.net/p/mathgl/code/1216/

The attached debdiff includes the GSL related changes from upstream
r1216 and updated build dependencies.

With the gsl-2.patch applied, the package still FTBFS due to #803312.

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
-------------- next part --------------
diff -Nru mathgl-2.3.3/debian/changelog mathgl-2.3.3/debian/changelog
--- mathgl-2.3.3/debian/changelog	2015-10-05 20:53:57.000000000 +0200
+++ mathgl-2.3.3/debian/changelog	2015-12-03 17:09:53.000000000 +0100
@@ -1,3 +1,11 @@
+mathgl (2.3.3-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Update build dependencies for GSL 2, change libgsl0-dev to libgsl-dev.
+  * Add patch for GSL 2.x support.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 22 Nov 2015 18:19:31 +0100
+
 mathgl (2.3.3-3) unstable; urgency=medium
 
   * Disable need for C++11 support (Closes: #800460)
diff -Nru mathgl-2.3.3/debian/control mathgl-2.3.3/debian/control
--- mathgl-2.3.3/debian/control	2015-08-29 06:48:36.000000000 +0200
+++ mathgl-2.3.3/debian/control	2015-11-22 18:19:30.000000000 +0100
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
 Uploaders: Dimitrios Eftaxiopoulos <eftaxi12 at otenet.gr>
-Build-Depends: debhelper (>= 9), libltdl-dev, libgsl0-dev, freeglut3-dev,
+Build-Depends: debhelper (>= 9), libltdl-dev, libgsl-dev, freeglut3-dev,
  libgl1-mesa-dev | libgl-dev, libpng-dev, libhdf5-dev, libqt5opengl5-dev,
  libjpeg-dev, libtiff-dev, libfltk1.3-dev, libqt5webkit5-dev, libwxgtk3.0-dev, 
  texinfo, texlive, texlive-generic-recommended, liblua5.1-dev, libxcursor-dev,
@@ -201,7 +201,7 @@
 Depends: libmgl7.4.0 (= ${binary:Version}), libmgl-wnd7.4.0 (= ${binary:Version}),
  libmgl-wx7.4.0 (= ${binary:Version}), libmgl-fltk7.4.0 (= ${binary:Version}),
  libmgl-qt7.4.0 (= ${binary:Version}), libmgl-glut7.4.0 (= ${binary:Version}),
- libmgl-mpi7.4.0 (= ${binary:Version}), ${misc:Depends}, libgsl0-dev, 
+ libmgl-mpi7.4.0 (= ${binary:Version}), ${misc:Depends}, libgsl-dev, 
  libgl1-mesa-dev | libgl-dev, libpng-dev
 Description: library for scientific graphs (development files)
  A free cross-platform library of fast C++ routines for plotting data in up
@@ -223,4 +223,4 @@
  MathGL can also be used in the console. There are interfaces to a set of
  languages, such as, C, Fortran, Pascal, Forth, Python, Octave.
  .
- This package provides the Python module for mathgl.
\ No newline at end of file
+ This package provides the Python module for mathgl.
diff -Nru mathgl-2.3.3/debian/patches/gsl-2.patch mathgl-2.3.3/debian/patches/gsl-2.patch
--- mathgl-2.3.3/debian/patches/gsl-2.patch	1970-01-01 01:00:00.000000000 +0100
+++ mathgl-2.3.3/debian/patches/gsl-2.patch	2015-12-03 17:25:16.000000000 +0100
@@ -0,0 +1,59 @@
+Description: Add support for GSL 2.x.
+Origin: http://sourceforge.net/p/mathgl/code/1216/
+Bug-Debian: https://bugs.debian.org/805801
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -259,6 +259,13 @@ endif(enable-pthread)
+ 
+ if(enable-gsl)
+ 	set(MGL_HAVE_GSL 1)
++	FIND_PACKAGE(PkgConfig)
++	pkg_check_modules(GSL2 REQUIRED gsl)
++	if(GSL2_FOUND)
++		if ( NOT ${GSL2_VERSION} LESS 2.0)
++			SET(MGL_HAVE_GSL2 1)
++		endif ( NOT ${GSL2_VERSION} LESS 2.0)
++	endif ( GSL2_FOUND )
+ 	find_library(GSL_LIB gsl)
+ 	find_library(GSL_CBLAS_LIB gslcblas)
+ 	find_path(GSL_INCLUDE_DIR gsl/gsl_fft_complex.h)
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -23,6 +23,9 @@ ${MathGL_BINARY_DIR}/include/mgl2/dllexp
+ )
+ 
+ add_definitions(-DMGL_SRC)
++if(MGL_HAVE_GSL2)
++	add_definitions(-DMGL_HAVE_GSL2)
++endif(MGL_HAVE_GSL2)
+ 
+ if(MGL_HAVE_PNG)
+ 	set(prc_src prc/PRCbitStream.cc prc/PRCdouble.cc prc/oPRCFile.cc prc/writePRC.cc prc.cpp )
+--- a/src/fit.cpp
++++ b/src/fit.cpp
+@@ -192,14 +192,23 @@ mreal MGL_NO_EXPORT mgl_fit_base(mglFitD
+ 		status = gsl_multifit_test_delta (s->dx, s->x, 1e-4, 1e-4 );
+ 	}
+ 	while ( status == GSL_CONTINUE && iter < 500 );
++
+ 	gsl_matrix *covar = gsl_matrix_alloc(m, m);
++#ifdef MGL_HAVE_GSL2
++	gsl_matrix *J = gsl_matrix_alloc(s->fdf->n, s->fdf->p);
++	gsl_multifit_fdfsolver_jac(s, J);
++	gsl_multifit_covar (J, 0.0, covar);
++	gsl_matrix_free (J);
++#else
+ 	gsl_multifit_covar (s->J, 0.0, covar );
++#endif
+ 	mglFitCovar.Set(covar);
++	gsl_matrix_free (covar);
++
+ 	mreal res = gsl_blas_dnrm2(s->f);
+ 	for(i=0;i<m;i++)	ini[i] = gsl_vector_get(s->x, i);
+ 	// free memory
+ 	gsl_multifit_fdfsolver_free (s);
+-	gsl_matrix_free (covar);
+ 	delete []x_init;
+ 	return res;
+ #else
diff -Nru mathgl-2.3.3/debian/patches/series mathgl-2.3.3/debian/patches/series
--- mathgl-2.3.3/debian/patches/series	2015-09-05 21:08:44.000000000 +0200
+++ mathgl-2.3.3/debian/patches/series	2015-12-03 17:01:32.000000000 +0100
@@ -1,3 +1,4 @@
 CMakeLists.patch
 udav.patch
 utils.patch
+gsl-2.patch


More information about the debian-science-maintainers mailing list