Maybe using SWIG?That's definitely an option. That's how the Math::GSL source is created. (Math::GSL wraps the GSL library.)
However, I don't know how SWIG works, or how to use it.
Inline::C (already mentioned) also has an 'AUTOWRAP' capability which could presumably be utilised. Although I've used Inline::C extensively, I don't know how to make proper use of 'AUTOWRAP' either. Of course, you can always craft the wrapping by hand using Inline::C or XS. That's the way I've always done it - it's a bit laborious, but at least you don't have to come to terms with the use of AUTOWRAP :-)
If you do use Inline::C, be sure to check out 'perldoc Inline::C-Cookbook'. It has some good examples that will show you how to link an external library, and how to create a "radar*" object - among other things.
Note that Inline::C and XS are essentially the same. Inline::C just takes its input in the form of C code, autogenerates the XS code from that C code, and then automatically compiles the XS code and runs the perl code (which presumably makes use of that compiled XS code). It's not hard to take the Inline::C code and convert it to an XS file if you ever want to.
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.