Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Want a perl6 Binary?

by chromatic (Archbishop)
on Dec 30, 2007 at 08:51 UTC ( #659584=perlnews: print w/replies, xml ) Need Help??

Check out Parrot as of r24315 or newer. Configure and build it:

$ perl $ make

Build Perl 6:

$ make -C languages/perl6/

Now build the new pbc_to_exe target. 'snifty:

$ make pbc_to_exe

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

$ ./pbc_to_exe languages/perl6/perl6.pbc

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

$ ./languages/perl6/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.)

Update: Updated to match recent changes.

Replies are listed 'Best First'.
Re: Want a perl6 Binary?
by shmem (Chancellor) on Dec 30, 2007 at 10:56 UTC
    I've checked out parrot from the svn repository (revision 24297)
    qwurx [shmem] ~/comp/perl/src/parrot > perl Base class package "Parrot::Configure::Compiler" is empty. (Perhaps you need to 'use' the module which defines that package f +irst, or make that module available in @INC

    and it doesn't contain Parrot/Configure/ - what is missing?


    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      See Ovid's post to perl6.internals on Google Groups. I got the same error as him with, but pressed on regardless :) Final outcome (note that Perl6 was not created in the root of the source tree):
      parrot$ ./languages/perl6/perl6 languages/perl6/t/01-sanity/01-tap.t 1..10 ok 1 ok 2 ok # comment ok 4 ok 5 ok 6 foo ok 7 # skip ok 8 # skip bar not ok 9 # TODO not ok 10 # TODO baz

        And for those of us who've recently upgraded to OSX 10.5 and are getting errors similar to the following:

        ld: symbol(s) not found for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/yO/yOnTsq9GEayvBZtIrvcjME+++ +TI/-Tmp-//ccanCD8S.out (No such file or directory) make: *** [miniparrot] Error 1

        Then setting the following should allow a successful compilation:

        export ARCHFLAGS=-arch i386

        I suspect that this may only apply if you're using the Apple-supplied /usr/bin/perl as I don't recall having to do this with my previous compiled-from-source one.

Re: Want a perl6 Binary?
by FunkyMonk (Chancellor) on Dec 30, 2007 at 15:41 UTC
    r24305 seems to have fixed all the problems with the exception of having to use
    ./languages/perl6/perl6 languages/perl6/t/01-sanity/01-tap.t

Re: Want a perl6 Binary?
by Rudif (Hermit) on Jan 06, 2008 at 15:39 UTC
    chromatic, thank you for the guidance. Is this process expected to work on Windows XP? I know, I could have tried it myself.

    However, being a Windows programmer, I thought that this was as good an occasion as any for me to venture into the Linux world and try perl6 there.

    It worked as advertized!

    Here are details (yes, brethern in Windows, it was easy):


    OK, I tried the build process on WinXP + VC8, 32 bit machine, and I got stuck.

    First, I had trouble with the old nmake 1.5 which was serving me the error

     NMAKE Fatal Error U1095
     expanded command line 'commandline' too long 
    After some googling I found the solution - use the nmake 8 which comes with VC8

    Now the first nmake step worked

    The second nmake step

     $ nmake -C languages\perl6\
    was failing, but it worked when I did
     cd languages\perl6\
    For now I am stuck on the third step,
     nmake pbc_to_exe 
    - nmake does not know how to make pbc_to_exe.

    It is getting late over here, I will need to dig into it tomorrow.

    Update #2


    I compared the parrot\makefile generated on Linux with the one on Windows. Well, the Windows makefile does not contain build targets pbc_to_exe and perl6, so that explains my failure to build pbc_to_exe on Windows.

    It looks like the feverish activity of parrot porters just before the end of 2007 was limited to the Linux build of perl6, as I guessed, correctly, it turns out.


      I believe that the targets on Windows are make pbc_to_exe.exe and make perl6.exe, for reasons which are not clear to any of us.

        After lots of fiddling around in the makefiles and not-enough-reading-readme-files, I think I ended up running

        mingw32-make xmas

        to build perl6.exe . I thought that was funny.


Re: Want a perl6 Binary?
by quester (Vicar) on Jan 03, 2008 at 23:26 UTC
    A very recent change to the languages/perl6 Makefile appears to have changed the make for perl6.exe (after the make for Parrot itself) to
    cd languages/perl6 make perl6.exe


    Also, if the make for Parrot dies under Cygwin with this error,

    make: *** [runtime/parrot/include/config.fpmc] Error 53
    the problem is that after libparrot.dll is built in ./blib/lib the loader can't find it when miniparrot.exe starts up. The solution is to copy the dll file to another directory where it can be found...
    cp blib/lib/libparrot.dll /usr/local/bin
    and rerun the make; it will run successfully this time. Perl6.exe also needs libparrot.dll to run, so you will need to keep this extra copy of it after you are finished.


Re: Want a perl6 Binary?
by adiabat (Acolyte) on Dec 31, 2007 at 20:02 UTC

    It worked! Thanks, C!

    Caveats: you need to build a shared libparrot with dynamic loading (the default Parrot build, I believe).

    I'm guessing this is the default for my system (GNU/Linux). I wasn't asked any questions during the Configure phase. Everything "just worked".

      That's the default build for GNU/Linux. Amusingly, it doesn't just work for Mac OS X.

Re: Want a perl6 Binary?
by Anonymous Monk on Jan 06, 2009 at 00:43 UTC
    anonymous@perlstation:/tmp/parrot/languages/perl6$ perl You cannot use --step until you have completed the full configure process

      Did you build Parrot first from its build root? You're in the languages/perl6/ directory.

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2023-03-29 03:53 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (70 votes). Check out past polls.