Want a perl6 Binary?

brian_d_foy on 2007-12-30T09:32:00

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

$ perl Configure.pl
$ 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.)


Where is "Parrot::Configure::Compiler"?

Ovid on 2007-12-30T09:43:15

Here's my attempt.

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

And for those who don't know, the latest Parrot can be obtained with:

svn co https://svn.perl.org/parrot/trunk parrot

Re:Where is "Parrot::Configure::Compiler"?

chromatic on 2007-12-30T10:01:38

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.

Re:Where is "Parrot::Configure::Compiler"?

Ovid on 2007-12-30T10:40:51

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).

Re:Where is "Parrot::Configure::Compiler"?

mugwumpjism on 2007-12-31T04:07:14

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.

Re:Where is "Parrot::Configure::Compiler"?

chromatic on 2007-12-31T05:03:50

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.

Re:Where is "Parrot::Configure::Compiler"?

Aristotle on 2007-12-31T11:14:23

Won’t be this way for very much longer, considering the speed at which git’s been moving since inception.

Re:Where is "Parrot::Configure::Compiler"?

Alias on 2008-01-02T23:59:58

As the unofficial native Win32 tool purist, I've recently withdrawn my objects to git.

The new native git installer does almost everything right, it's just still got a lot of bugs to be cleaned (but no show stoppers).

Moving to git should only be a matter of when now, not if.

Re:Where is "Parrot::Configure::Compiler"?

adiabat on 2007-12-31T20:37:10

What would you recommend as a "decent" SCM system?

Re:Where is "Parrot::Configure::Compiler"?

Aristotle on 2007-12-31T21:43:58

Git, of course. :-)

Re:Where is "Parrot::Configure::Compiler"?

mugwumpjism on 2008-01-03T23:43:57

I have in the past recommended several.

However I think of those three git is the right one to standardize on for a repository format, as it's the most efficient for that and all the other tools can work well with it. It's also the simplest to understand, with a model sporting only four basic types - files, directories, commits and tags. The representation of this in Perl6 is delightfully small; I used it as a model example for my 2006 Moose Talk at YAPC::Eu.

Re:Where is "Parrot::Configure::Compiler"?

kid51 on 2007-12-30T14:59:55

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

kid51

Bravo

Alias on 2007-12-30T12:38:17

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

Re: Want a perl6 Binary?

kid51 on 2007-12-30T15:09:20

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/perl6/perl6 languages/perl6/t/01-sanity/01-tap.t

Re: Want a perl6 Binary?

Ovid on 2007-12-30T15:27:11

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:

#!/bin/bash

perl Configure.pl --test \
  && make \
  && cd languages/perl6/

make \
  && cd ../..

make pbc_to_c \
  && ./pbc_to_c languages/perl6/perl6.pbc \
  && ./perl6 languages/perl6/t/01-sanity/01-tap.t

I haven't fixed it for the final line which runs 01-tap.t because the latest build fails on perl Configure --test. Note that the --test switch verifies that we can actually configure things, a tip shared with me on the perl6-internals list.

If you're really paranoid, you can do this to rebuild cleanly every time:

#!/bin/bash

PARROTROOT=/path/to

rm -fr "$PARROTROOT/parrot"
cd $PARROTROOT

svn co https://svn.perl.org/parrot/trunk parrot \
  && cd parrot

perl Configure.pl --test \
  && make \
  && cd languages/perl6/

make \
  && cd ../..

make pbc_to_c \
  && ./pbc_to_c languages/perl6/perl6.pbc \
  && ./perl6 languages/perl6/t/01-sanity/01-tap.t

Just make sure that you set $PARROTROOT to the correct directory for your system.

Re: Want a perl6 Binary?

kid51 on 2007-12-30T15:41:01

For the average user, perl Configure.pl 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.

kid51

Re: Want a perl6 Binary?

jasonporritt on 2007-12-31T03:48:20

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:
_PackFile_fixup_subs
_PackFile_new
_PackFile_unpack
_Parrot_destroy
_Parrot_exit
_Parrot_loadbc
_Parrot_new
_Parrot_runcode
_do_sub_pragmas
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.

Re: Want a perl6 Binary?

chromatic on 2007-12-31T05:08:39

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 parrot-porters@perl.org?

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.

Re: Want a perl6 Binary?

jasonporritt on 2007-12-31T13:54:38

Added a comment to Ovid's ticket including my pbc_to_exe.pir file.

http://rt.perl.org/rt3/Ticket/Display.html?id=49226

Re: Want a perl6 Binary?

jasonporritt on 2007-12-31T15:44:29

I found a solution -- you were right to suspect the pbc_to_exe.pir file. I made it link to libparrot.dylib instead of libparrot.a and it is working now.

See reply to ticket: http://rt.perl.org/rt3/Ticket/Display.html?id=49226

neat - but I've only got release 5.1 ..

TeeJay on 2007-12-30T16:38:27

.. what do I need to update?

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

Re:neat - but I've only got release 5.1 ..

chromatic on 2007-12-30T18:10:58

The easiest way is to pull from SVN. Otherwise, I'd have to tell you how to merge and move around several different files.

Just another make hacker,

Aristotle on 2007-12-30T16:58:54

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

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

Re:Just another make hacker,

Bernhard on 2007-12-30T17:22:04

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 https://svn.perl.org/parrot/trunk it works, at least under Linux, like this:

$ cd parrot $ perl Configure.pl $ 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

Re:Just another make hacker,

kid51 on 2007-12-30T17:29:06

This works for me on Linux, but not yet on Darwin.

perl Configure.pl && 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

pbc_to_c is now pbc_to_exe

Ovid on 2007-12-30T17:26:04

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.

Build and runs fine on MacBook Pro w/ 10.5.1

yDNA Barak on 2007-12-30T20:10:38

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.

Re: Want a perl6 binary?

cosimo on 2007-12-30T22:11:25

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 http://rt.perl.org/rt3/Ticket/Display.html?id=49238
Might be useful to others out there...

Will the next release see this process supported?

Alias on 2007-12-31T03:25:24

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.

Re:Will the next release see this process supporte

chromatic on 2007-12-31T03:47:07

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.

make perl6

petdance on 2008-01-02T06:22:37

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