[146292] trunk/dports/science/kst
nicos at macports.org
nicos at macports.org
Thu Mar 3 08:15:19 PST 2016
Revision: 146292
https://trac.macports.org/changeset/146292
Author: nicos at macports.org
Date: 2016-03-03 08:15:19 -0800 (Thu, 03 Mar 2016)
Log Message:
-----------
kst: fix compilation with gsl2 (ticket #50764)
Modified Paths:
--------------
trunk/dports/science/kst/Portfile
Added Paths:
-----------
trunk/dports/science/kst/files/patch-gsl2.diff
Modified: trunk/dports/science/kst/Portfile
===================================================================
--- trunk/dports/science/kst/Portfile 2016-03-03 14:09:54 UTC (rev 146291)
+++ trunk/dports/science/kst/Portfile 2016-03-03 16:15:19 UTC (rev 146292)
@@ -26,7 +26,10 @@
cmake.out_of_source yes
#Not using fixup_bundle from cmake
-patchfiles patch-CMakeLists.diff
+#Also fixing compilation with GSL2. Reported at
+#https://bugs.kde.org/show_bug.cgi?id=355324
+patchfiles patch-CMakeLists.diff \
+ patch-gsl2.diff
depends_lib port:gsl \
port:cfitsio \
Added: trunk/dports/science/kst/files/patch-gsl2.diff
===================================================================
--- trunk/dports/science/kst/files/patch-gsl2.diff (rev 0)
+++ trunk/dports/science/kst/files/patch-gsl2.diff 2016-03-03 16:15:19 UTC (rev 146292)
@@ -0,0 +1,158 @@
+Only in ../Kst-2.0.8-orig: build
+Only in .: patch-gsl2.diff
+diff -ur ../Kst-2.0.8-orig/src/plugins/fits/non_linear.h ./src/plugins/fits/non_linear.h
+--- ../Kst-2.0.8-orig/src/plugins/fits/non_linear.h 2014-02-13 18:41:44.000000000 +0900
++++ ./src/plugins/fits/non_linear.h 2016-03-04 00:34:31.000000000 +0900
+@@ -177,37 +177,45 @@
+ }
+ iIterations++;
+ } while( iStatus == GSL_CONTINUE && iIterations < MAX_NUM_ITERATIONS );
+- gsl_multifit_covar( pSolver->J, 0.0, pMatrixCovariance );
+-
+- //
+- // determine the fitted values...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- dXInitial[i] = gsl_vector_get( pSolver->x, i );
+- }
+-
+- for( i=0; i<iLength; i++ ) {
+- vectorOutYFitted->value()[i] = function_calculate( pInputX[i], dXInitial );
+- vectorOutYResiduals->value()[i] = pInputY[i] - vectorOutYFitted->value()[i];
++
++
++ gsl_matrix *J = gsl_matrix_alloc(pSolver->fdf->n, pSolver->fdf->p);
++ if (J != NULL) {
++ gsl_multifit_fdfsolver_jac(pSolver, J);
++
++ gsl_multifit_covar( J, 0.0, pMatrixCovariance );
++
++ //
++ // determine the fitted values...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ dXInitial[i] = gsl_vector_get( pSolver->x, i );
++ }
++
++ for( i=0; i<iLength; i++ ) {
++ vectorOutYFitted->value()[i] = function_calculate( pInputX[i], dXInitial );
++ vectorOutYResiduals->value()[i] = pInputY[i] - vectorOutYFitted->value()[i];
++ }
++
++ //
++ // fill in the parameter values and covariance matrix...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
++ for( j=0; j<NUM_PARAMS; j++ ) {
++ vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
++ }
++ }
++
++ //
++ // determine the value of chi^2/nu
++ //
++ scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
++
++ bReturn = true;
++
++ gsl_matrix_free( J );
+ }
+-
+- //
+- // fill in the parameter values and covariance matrix...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
+- for( j=0; j<NUM_PARAMS; j++ ) {
+- vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
+- }
+- }
+-
+- //
+- // determine the value of chi^2/nu
+- //
+- scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
+-
+- bReturn = true;
+-
+ gsl_matrix_free( pMatrixCovariance );
+ }
+ gsl_multifit_fdfsolver_free( pSolver );
+diff -ur ../Kst-2.0.8-orig/src/plugins/fits/non_linear_weighted.h ./src/plugins/fits/non_linear_weighted.h
+--- ../Kst-2.0.8-orig/src/plugins/fits/non_linear_weighted.h 2014-02-13 18:41:44.000000000 +0900
++++ ./src/plugins/fits/non_linear_weighted.h 2016-03-04 00:37:41.000000000 +0900
+@@ -193,37 +193,43 @@
+ }
+ while( iStatus == GSL_CONTINUE && iIterations < MAX_NUM_ITERATIONS );
+
+- gsl_multifit_covar( pSolver->J, 0.0, pMatrixCovariance );
+-
+- //
+- // determine the fitted values...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- dXInitial[i] = gsl_vector_get( pSolver->x, i );
+- }
+-
+- for( i=0; i<iLength; i++ ) {
+- vectorOutYFitted->value()[i] = function_calculate( pInputs[XVALUES][i], dXInitial );
+- vectorOutYResiduals->value()[i] = pInputs[YVALUES][i] - vectorOutYFitted->value()[i];
+- }
+-
+- //
+- // fill in the parameter values and covariance matrix...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
+- for( j=0; j<NUM_PARAMS; j++ ) {
+- vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
+- }
++ gsl_matrix *J = gsl_matrix_alloc(pSolver->fdf->n, pSolver->fdf->p);
++ if (J != NULL) {
++ gsl_multifit_fdfsolver_jac(pSolver, J);
++
++ gsl_multifit_covar( J, 0.0, pMatrixCovariance );
++
++ //
++ // determine the fitted values...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ dXInitial[i] = gsl_vector_get( pSolver->x, i );
++ }
++
++ for( i=0; i<iLength; i++ ) {
++ vectorOutYFitted->value()[i] = function_calculate( pInputs[XVALUES][i], dXInitial );
++ vectorOutYResiduals->value()[i] = pInputs[YVALUES][i] - vectorOutYFitted->value()[i];
++ }
++
++ //
++ // fill in the parameter values and covariance matrix...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
++ for( j=0; j<NUM_PARAMS; j++ ) {
++ vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
++ }
++ }
++
++ //
++ // determine the value of chi^2/nu
++ //
++ scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
++
++ bReturn = true;
++
++ gsl_matrix_free( J );
+ }
+-
+- //
+- // determine the value of chi^2/nu
+- //
+- scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
+-
+- bReturn = true;
+-
+ gsl_matrix_free( pMatrixCovariance );
+ }
+ gsl_multifit_fdfsolver_free( pSolver );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160303/b63cff2c/attachment-0001.html>
More information about the macports-changes
mailing list