in reply to Re^2: Wrapping a C library
in thread Wrapping a C library

The following slightly modified script produces a set of gif files given a data file and a site ID as arguments. So, not surprisingly, the library can be called from Perl on Linux platform quite easily.

Regarding using the library on Windows, note the following from the GVBOX page - http://trmm-fc.gsfc.nasa.gov/trmm_gv/software/gvbox/gvbox.html:

It is assumed that you have a working Unix operating system and that you can compile C, C++ and Fortran source code, and that you have perl and optionally bison and flex.

I can't find any evidence that it has been ported to Windows - which doesn't mean that it hasn't been or that it would be difficult to do.

#!/usr/bin/perl # use Inline C => DATA => INC => '-I/usr/local/trmm/GVBOX/include' => LIBS => '-L/usr/local/trmm/GVBOX/lib -lrsl'; my $file = shift or die "USAGE: radar.pl file ID\n"; my $id = shift or die "USAGE: radar.pl file ID\n"; my_test($file, $id); __END__ __C__ #include "rsl.h" int my_test(char* file, char* id) { Radar *radar; radar = RSL_anyformat_to_radar(file, id); RSL_load_refl_color_table(); RSL_volume_to_gif(radar->v[DZ_INDEX], "dz_sweep", 400, 400, 200.0) +; return(0); }

Replies are listed 'Best First'.
Re^4: Wrapping a C library
by deadpickle (Pilgrim) on Mar 25, 2009 at 00:00 UTC
    Thanks for all your work!! What I would really like to do is have this in a perl module named RSL. What would be the best way to do that?