From b8f6fbd9c6cefd262448404bc9c274857d6485c1 Mon Sep 17 00:00:00 2001 From: David Spencer Date: Wed, 18 Nov 2015 23:45:32 +0000 Subject: academic/root: Patched for gsl-2.1. Signed-off-by: David Spencer --- academic/root/root.SlackBuild | 3 +++ academic/root/root_gsl2.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 academic/root/root_gsl2.patch diff --git a/academic/root/root.SlackBuild b/academic/root/root.SlackBuild index aaed68d9ef..0a182993d8 100644 --- a/academic/root/root.SlackBuild +++ b/academic/root/root.SlackBuild @@ -98,6 +98,9 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Fix building with gsl-2.1 +patch -p1 < $CWD/root_gsl2.patch + # Make sure we use system libs and headers rm -r graf3d/ftgl/{inc,src} || die rm -r graf2d/freetype/src || die diff --git a/academic/root/root_gsl2.patch b/academic/root/root_gsl2.patch new file mode 100644 index 0000000000..8f049d7e03 --- /dev/null +++ b/academic/root/root_gsl2.patch @@ -0,0 +1,42 @@ +diff -u -r root/math/mathmore/src/GSLMultiFit.h root-patched/math/mathmore/src/GSLMultiFit.h +--- root/math/mathmore/src/GSLMultiFit.h 2015-06-23 16:56:20.000000000 +0100 ++++ root-patched/math/mathmore/src/GSLMultiFit.h 2015-11-18 22:30:54.300681289 +0000 +@@ -32,6 +32,7 @@ + #include "gsl/gsl_multifit_nlin.h" + #include "gsl/gsl_blas.h" + #include "GSLMultiFitFunctionWrapper.h" ++#include + + #include "Math/IFunction.h" + #include +@@ -139,7 +140,14 @@ + /// gradient value at the minimum + const double * Gradient() const { + if (fSolver == 0) return 0; +- gsl_multifit_gradient(fSolver->J, fSolver->f,fVec); ++#if GSL_MAJOR_VERSION >=2 ++ gsl_matrix *J=gsl_matrix_alloc(fSolver->fdf->n, fSolver->fdf->p); ++ gsl_multifit_fdfsolver_jac (fSolver, J); ++ gsl_multifit_gradient(J, fSolver->f, fVec); ++ gsl_matrix_free(J); ++#else ++ gsl_multifit_gradient(fSolver->J, fSolver->f, fVec); ++#endif + return fVec->data; + } + +@@ -150,7 +158,14 @@ + unsigned int npar = fSolver->fdf->p; + fCov = gsl_matrix_alloc( npar, npar ); + static double kEpsrel = 0.0001; ++#if GSL_MAJOR_VERSION >=2 ++ gsl_matrix *J=gsl_matrix_alloc(fSolver->fdf->n, fSolver->fdf->p); ++ gsl_multifit_fdfsolver_jac (fSolver, J); ++ int ret = gsl_multifit_covar(J, kEpsrel, fCov); ++ gsl_matrix_free(J); ++#else + int ret = gsl_multifit_covar(fSolver->J, kEpsrel, fCov); ++#endif + if (ret != GSL_SUCCESS) return 0; + return fCov->data; + } -- cgit v1.2.3