Hi all, I've been curious to try out Will Braswell's RPerl compiler. I've tried to compile it on various systems using cpanm. Although on many system I have forced a successfull install, I have not been able to compile the basic example given in Will's documentation. I get errors like:
/root/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/RPerl/Data +Structure/Array.cpp:42:228: error: unable to find string literal oper +ator ‘operator"" INTEGER’ In file included from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_ +perl/5.24.1/rperltypes.h:13:0, from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_ +perl/5.24.1/RPerl.h:10, from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_ +perl/5.24.1/RPerl.cpp:4, from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_ +perl/5.24.1/rperlstandalone.h:22, from ./rperl_test2.cpp:6:
That error was when I used perl-5.24.1 built with perlbrew, and gcc-4.7.1. Should I try building RPerl with system Perl? Or do I need to upgrade some environment variable? Or maybe upgrade gcc? By the way the code I'm trying to compile with RPerl looks like this:
#!/usr/bin/perl # Foo Bar Arithmetic Example # [[[ HEADER ]]] use RPerl; use strict; use warnings; our $VERSION = 0.001_000; # [[[ CRITICS ]]] ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCh +eckedSyscalls) # USER DEFAULT 1: allow numeric values & print operat +or ## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: al +low single-quoted control characters & sigils # [[[ OPERATIONS ]]] my integer $foo = 21 + 12; my integer $bar = 23 * 42 * 2; my number $baz = to_number($bar) / $foo; print 'have $foo = ', to_string($foo), "\n"; print 'have $bar = ', to_string($bar), "\n"; print 'have $baz = ', to_string($baz), "\n";
Thanks for the help, spintronic

In reply to How to compile RPerl successfully? by fuzzmonkey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.