Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Exploring Inline::C (Status Update for Inline::CPP)

by davido (Cardinal)
on Nov 13, 2011 at 06:04 UTC ( [id://937798]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^3: Exploring Inline::C (Status Update for Inline::CPP)
by syphilis (Archbishop) on Nov 13, 2011 at 09:06 UTC
    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

        I'll look it over within a day or so.

        No problems - there's no screaming urgency about this.

        The issue goes a bit deeper, too. (For the same reason, even with 0.25 you can't extract the source, build it, run 'make realclean', then build again for a perl that uses a different C++ compiler. For the second build you have to extract the source all over again.) I'll submit a bug report and tentative patch.

        Good luck with Inline::CPP !!

        Cheers,
        Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found