Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Exploring Inline::C (Generating primes)

by syphilis (Canon)
on Oct 27, 2011 at 10:34 UTC ( #934098=note: print w/ replies, xml ) Need Help??


in reply to Exploring Inline::C (Generating primes)

I really set out to explore Inline::CPP, but was disappointed

That module has been unmaintained for about 8 years, now.
It would be really good if some competent person would step forward and take over maintainership - as, I believe, an up-to-date Inline::CPP could be a very handy tool.

Last time I heard from Neil Watkiss (the original author) he had no intention of ever having any involvement with it again.

Cheers,
Rob


Comment on Re: Exploring Inline::C (Generating primes)
Re^2: Exploring Inline::C (Status Update for Inline::CPP)
by davido (Archbishop) on Nov 13, 2011 at 06:04 UTC

    I've taken on Co-maintainership for Inline::CPP. Neil Watkiss seemed happy (or relieved) to have someone take an interest. The latest version will show up on the CPAN mirrors within a few hours as 0.29. It has addressed the "failure to pass its test suite" issue, at least on my Windows and Linux systems, and should work for Mac now too. We'll see when the CPAN testers matrix gets updated. The issue turned out to be some code that appended '.h' to the end of the #include <iostream> preprocessor directive. While that was "the right way" back in 2001, nowadays in 2011 standard C++ doesn't use a .h extension for the core header files.

    I tweaked a couple other items from the bug reports where the application of the fix was pretty obviously a win. I'll try to get to looking at a few other issues in the next couple of weeks.

    If anyone has comments or suggestions, I would appreciate hearing them. As with most things in the Perl and CPAN world, those suggestions that come with a test and a patch will be given higher priority. Bonus points for a test in a TAP compatible '*.t' file format. :)

    Once Inline::CPP version 0.29 shows up on the servers (which should be any time now) I encourage brave people who have familiarity with C++ to give it a try. I'm finding all sorts of little issues that I'll need to look at. One, for example, is that if you try to sv_2mortal( av )... that's a problem as C++'s stricter typing wants sv_2mortal( sv ) only. One item for the ToDo list. ;)


    Dave

      I've taken on Co-maintainership for Inline::CPP

      This is excellent news!!

      I almost established co-maintainership of Inline::CPP a couple of years back, but I kept losing contact with Neil at critical moments, and it never happened. (That was actually quite fortuitous as I'm not the right person for the job, anyway - my CPP skills are best described in terms that don't involve the use of the word "skill" ;-)

      Version 0.29 builds and tests for me on my 32-bit builds of perl (where I'm using the mingw.org port of gcc-4.5.2).

      But ... things don't go quite so well if the compiler to be used is not called 'g++'.
      In CPP.pm we have:
      sub validate { my $o = shift; $o->{ILSM}{MAKEFILE}{CC} ||= 'g++'; # default compiler $o->{ILSM}{MAKEFILE}{LIBS} ||= ['-lstdc++']; # default libs
      That effectively hard-codes in 'g++' and '-lstdc++'.
      You'll note that the Makefile.PL rewrites CPP.pm, replacing the strings '@COMPILER' and '@DEFAULTLIBS' with the selected compiler and libs ... except that there's now *no* such strings as '@COMPILER' and '@DEFAULTLIBS' anywhere in CPP.pm ... so CPP.pm stays exactly as it was ... which is fine if (and only if) you're using 'g++'.

      Do you see what I mean ?

      Cheers,
      Rob

        Hey, thanks for the input. I'll look it over within a day or so.

        Maybe I should set up a mailing list or something, since lengthy discussion here is probably a little too far out on a tangent to be on-topic in the Monastery.


        Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://934098]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-08-27 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (235 votes), past polls