From 6b1150c571527d16d1e4853614b7ae0343553d83 Mon Sep 17 00:00:00 2001 From: Yury Zavarin Date: Thu, 7 Jul 2011 20:31:14 +0400 Subject: [PATCH] build swig wrappers for different versions of GSL (1.11 - 1.15) --- .gitignore | 3 + Build.PL | 34 +++++----- MANIFEST.SKIP | 2 + README | 2 +- inc/GSLBuilder.pm | 148 ++++++++++++++++++++++++++++++------------- inc/ver2func | 41 ++++++++++++ pod/Diff.pod | 47 ++++++++++++++ swig/BLAS.i | 1 + swig/BSpline.i | 1 + swig/CBLAS.i | 1 + swig/CDF.i | 2 + swig/Chebyshev.i | 2 + swig/Combination.i | 2 + swig/Complex.i | 2 + swig/Const.i | 1 + swig/DHT.i | 1 + swig/Deriv.i | 1 + swig/Diff.i | 12 +--- swig/Eigen.i | 2 + swig/Errno.i | 2 + swig/FFT.i | 2 + swig/Fit.i | 1 + swig/Heapsort.i | 1 + swig/Histogram.i | 1 + swig/Histogram2D.i | 1 + swig/IEEEUtils.i | 2 + swig/Integration.i | 1 + swig/Interp.i | 1 + swig/Linalg.i | 1 + swig/Machine.i | 1 + swig/Matrix.i | 2 + swig/MatrixComplex.i | 2 + swig/Min.i | 2 + swig/Monte.i | 1 + swig/Multifit.i | 2 + swig/Multimin.i | 2 + swig/Multiroots.i | 1 + swig/NTuple.i | 1 + swig/ODEIV.i | 2 + swig/Permutation.i | 1 + swig/Poly.i | 1 + swig/PowInt.i | 2 + swig/QRNG.i | 1 + swig/RNG.i | 2 + swig/Randist.i | 1 + swig/Roots.i | 2 + swig/SF.i | 1 + swig/Siman.i | 2 + swig/Sort.i | 1 + swig/Spline.i | 2 + swig/Statistics.i | 1 + swig/Sum.i | 1 + swig/Sys.i | 2 + swig/Vector.i | 1 + swig/VectorComplex.i | 1 + swig/Wavelet.i | 2 + swig/Wavelet2D.i | 1 + 57 files changed, 289 insertions(+), 70 deletions(-) create mode 100644 inc/ver2func create mode 100644 pod/Diff.pod diff --git a/.gitignore b/.gitignore index cc02cc1..1fb195a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*~ +pm .gitignore *.core core @@ -16,6 +18,7 @@ foo* tags .DS_Store xs/*_wrap.c +swig/renames.i swig/system.i .prove Math-GSL-*/ diff --git a/Build.PL b/Build.PL index 2a73474..0c61ac6 100644 --- a/Build.PL +++ b/Build.PL @@ -77,7 +77,7 @@ sub try_compile { my $errno = $? >> 8; local $! = $errno; print " - + *** The test compile of '$tmp.c' failed: status $? *** (the status means: errno = $errno or '$!') *** DO NOT PANIC: this just means that you may get some innocuous @@ -101,26 +101,28 @@ sub try_cflags ($) { } print "no\n"; return ''; - + } print "Checking for GSL.."; my %gsl_pkgcfg = ExtUtils::PkgConfig->find ('gsl'); -my $MIN_GSL_VERSION = "1.8"; +my $MIN_GSL_VERSION = "1.11"; my $gv = $gsl_pkgcfg{'modversion'}; my $current_minor_version; my $path_system = File::Spec->catfile('swig', 'system.i'); open my $fh, ">", "$path_system" or die "Could not create system.i : $!"; +my $current_version; if (defined $gv) { if ($gv =~ m{\A(\d+(?:\.\d+)+)}) { - my @current= split /\./, $1; + $current_version = $1; + my @current = split /\./, $current_version; print $fh "#define GSL_MAJOR_VERSION $current[0]\n"; print $fh "#define GSL_MINOR_VERSION $current[1]\n"; - my @min= split /\./, $MIN_GSL_VERSION; + my @min = split /\./, $MIN_GSL_VERSION; $current_minor_version = $current[1]; unless ($current[0] >= $min[0] && $current[1] >= $min[1]) { printf " @@ -130,7 +132,6 @@ if (defined $gv) { exit 1; } else { print "Found GSL version $gv\n"; - } } else { print " @@ -187,21 +188,19 @@ if ($Config{archname} =~ /x86_64|amd64/ ) { my @Subsystems = grep { ! /^Test$/ } GSLBuilder::subsystems; -# BSplines appeared in 1.9 -if ($current_minor_version < 9 ) { - @Subsystems = grep { ! /BSpline/ } @Subsystems; -} my $cleanup = qq{ - xs/*_wrap.c core *.core swig/system.i - swig/*.o Makefile Math-GSL-* tmp* pod2ht*.tmp _build - lib/Math/GSL/[A-z]+/* blib *.so *.orig + xs/*_wrap*.c core *.core swig/system.i swig/renames.i + swig/*.o Makefile Math-GSL-* tmp* pod2ht*.tmp _build pm + lib/Math/GSL/[A-z]+/* blib *.so *.orig } . join " ", map { catfile( (qw( lib Math GSL ), "$_.pm") ) } @Subsystems; if ($^O ne 'darwin') { $ldflags = '-shared ' . $ldflags; } -my $builder = GSLBuilder->new( +my $ver2func = do("inc/ver2func"); + +my $builder = GSLBuilder->new( module_name => 'Math::GSL', add_to_cleanup => [ $cleanup ], create_makefile_pl => 'passthrough', @@ -211,7 +210,7 @@ my $builder = GSLBuilder->new( include_dirs => [], extra_linker_flags => $ldflags, extra_compiler_flags=> "$ccflags " . ($ENV{CC_FLAGS}||''), - swig_flags => $swig_flags, + swig_flags => $swig_flags, license => 'gpl', build_requires => { 'Test::Most' => 0, @@ -229,9 +228,12 @@ my $builder = GSLBuilder->new( 'ExtUtils::PkgConfig' => '1.03', }, swig_source => [ - map { [ "swig/$_.i", "pod/$_.pod" ] } @Subsystems , + map { [ "swig/$_.i", ["pod/$_.pod"] ] } @Subsystems , ], + ver2func => $ver2func, + current_version => $current_version, ); $builder->add_build_element('swig'); + $builder->create_build_script(); print "Have a great day!\n"; diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 54bc922..2a151af 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -14,5 +14,7 @@ foo* Math-GSL \.prove swig/system\.i +swig/renames\.i +.*~ ^MYMETA.yml$ META.json diff --git a/README b/README index d94c6e4..db3ee00 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ Scientific Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License. Math::GSL uses SWIG to generate Perl bindings to *most* GSL functionality. -Currently Math::GSL requires at least Perl 5.8 and GSL 1.8 to compile. SWIG +Currently Math::GSL requires at least Perl 5.8 and GSL 1.11 to compile. SWIG is only needed if you want help work on Math::GSL and checkout code from the Math::GSL git repository. diff --git a/inc/GSLBuilder.pm b/inc/GSLBuilder.pm index e5875c5..858a2ba 100644 --- a/inc/GSLBuilder.pm +++ b/inc/GSLBuilder.pm @@ -1,15 +1,18 @@ package GSLBuilder; + +use strict; +use warnings; + use Config; use File::Copy; use File::Path qw/mkpath/; use File::Spec::Functions qw/:ALL/; -use Data::Dumper; use base 'Module::Build'; sub is_release { return -e '.git' ? 0 : 1; } -sub subsystems { +sub subsystems { sort qw/ Diff Machine Statistics BLAS Eigen Matrix Poly MatrixComplex @@ -17,12 +20,12 @@ sub subsystems { CBLAS FFT Min IEEEUtils CDF Fit QRNG Chebyshev Monte RNG Vector - Heapsort Multifit Randist Roots + Heapsort Multifit Randist Roots Combination Histogram Multimin Wavelet Complex Histogram2D Multiroots Wavelet2D Const Siman Sum Sys - NTuple Integration Sort Test - DHT Interp ODEIV SF + NTuple Integration Sort Test + DHT Interp ODEIV SF Deriv Linalg Permutation Spline /; } @@ -31,33 +34,55 @@ sub process_swig_files { my $self = shift; my $p = $self->{properties}; - - return unless $p->{swig_source}; my $files_ref = $p->{swig_source}; + return unless ($files_ref); + + unless (is_release()) { + $self->process_versioned_swig_files; + } foreach my $file (@$files_ref) { - $self->process_swig($file->[0], $file->[1]); + $self->process_xs_file($file->[0]); } } -# Check check dependencies for $main_swig_file. These are the -# %includes. If needed, arrange to run swig on $main_swig_file to -# produce a xxx_wrap.c C file. +sub process_versioned_swig_files { + my $self = shift; -sub process_swig { - my ($self, $main_swig_file, $deps_ref) = @_; - my ($cf, $p) = ($self->{config}, $self->{properties}); + my $p = $self->{properties}; + my $files_ref = $p->{swig_source}; + + my $cur_ver = $p->{current_version}; + my $ver2func = $p->{ver2func}; + foreach my $ver (sort {cmp_versions($a, $b)} keys %{$ver2func}) { + next if (cmp_versions($cur_ver, $ver) == -1); + my @renames; + foreach my $high_ver (keys %{$ver2func}) { + next if (cmp_versions($high_ver, $ver) < 1); + push @renames, @{$ver2func->{$high_ver}}; + } + print "Building wrappers for GSL $ver\n"; + open(my $fh, '>', 'swig/renames.i'); + foreach my $rename (@renames) { + print $fh q{%rename("%(regex:/} . $rename . q{/$ignore/)s") "";} . "\n"; + } + close($fh); + + foreach my $file (@$files_ref) { + $self->process_swig($file->[0], $file->[1], $ver); + } + } + $self->add_to_cleanup('swig/renames.i'); +} + +sub process_xs_file { + my ($self, $main_swig_file) = @_; + + my $ver = $self->{properties}->{current_version}; (my $file_base = $main_swig_file) =~ s/\.[^.]+$//; $file_base =~ s!swig/!!g; - my $c_file = catdir('xs',"${file_base}_wrap.c"); - - my @deps = defined $deps_ref ? @$deps_ref : (); + my $c_file = catfile('xs',"${file_base}_wrap.$ver.c"); - # don't bother with swig if this is a CPAN release - unless ( is_release() ) { - $self->compile_swig($main_swig_file, $c_file) - unless($self->up_to_date( [$main_swig_file, @deps],$c_file)); - } # .c -> .o my $obj_file = $self->compile_c($c_file); $self->add_to_cleanup($obj_file); @@ -67,11 +92,44 @@ sub process_swig { # .o -> .so $self->link_c($archdir, $file_base, $obj_file); + + my $from = catfile(qw/pm Math GSL/, "${file_base}.pm.$ver"); + my $to = catfile(qw/blib lib Math GSL/, "${file_base}.pm"); + chmod 0644, $from, $to; + copy($from, $to); +} + +sub cmp_versions { + my ($v1, $v2) = @_; + my @v1 = split(/\./, $v1); + my @v2 = split(/\./, $v2); + my $cmp_major = $v1[0] <=> $v2[0]; + return $cmp_major if ($cmp_major != 0); + my $cmp_minor = $v1[1] <=> $v2[1]; + return $cmp_minor; +} + +# Check dependencies for $main_swig_file. These are the +# %includes. If needed, arrange to run swig on $main_swig_file to +# produce a xxx_wrap.c C file. +sub process_swig { + my ($self, $main_swig_file, $deps_ref, $ver) = @_; + my ($cf, $p) = ($self->{config}, $self->{properties}); + + (my $file_base = $main_swig_file) =~ s/\.[^.]+$//; + $file_base =~ s!swig/!!g; + my $c_file = catfile('xs',"${file_base}_wrap.$ver.c"); + + my @deps = defined $deps_ref ? @$deps_ref : (); + + # don't bother with swig if this is a CPAN release + $self->compile_swig($main_swig_file, $c_file, $ver) + unless($self->up_to_date([$main_swig_file, @deps], $c_file)); } # Invoke swig with -perl -outdir and other options. sub compile_swig { - my ($self, $file, $c_file) = @_; + my ($self, $file, $c_file, $ver) = @_; my ($cf, $p) = ($self->{config}, $self->{properties}); # For convenience # File name, minus the suffix @@ -81,26 +139,30 @@ sub compile_swig { $file_base =~ s!swig/!!g; my $pm_file = "${file_base}.pm"; - + my @swig = qw/swig/, defined($p->{swig}) ? ($self->split_like_shell($p->{swig})) : (); my @swig_flags = defined($p->{swig_flags}) ? $self->split_like_shell($p->{swig_flags}) : (); - - my $blib_lib = catfile(qw/blib lib/); - my $gsldir = catfile($blib_lib, qw/Math GSL/); - mkdir $gsldir unless -e $gsldir; - + my $blib_lib = catdir(qw/blib lib/); + my $gsldir = catdir('pm', qw/Math GSL/); + mkpath $gsldir unless -e $gsldir; + my $from = catfile($gsldir, $pm_file); - my $to = catfile(qw/lib Math GSL/,$pm_file); + my $to = catfile(qw/lib Math GSL/, $pm_file); chmod 0644, $from, $to; $self->do_system(@swig, '-o', $c_file , - '-outdir', $gsldir, + '-outdir', $gsldir, '-perl5', @swig_flags, $file) or die "error : $! while building ( @swig_flags ) $c_file in $gsldir from '$file'"; - print "Copying from: $from, to: $to; it makes the CPAN indexer happy.\n"; - copy($from,$to); - return $c_file; + move($from, "$from.$ver"); + + if ($p->{current_version} eq $ver) { + print "Copying from: $from.$ver, to: $to; it makes the CPAN indexer happy.\n"; + copy("$from.$ver", $to); + } + + return $c_file; } sub is_windows { $^O =~ /MSWin32/i } sub is_darwin { $^O =~ /darwin/i } @@ -116,34 +178,34 @@ sub link_c { $self->add_to_cleanup($lib_file); my $objects = $p->{objects} || []; - + unless ($self->up_to_date([$obj_file, @$objects], $lib_file)) { my @linker_flags = $self->split_like_shell($p->{extra_linker_flags}); push @linker_flags, $Config{archlib} . '/CORE/' . $Config{libperl} if (is_windows() or is_darwin()); - my @lddlflags = $self->split_like_shell($cf->{lddlflags}); + my @lddlflags = $self->split_like_shell($cf->{lddlflags}); my @shrp = $self->split_like_shell($cf->{shrpenv}); my @ld = $self->split_like_shell($cf->{ld}) || "gcc"; # Strip binaries if we are compiling on windows push @ld, "-s" if (is_windows() && $Config{cc} eq 'gcc'); - $self->do_system(@shrp, @ld, @lddlflags, @user_libs, '-o', $lib_file , + $self->do_system(@shrp, @ld, @lddlflags, '-o', $lib_file, $obj_file, @$objects, @linker_flags) or die "error building $lib_file file from '$obj_file'"; } - + return $lib_file; } -# From Base.pm but modified to put package cflags *after* +# From Base.pm but modified to put package cflags *after* # installed c flags so warning-removal will have an effect. sub compile_c { my ($self, $file) = @_; my ($cf, $p) = ($self->{config}, $self->{properties}); # For convenience - + # File name, minus the suffix (my $file_base = $file) =~ s/\.[^.]+$//; my $obj_file = $file_base . $Config{_o}; @@ -154,7 +216,7 @@ sub compile_c { $cf->{installarchlib} = $Config{archlib}; - my @include_dirs = @{$p->{include_dirs}} + my @include_dirs = @{$p->{include_dirs}} ? map {"-I$_"} (@{$p->{include_dirs}}, catdir($cf->{installarchlib}, 'CORE')) : map {"-I$_"} ( catdir($cf->{installarchlib}, 'CORE') ) ; @@ -175,10 +237,10 @@ sub compile_c { # it can be added back via @extra_compiler_flags. my @flags = (@include_dirs, @cccdlflags, '-c', @ccflags, @extra_compiler_flags, ); - + my @cc = $self->split_like_shell($cf->{cc}); @cc = "gcc" unless @cc; - + $self->do_system(@cc, @flags, '-o', $obj_file, $file) or die "error building $Config{_o} file from '$file'"; diff --git a/inc/ver2func b/inc/ver2func new file mode 100644 index 0000000..2d8eac2 --- /dev/null +++ b/inc/ver2func @@ -0,0 +1,41 @@ +{ +# "1.8" => [], +# "1.9" => [], +# "1.10" => [], + "1.11" => [], + "1.12" => [qw/ + ^gsl_linalg_cholesky_invert$ + ^gsl_matrix_complex_isnonneg$ + ^gsl_multimin_fminimizer_nmsimplex2.* + ^gsl_sf_exprel_n_CF_e$ + ^gsl_vector_complex_add$ ^gsl_vector_complex_add_constant$ + ^gsl_vector_complex_div$ ^gsl_vector_complex_isnonneg$ + ^gsl_vector_complex_mul$ ^gsl_vector_complex_scale$ + ^gsl_vector_complex_sub$ + /], + "1.13" => [qw/ + ^gsl_bspline_greville_abscissa$ + ^gsl_min_fminimizer_quad_golden$ + ^gsl_monte_miser_params.* ^gsl_monte_vegas_params ^gsl_monte_vegas_chisq$ + ^gsl_monte_vegas_runval$ + ^gsl_poly_eval_derivs$ + /], + "1.14" => [qw/ + ^gsl_integration_glfixed.* + ^gsl_multifit_linear_usvd$ ^gsl_multifit_wlinear_usvd$ + /], + "1.15" => [qw/ + ^gsl_bspline_deriv.* ^gsl_bspline_eval_nonzero$ + ^gsl_cheb_order$ ^gsl_cheb_size$ ^gsl_cheb_coeffs$ + ^gsl_eigen_nonsymmv_params$ + ^gsl_integration_cquad.* + ^gsl_interp_type_min_size$ + ^gsl_linalg_complex_cholesky_invert$ + ^gsl_matrix_equal$ ^gsl_matrix_char_equal$ ^gsl_matrix_complex_equal$ + ^gsl_matrix_int_equal$ + ^gsl_pow_uint$ + ^gsl_sf_bessel_Knu_scaled_e10_e$ + ^gsl_vector_equal$ ^gsl_vector_char_equal$ ^gsl_vector_complex_equal$ + ^gsl_vector_int_equal$ + /], +}; diff --git a/pod/Diff.pod b/pod/Diff.pod new file mode 100644 index 0000000..a946c7e --- /dev/null +++ b/pod/Diff.pod @@ -0,0 +1,47 @@ +%perlcode %{ +@EXPORT_OK = qw/ + gsl_diff_central + gsl_diff_backward + gsl_diff_forward + /; +%EXPORT_TAGS = ( all => [ @EXPORT_OK ] ); + +__END__ + +=head1 NAME + +Math::GSL::Diff - Numerical differentiation routines + +=head1 SYNOPSIS + + use Math::GSL::Diff qw/:all/; + +=head1 DESCRIPTION + +Here is a list of all the functions included in this module : + +=over + +=item C + +=item C + +=item C + +=back + +=head1 EXAMPLES + +=head1 AUTHORS + +Jonathan Leto and Thierry Moisan + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2008-2009 Jonathan Leto and Thierry Moisan + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=cut +%} diff --git a/swig/BLAS.i b/swig/BLAS.i index 5659fe9..a635872 100644 --- a/swig/BLAS.i +++ b/swig/BLAS.i @@ -6,6 +6,7 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %include "gsl/gsl_blas.h" %include "gsl/gsl_blas_types.h" %include "../pod/BLAS.pod" diff --git a/swig/BSpline.i b/swig/BSpline.i index cd25e53..9dc656c 100644 --- a/swig/BSpline.i +++ b/swig/BSpline.i @@ -1,6 +1,7 @@ %module "Math::GSL::BSpline" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %include "gsl/gsl_bspline.h" %include "gsl/gsl_vector.h" %include "../pod/BSpline.pod" diff --git a/swig/CBLAS.i b/swig/CBLAS.i index 6bef9af..518578f 100644 --- a/swig/CBLAS.i +++ b/swig/CBLAS.i @@ -1,6 +1,7 @@ %module "Math::GSL::CBLAS" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double const [] { const double * }; %apply float const [] { const float * }; diff --git a/swig/CDF.i b/swig/CDF.i index 5edd475..5822709 100644 --- a/swig/CDF.i +++ b/swig/CDF.i @@ -1,6 +1,8 @@ %module "Math::GSL::CDF" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_cdf.h" %} diff --git a/swig/Chebyshev.i b/swig/Chebyshev.i index 3bddcc3..c27d5a0 100644 --- a/swig/Chebyshev.i +++ b/swig/Chebyshev.i @@ -1,6 +1,8 @@ %module "Math::GSL::Chebyshev" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_chebyshev.h" #include "gsl/gsl_math.h" diff --git a/swig/Combination.i b/swig/Combination.i index ecd1514..cf3a16c 100644 --- a/swig/Combination.i +++ b/swig/Combination.i @@ -1,6 +1,8 @@ %module "Math::GSL::Combination" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_types.h" #include "gsl/gsl_combination.h" diff --git a/swig/Complex.i b/swig/Complex.i index e6be310..529728f 100644 --- a/swig/Complex.i +++ b/swig/Complex.i @@ -1,6 +1,8 @@ %module "Math::GSL::Complex" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_complex.h" #include "gsl/gsl_complex_math.h" diff --git a/swig/Const.i b/swig/Const.i index 63f6b5b..e9959e7 100644 --- a/swig/Const.i +++ b/swig/Const.i @@ -1,5 +1,6 @@ %module "Math::GSL::Const" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_math.h" diff --git a/swig/DHT.i b/swig/DHT.i index d5952c9..d1a4d63 100644 --- a/swig/DHT.i +++ b/swig/DHT.i @@ -1,6 +1,7 @@ %module "Math::GSL::DHT" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_dht.h" diff --git a/swig/Deriv.i b/swig/Deriv.i index 3c12cea..66c69d6 100644 --- a/swig/Deriv.i +++ b/swig/Deriv.i @@ -3,6 +3,7 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_math.h" diff --git a/swig/Diff.i b/swig/Diff.i index f951661..436330e 100644 --- a/swig/Diff.i +++ b/swig/Diff.i @@ -1,19 +1,11 @@ %module "Math::GSL::Diff" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_diff.h" %} %include "gsl/gsl_diff.h" - - -%perlcode %{ -@EXPORT_OK = qw/ - gsl_diff_central - gsl_diff_backward - gsl_diff_forward - /; -%EXPORT_TAGS = ( all => [ @EXPORT_OK ] ); -%} +%include "../pod/Diff.pod" diff --git a/swig/Eigen.i b/swig/Eigen.i index 6f04678..280b89f 100644 --- a/swig/Eigen.i +++ b/swig/Eigen.i @@ -1,6 +1,8 @@ %module "Math::GSL::Eigen" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_eigen.h" #include "gsl/gsl_complex.h" diff --git a/swig/Errno.i b/swig/Errno.i index 09cb3ea..55280b0 100644 --- a/swig/Errno.i +++ b/swig/Errno.i @@ -1,6 +1,8 @@ %module "Math::GSL::Errno" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_errno.h" #include "gsl/gsl_types.h" diff --git a/swig/FFT.i b/swig/FFT.i index 3c5f7f2..86031de 100644 --- a/swig/FFT.i +++ b/swig/FFT.i @@ -1,6 +1,8 @@ %module "Math::GSL::FFT" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %include "gsl/gsl_math.h" %include "gsl/gsl_sys.h" %include "gsl/gsl_pow_int.h" diff --git a/swig/Fit.i b/swig/Fit.i index 09542db..c540da0 100644 --- a/swig/Fit.i +++ b/swig/Fit.i @@ -1,6 +1,7 @@ %module "Math::GSL::Fit" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double * c0, double * c1, double * cov00, double * cov01, double * cov11, double * sumsq, double * chisq }; diff --git a/swig/Heapsort.i b/swig/Heapsort.i index a64c309..949b22f 100644 --- a/swig/Heapsort.i +++ b/swig/Heapsort.i @@ -1,6 +1,7 @@ %module "Math::GSL::Heapsort" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_heapsort.h" diff --git a/swig/Histogram.i b/swig/Histogram.i index dca65ab..ea07165 100644 --- a/swig/Histogram.i +++ b/swig/Histogram.i @@ -1,6 +1,7 @@ %module "Math::GSL::Histogram" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double * lower, double * upper, size_t * i}; diff --git a/swig/Histogram2D.i b/swig/Histogram2D.i index aec3a93..2909d5b 100644 --- a/swig/Histogram2D.i +++ b/swig/Histogram2D.i @@ -1,6 +1,7 @@ %module "Math::GSL::Histogram2D" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double * xlower, double * xupper, double * ylower, double * yupper, double * x, double * y}; %apply int *OUTPUT { size_t * i, size_t * j }; diff --git a/swig/IEEEUtils.i b/swig/IEEEUtils.i index 607c29b..1f37735 100644 --- a/swig/IEEEUtils.i +++ b/swig/IEEEUtils.i @@ -1,5 +1,7 @@ %module "Math::GSL::IEEEUtils" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_ieee_utils.h" %} diff --git a/swig/Integration.i b/swig/Integration.i index e09249e..0272059 100644 --- a/swig/Integration.i +++ b/swig/Integration.i @@ -1,6 +1,7 @@ %module "Math::GSL::Integration" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_integration.h" diff --git a/swig/Interp.i b/swig/Interp.i index 235226a..4897272 100644 --- a/swig/Interp.i +++ b/swig/Interp.i @@ -2,6 +2,7 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double * y, double * d, double * d2, double * result }; diff --git a/swig/Linalg.i b/swig/Linalg.i index f31b9f9..7785fcb 100644 --- a/swig/Linalg.i +++ b/swig/Linalg.i @@ -1,5 +1,6 @@ %module "Math::GSL::Linalg" %include "gsl_typemaps.i" +%include "renames.i" %apply int *OUTPUT { int *signum }; diff --git a/swig/Machine.i b/swig/Machine.i index d01421b..142dbe7 100644 --- a/swig/Machine.i +++ b/swig/Machine.i @@ -1,4 +1,5 @@ %module "Math::GSL::Machine" +%include "renames.i" %{ #include "gsl/gsl_machine.h" diff --git a/swig/Matrix.i b/swig/Matrix.i index 7c4d563..e61851f 100644 --- a/swig/Matrix.i +++ b/swig/Matrix.i @@ -3,6 +3,8 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %apply int *OUTPUT { size_t *imin, size_t *imax, size_t *jmin, size_t *jmax }; %apply double *OUTPUT { double * min_out, double * max_out }; diff --git a/swig/MatrixComplex.i b/swig/MatrixComplex.i index cf3148e..e250f0d 100644 --- a/swig/MatrixComplex.i +++ b/swig/MatrixComplex.i @@ -3,6 +3,8 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %apply int *OUTPUT { size_t *imin, size_t *imax, size_t *jmin, size_t *jmax }; %apply double *OUTPUT { double * min_out, double * max_out }; diff --git a/swig/Min.i b/swig/Min.i index 42551e3..14476cd 100644 --- a/swig/Min.i +++ b/swig/Min.i @@ -1,6 +1,8 @@ %module "Math::GSL::Min" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_types.h" #include "gsl/gsl_min.h" diff --git a/swig/Monte.i b/swig/Monte.i index 44525c6..0074c14 100644 --- a/swig/Monte.i +++ b/swig/Monte.i @@ -1,6 +1,7 @@ %module "Math::GSL::Monte" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %typemap(argout) ( gsl_monte_function * f, double xl[], double xu[], size_t dim, size_t calls, gsl_rng * r, diff --git a/swig/Multifit.i b/swig/Multifit.i index 000b5f2..f34abab 100644 --- a/swig/Multifit.i +++ b/swig/Multifit.i @@ -2,6 +2,8 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %apply double *OUTPUT { double * y, double * y_err, double * chisq, size_t * rank}; %{ diff --git a/swig/Multimin.i b/swig/Multimin.i index 8f4b10b..5d61be8 100644 --- a/swig/Multimin.i +++ b/swig/Multimin.i @@ -2,6 +2,8 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_types.h" #include "gsl/gsl_multimin.h" diff --git a/swig/Multiroots.i b/swig/Multiroots.i index 8845a7d..fd981d6 100644 --- a/swig/Multiroots.i +++ b/swig/Multiroots.i @@ -1,5 +1,6 @@ %module "Math::GSL::Multiroots" %include "gsl_typemaps.i" +%include "renames.i" %typemap(in) gsl_multiroot_function * { gsl_multiroot_function *f; diff --git a/swig/NTuple.i b/swig/NTuple.i index ddeb182..9bb261f 100644 --- a/swig/NTuple.i +++ b/swig/NTuple.i @@ -1,6 +1,7 @@ %module "Math::GSL::NTuple" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" // XXX: This needs to properly take the type of array into account, // this assumes ints diff --git a/swig/ODEIV.i b/swig/ODEIV.i index f6a0e98..209fdd5 100644 --- a/swig/ODEIV.i +++ b/swig/ODEIV.i @@ -1,5 +1,7 @@ %module "Math::GSL::ODEIV" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_odeiv.h" #include "gsl/gsl_types.h" diff --git a/swig/Permutation.i b/swig/Permutation.i index f42b30d..6f41bab 100644 --- a/swig/Permutation.i +++ b/swig/Permutation.i @@ -1,6 +1,7 @@ %module "Math::GSL::Permutation" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_permute.h" diff --git a/swig/Poly.i b/swig/Poly.i index 30079d6..4b44204 100644 --- a/swig/Poly.i +++ b/swig/Poly.i @@ -2,6 +2,7 @@ // this brakes stuff // %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_sys.h" diff --git a/swig/PowInt.i b/swig/PowInt.i index 968a47e..d205dea 100644 --- a/swig/PowInt.i +++ b/swig/PowInt.i @@ -1,5 +1,7 @@ %module "Math::GSL::PowInt" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_pow_int.h" %} diff --git a/swig/QRNG.i b/swig/QRNG.i index c583351..9215a2f 100644 --- a/swig/QRNG.i +++ b/swig/QRNG.i @@ -1,6 +1,7 @@ %module "Math::GSL::QRNG" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double x[] }; diff --git a/swig/RNG.i b/swig/RNG.i index 868197b..d34fd48 100644 --- a/swig/RNG.i +++ b/swig/RNG.i @@ -1,5 +1,7 @@ %module "Math::GSL::RNG" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_rng.h" %} diff --git a/swig/Randist.i b/swig/Randist.i index c51c0a6..2c20cf1 100644 --- a/swig/Randist.i +++ b/swig/Randist.i @@ -1,6 +1,7 @@ %module "Math::GSL::Randist" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" void gsl_ran_dir_2d (const gsl_rng * r, double *OUTPUT, double *OUTPUT); void gsl_ran_dir_2d_trig_method (const gsl_rng * r, double *OUTPUT, double *OUTPUT); diff --git a/swig/Roots.i b/swig/Roots.i index a86d3d5..e813b11 100644 --- a/swig/Roots.i +++ b/swig/Roots.i @@ -1,6 +1,8 @@ %module "Math::GSL::Roots" %include "gsl_typemaps.i" %include "typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_types.h" #include "gsl/gsl_roots.h" diff --git a/swig/SF.i b/swig/SF.i index 81bec6f..5a4f2fc 100644 --- a/swig/SF.i +++ b/swig/SF.i @@ -1,6 +1,7 @@ %module "Math::GSL::SF" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double * sn, double * cn, double * dn, double * sgn }; diff --git a/swig/Siman.i b/swig/Siman.i index efe07f8..41bd4cc 100644 --- a/swig/Siman.i +++ b/swig/Siman.i @@ -1,6 +1,8 @@ %module "Math::GSL::Siman" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_siman.h" %} diff --git a/swig/Sort.i b/swig/Sort.i index d2740d7..88f1296 100644 --- a/swig/Sort.i +++ b/swig/Sort.i @@ -3,6 +3,7 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %typemap(argout) (double * data, const size_t stride, const size_t n) { int i=0; diff --git a/swig/Spline.i b/swig/Spline.i index 6aa939d..6f2d33e 100644 --- a/swig/Spline.i +++ b/swig/Spline.i @@ -2,6 +2,8 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %apply double *OUTPUT { double * y, double * d, double * d2, double * result }; %{ diff --git a/swig/Statistics.i b/swig/Statistics.i index a43f0ad..9c3eb60 100644 --- a/swig/Statistics.i +++ b/swig/Statistics.i @@ -2,6 +2,7 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double * min, double * max }; diff --git a/swig/Sum.i b/swig/Sum.i index dd3ee89..5e3064c 100644 --- a/swig/Sum.i +++ b/swig/Sum.i @@ -1,5 +1,6 @@ %module "Math::GSL::Sum" %include "gsl_typemaps.i" +%include "renames.i" %apply double *OUTPUT { double * sum_accel, double * abserr, double * abserr_trunc }; diff --git a/swig/Sys.i b/swig/Sys.i index e6301ba..c9da297 100644 --- a/swig/Sys.i +++ b/swig/Sys.i @@ -2,6 +2,8 @@ %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %apply int *OUTPUT { int * e }; %{ diff --git a/swig/Vector.i b/swig/Vector.i index 0d3251c..98f4a35 100644 --- a/swig/Vector.i +++ b/swig/Vector.i @@ -1,6 +1,7 @@ %module "Math::GSL::Vector" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" FILE * fopen(char *, char *); int fclose(FILE *); diff --git a/swig/VectorComplex.i b/swig/VectorComplex.i index d1e69ac..adde687 100644 --- a/swig/VectorComplex.i +++ b/swig/VectorComplex.i @@ -1,6 +1,7 @@ %module "Math::GSL::VectorComplex" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_nan.h" diff --git a/swig/Wavelet.i b/swig/Wavelet.i index 3077b29..76482d5 100644 --- a/swig/Wavelet.i +++ b/swig/Wavelet.i @@ -1,6 +1,8 @@ %module "Math::GSL::Wavelet" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" + %{ #include "gsl/gsl_types.h" #include "gsl/gsl_wavelet.h" diff --git a/swig/Wavelet2D.i b/swig/Wavelet2D.i index a7a3a8e..3a0c1c2 100644 --- a/swig/Wavelet2D.i +++ b/swig/Wavelet2D.i @@ -1,6 +1,7 @@ %module "Math::GSL::Wavelet2D" %include "typemaps.i" %include "gsl_typemaps.i" +%include "renames.i" %{ #include "gsl/gsl_types.h"