Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compilation against GSL 2.3 & 2.4 succeed #141

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 3 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ E: ambs@cpan.org
N: Bartosz Jakubski
U: bjakubski

N: Diab Jerius
U: djerius
E: djerius@cpan.org

=cut
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 20 additions & 4 deletions _travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

48 changes: 48 additions & 0 deletions inc/ver2func
Original file line number Diff line number Diff line change
Expand Up @@ -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$
/],
};
2 changes: 0 additions & 2 deletions swig/BSpline.i
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions swig/Integration.i
Original file line number Diff line number Diff line change
Expand Up @@ -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"
17 changes: 14 additions & 3 deletions t/Diff.t
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}



Expand Down