diff --git a/.travis.yml b/.travis.yml index bde287f..ae9a2fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ cache: - ccache - apt - directories: + - /tmp/gsl-2.4 + - /tmp/gsl-2.3 - /tmp/gsl-2.2.1 - /tmp/gsl-2.0 - /tmp/gsl-2.1 @@ -29,6 +31,8 @@ env: - CCACHE_CPP2=1 - CC="ccache clang" matrix: + - GSL=2.4 + - GSL=2.3 - GSL=2.2.1 - GSL=2.1 - GSL=2.0 @@ -50,7 +54,7 @@ before_install: ./_travis/before_install.sh # Add verbosity for debugging install: # this should always point to the version we build the CPAN dist with - - PATH=/tmp/gsl-2.2.1/bin:$PATH cpanm --installdeps --notest . &> /dev/null + - PATH=/tmp/gsl-4/bin:$PATH cpanm --installdeps --notest . &> /dev/null before_script: - ulimit -c unlimited -S # enable core dumps diff --git a/Build.PL b/Build.PL index 59fc6f1..11e37b4 100644 --- a/Build.PL +++ b/Build.PL @@ -56,7 +56,7 @@ $ccflags .= try_cflags("-Wno-unused-variable"); $ccflags .= try_cflags("-Wno-gnu"); $ccflags .= try_cflags("-g"); -$swig_flags = "$gsl_conf->{gsl_cflags} $swig_flags"; +$swig_flags = "$gsl_conf->{gsl_cflags} $swig_flags -DGSL_DISABLE_DEPRECATED"; if ( GSLBuilder::is_cygwin() && $Config{shrpenv} =~ m{\Aenv LD_RUN_PATH=(.*)\Z} ) { $ldflags .= " -L$1 -lperl"; diff --git a/CREDITS b/CREDITS index 910ee5c..a693dfb 100644 --- a/CREDITS +++ b/CREDITS @@ -38,5 +38,8 @@ E: ambs@cpan.org N: Bartosz Jakubski U: bjakubski +N: Diab Jerius +U: djerius +E: djerius@cpan.org =cut diff --git a/Changes b/Changes index b7e3394..e00ade0 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ =head1 Math::GSL Changes + - compiles against GSL 2.3 and GSL 2.4 + - added Math::GSL::Multiset (standard gsl API and Perl OO) =head1 v0.40 - ??? 2016 diff --git a/_travis/before_install.sh b/_travis/before_install.sh index 9a10cde..d55bcc2 100755 --- a/_travis/before_install.sh +++ b/_travis/before_install.sh @@ -19,6 +19,9 @@ get_gsl () { } _get_master_gsl () { + + rmdir "gsl-master" && echo "removed empty gsl-master directory" + if [ ! -d "gsl-master" ]; then git clone git://git.savannah.gnu.org/gsl.git gsl-master cd gsl-master @@ -52,13 +55,26 @@ get_gsl 1.16 get_gsl 2.0 get_gsl 2.1 get_gsl 2.2.1 +get_gsl 2.3 +get_gsl 2.4 get_master_gsl +GSL_CURRENT_DIR=/tmp/gsl-2.4 + ls -la /tmp/ -ls -la /tmp/gsl-2.2.1/bin -cd /home/travis/build/leto/math--gsl -LD_LIBRARY_PATH=/tmp/gsl-2.2.1/lib:$LD_LIBRARY_PATH PATH=/tmp/gsl-2.2.1/bin:$PATH perl Build.PL && ./Build && ./Build dist # create a CPAN dist with latest supported GSL release +ls -la $GSL_CURRENT_DIR/bin +cd $TRAVIS_BUILD_DIR +export LD_LIBRARY_PATH=$GSL_CURRENT_DIR/lib:$LD_LIBRARY_PATH +export PATH=$GSL_CURRENT_DIR/bin:$PATH + +# create a CPAN dist with latest supported GSL release +perl Build.PL \ + && ./Build \ + && ./Build dist + cp Math-GSL*.tar.gz /tmp -ls -la /tmp/Math-GSL*.tar.gz # now we have a CPAN dist to test on each version of GSL + +# now we have a CPAN dist to test on each version of GSL +ls -la /tmp/Math-GSL*.tar.gz cd $ORIG_DIR diff --git a/inc/ver2func b/inc/ver2func index ecac109..8052192 100644 --- a/inc/ver2func +++ b/inc/ver2func @@ -119,4 +119,52 @@ return { "2.2.1" => [qw/ ^gsl_linalg_cholesky_decomp1$ /], + "2.3" => [qw/ + ^gsl_multifit_linear_tsvd$ + ^gsl_multifit_linear_rank$ + ^gsl_multifit_wlinear_tsvd$ + ^gsl_multifit_linear_gcv_init$ + ^gsl_multifit_linear_gcv_curve$ + ^gsl_multifit_linear_gcv_min$ + ^gsl_multifit_linear_gcv_calc$ + ^gsl_multifit_linear_gcv$ + /], + "2.4" => [qw/ + ^gsl_integration_fixed_n$ + ^gsl_integration_fixed_nodes$ + ^gsl_integration_fixed_weights$ + ^gsl_integration_fixed$ + ^gsl_linalg_COD_lssolve2$ + ^gsl_sf_hermite_prob_e$ + ^gsl_sf_hermite_prob$ + ^gsl_sf_hermite_prob_der_e$ + ^gsl_sf_hermite_prob_der$ + ^gsl_sf_hermite_phys_e$ + ^gsl_sf_hermite_phys$ + ^gsl_sf_hermite_phys_der_e$ + ^gsl_sf_hermite_phys_der$ + ^gsl_sf_hermite_func_e$ + ^gsl_sf_hermite_func$ + ^gsl_sf_hermite_prob_array$ + ^gsl_sf_hermite_prob_array_der$ + ^gsl_sf_hermite_prob_der_array$ + ^gsl_sf_hermite_prob_series_e$ + ^gsl_sf_hermite_prob_series$ + ^gsl_sf_hermite_phys_array$ + ^gsl_sf_hermite_phys_array_der$ + ^gsl_sf_hermite_phys_der_array$ + ^gsl_sf_hermite_phys_series_e$ + ^gsl_sf_hermite_phys_series$ + ^gsl_sf_hermite_func_array$ + ^gsl_sf_hermite_func_series_e$ + ^gsl_sf_hermite_func_series$ + ^gsl_sf_hermite_func_der_e$ + ^gsl_sf_hermite_func_der$ + ^gsl_sf_hermite_prob_zero_e$ + ^gsl_sf_hermite_prob_zero$ + ^gsl_sf_hermite_phys_zero_e$ + ^gsl_sf_hermite_phys_zero$ + ^gsl_sf_hermite_func_zero_e$ + ^gsl_sf_hermite_func_zero$ + /], }; diff --git a/swig/BSpline.i b/swig/BSpline.i index d6ac32d..6b20ba0 100644 --- a/swig/BSpline.i +++ b/swig/BSpline.i @@ -3,8 +3,6 @@ %include "gsl_typemaps.i" %include "renames.i" -#define GSL_DISABLE_DEPRECATED 1 - %include "gsl/gsl_math.h" %include "gsl/gsl_vector.h" %include "gsl/gsl_bspline.h" diff --git a/swig/Integration.i b/swig/Integration.i index 0272059..aa02130 100644 --- a/swig/Integration.i +++ b/swig/Integration.i @@ -4,9 +4,16 @@ %include "renames.i" %{ + #ifndef GSL_VAR + #include "gsl/gsl_types.h" + #endif + #include "gsl/gsl_integration.h" #include "gsl/gsl_math.h" %} +#ifndef GSL_VAR +%include "gsl/gsl_types.h" +#endif %include "gsl/gsl_integration.h" %include "gsl/gsl_math.h" %include "../pod/Integration.pod" diff --git a/t/Diff.t b/t/Diff.t index a863597..c2cb59c 100644 --- a/t/Diff.t +++ b/t/Diff.t @@ -13,19 +13,30 @@ sub make_fixture : Test(setup) { sub teardown : Test(teardown) { } -sub TEST_DIFF_CENTRAL : Tests { +sub TEST_DIFF_CENTRAL : Tests { + + if ( !defined &{\&gsl_diff_central} ) { + $_[0]->builder->skip( "gsl_diff_central not found" ); + return; + } + my ($success, $result, $error) = gsl_diff_central(sub { return $_[0]**(1.5)}, 2.0); ok_similar($result, 2.1213203435, "Testing Result"); ok_similar($error, 0.01490, "Testing Error", 0.00001); - } sub TEST_DIFF_FORWARD : Tests { + + if ( !defined &{\&gsl_diff_forward} ) { + $_[0]->builder->skip( "gsl_diff_forward not found" ); + return; + } + my ($success, $result, $error) = gsl_diff_forward(sub { return $_[0]**(1.5)}, 0.0); ok_similar($result, 0.0012172897, "Testing Result"); ok_similar($error, 0.05028, "Testing Error", 0.00001); -} +}