Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Want a perl6 Binary?

Journal written by chromatic (983) and posted by brian_d_foy on 2007.12.30 4:32   Printer-friendly
Check out Parrot as of r24278 or newer. Configure and build it:

$ perl
$ make

Build Perl 6:

$ cd languages/perl6/
$ make

Now build the new pbc_to_c target. 'snifty:

$ cd ../..
$ make pbc_to_c

With the shiny new pbc_to_c utility, make the perl6 binary:

$ ./pbc_to_c languages/perl6/perl6.pbc

Now you have a perl6 binary that can run Perl 6 programs:

$ ./perl6 languages/perl6/t/01-sanity/01-tap.t

Caveats: you need to build a shared libparrot with dynamic loading (the default Parrot build, I believe). Also, for now, you can only run the Perl 6 binary from the root directory of a Parrot checkout. Both problems are solveable. (I think the binary will work against an installed Parrot, though I'm not sure we install the supporting PBCs appropriately yet.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Here's my attempt.

    Checked out revision 24297.
    parrot $ cd parrot
    parrot $ perl
    Base class package "Parrot::Configure::Compiler" is empty.
        (Perhaps you need to 'use' the module which defines that package first.)
    at lib/Parrot/ line 44
    BEGIN failed--compilation aborted at lib/Parrot/ line 44.
    Compilation failed in require at line 299.
    BEGIN failed--compilation aborted at line 299.
    parrot $ find . -name

    • It looks like one of the configuration system branch merges missed a file, so until Jim can fix it, try r24278; that's one I know is good.

      • Still fails on my Intel MacBook (if that's relevant). There are appear to be a bunch of tests missing from the manifest and the pbc_to_c target fails with:

        compilation failed
        current instr.: '_throw' pc 438 (pbc_to_c.pir:250)
        called from Sub 'compile_file' pc 485 (pbc_to_c.pir:268)
        called from Sub 'main' pc 126 (pbc_to_c.pir:29)
        make: *** [pbc_to_c] Error 1

        Rather than fill this up, I've sent a detailed email to the perl6-internals list and will send any follow-up information they need (if any).

      • This kind of remark is exactly the sort of reason why it is a good idea to ditch Subversion and move to a decent Source Control Management system. Producing a stable branch with Subversion is not common practice, because the tools make it hard and do not support every stage of the process.
        • I agree that Subversion's merging support has its flaws. However, there's no point in even thinking about considering the possibility of allowing the idea of having this conversation cross your mind until there's a working and native Git port for Win32. We have a couple of active Win32 developers, and anyone who willingly develops on that platform I will not chase away.

    • Barney corrected the missing file in r24298. My apologies. Will be posting to list background to this oversight.

  • In my opinion (from a packaging and module perspective) this is on the single most significant milestones in the Perl 6 timeline.
  • chromatic wrote:

    Now you have a perl6 binary that can run Perl 6 programs:

    $ ./perl6 languages/perl6/t/01-sanity/01-tap.t

    Caveats: you need to build a shared libparrot with dynamic loading (the default Parrot build, I believe). Also, for now, you can only run the Perl 6 binary from the root directory of a Parrot checkout.

    As written, I think the code is incorrect and is contradicted by the second sentence in the following paragraph. I was only able to execute Perl6 programs with:

    $ ./languages/perl

    • Out of curiosity, what platform are you on? I'm still working with the perl6-internals team to figure out how to get this to properly build on my Intel MacBook. We're getting closer, but there are still failures.

      For those following along at home, use the following bash script I hacked together:


      perl --test \
        && make \
        && cd languages/perl6/

      make \
        && cd ../..

      make pbc_to_c \
        && ./pbc_to_c languages/perl6/perl6.pbc \

      • For the average user, perl will suffice, i.e., you can omit the --test.

        The --test option is something which those working on the configuration and build systems should run, but is not necessary for language developers or those (like myself!) who will be using chromatic's program to run Perl6 program for the first time.


      • I'm having issues building r24319 on my Intel MacBook Pro following these instructions. Specifically, when I try the make pbc_to_exe step I get:

        /usr/bin/ld: Undefined symbols:
        collect2: ld returned 1 exit status

        I'll spare this thread the details (gcc-4.0, lots of Fink packages installed) but if there's a simple solution it'd be nice to know where to look.

        • That probably means that linking against libparrot fails, whether it's picking up the wrong file or linking incorrectly or not exporting symbols properly. Can you post the contents of pbc_to_exe.pir (generated in the root directory) to

          I'm not a Mac OS X hacker, but if we can find someone who knows how linking works on that platform, we should be able to fix these problems.

  • .. what do I need to update?

    or do I need to dump that and install from svn?

    @JAPH = qw(Hacker Perl Another Just);
    print reverse @JAPH;
    • The easiest way is to pull from SVN. Otherwise, I'd have to tell you how to merge and move around several different files.

  • $ cd languages/perl6/
    $ make
    $ cd ../..

    Much better written as make -C languages/perl6/.

    • Actually the name 'pbc_to_c' is a misnomer, as the generated C-code is automatically compiled and linked to an executable. So as of r24315 of [] it works, at least under Linux, like this: $ cd parrot $ perl $ make $ make -C languages/perl6/ $ make pbc_to_exe $ ./pbc_to_exe languages/perl6/perl6.pbc $ ./languages/perl6/perl6 \ languages/perl6/t/01-sanity/01-tap.t
      /* */
      • This works for me on Linux, but not yet on Darwin.

        perl && make
        cd languages/perl6/ && make
        cd -
        make pbc_to_exe
        ./pbc_to_exe languages/perl6/perl6.pbc
        ./languages/perl6/perl6 languages/perl6/t/01-sanity/01-tap.t

  • To anyone wanting to run this: owing to some comments on #parrot by pmichaud and barney, I renamed the pbc_to_c target to pbc_to_exe and barney applied it.

  • As of r24319, it builds and runs fine on a MacBook Pro (2.33 GHz Intel C2D) running Mac OS X 10.5.1.

    This is very exciting. This could be a another turning point for increasing interest in involvement with perl6 development.
    The great thing about multitasking is that several things can go wrong at once.
  • I finally made it to build a perl6.exe on Win32 with MSVC9!
    It didn't work out of the box. I had to make little changes here and there...

    I tracked the problems I encountered and left a little patch that seems to solve them at []
    Might be useful to others out there...

  • When the next version of Parrot comes out, do you plan to promote this build process to something that will be supported (and I assume tested?)...

    If so I'll probably jump on the band-wagon there, instead of mucking around with blead versions.
    • There are some building problems on Darwin/PPC that need help from someone who understands linking on that platform, and there are some questions about the Windows build (but a patch). If we can fix those and the caveats about PBC locations, I think we can support this, even if it's not the permanent technique for making a perl6 binary.

      I'd certainly like to see this packaged.

  • As of -r24427 and higher, you can say "make perl6" and it will do all that hoohah for you automagically.