Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Problems? Is your data what you think it is?
 
PerlMonks  

Problems compiling Parrot

by jens (Pilgrim)
on Mar 26, 2003 at 00:32 UTC ( #245824=perlquestion: print w/ replies, xml ) Need Help??
jens has asked for the wisdom of the Perl Monks concerning the following question:

rob_au's post 245253 got me thinking.

So I downloaded parrot. make && make test (no make install, apparently).
Tried a very simple example program that displays the time:
set I3, 3000000 REDO: time I1 print I1 print "\n" set I2 0 SPIN: inc I2 le I2, I3, SPIN, REDO
But when I try to compile the program, I get an error:
Can't locate Parrot/PMC.pm in @INC
Naturally the line in assemble.pl this fails on is "use Parrot::PMC".

But CPAN has no knowledge of any such module! Where do I get it from? What gives?

--
Microsoft delendum est.

Comment on Problems compiling Parrot
Select or Download Code
Re: Problems compiling Parrot
by stefp (Vicar) on Mar 26, 2003 at 01:02 UTC
    The file you need is part of the parrot: lib/Parrot/PMC.pm. I don't know why it is not found.

    I don't think CPAN contains any modules intended to run with parrot. Perl6:: modules intend only to emulate certain features of Perl6 using the perl5 interpretor.

    -- stefp

Re: Problems compiling Parrot
by The Mad Hatter (Priest) on Mar 26, 2003 at 01:08 UTC
    I know almost nothing about Parrot, but my guess is that at some point it is getting removed. Apparently there have been problems in the past with this (granted, only while doing make clean). I don't have a fast connection, so I can't download it quickly and look around, but check around for it in the source.

    Hope this helps.

Re: Problems compiling Parrot
by jryan (Vicar) on Mar 26, 2003 at 02:56 UTC

    My guess is that the line above it:

    use lib "$FindBin::Bin/lib";

    might not be working properly on your system, for some reason (FindBin is rumored to be unstable). Try a 1-liner of:

    perl -MFindBin -le 'print $FindBin::Bin'

    while in the directory that you have parrot installed, and see if it is displaying the correct directory. You may have an extra trailing '/'.

    In the meantime, cd over to the languages/imcc subdirectory and make imcc. You can use it to assemble (and run!) parrot programs with the -a switch, i.e.:

    imcc -a source.pasm

    Update:
    As a side note, your assembly snippet is a bit whacked. There isn't a 4 arg conditional branch anymore, and you are comparision is a bit off. Try this:

    REDO: time I1 print I1 print "\n" SPIN: time I1 ne I1, I2, REDO branch SPIN

    Hope that doesn't take the fun outta it! (-:

      jryan -- when I do a
      perl -MFindBin -le 'print $FindBin::Bin'
      in the parrot directory gives me this output, which seems to me to be correct:
      bash-2.05b$ perl -MFindBin -le 'print $FindBin::Bin' /usr/local/bin/parrot/parrot
      I've made imcc without error. What is the relation
      between imcc and the parrot interpreter?
      Any more ideas on what may not be working correctly?

      --
      Microsoft delendum est.

        Yep, FindBin doesn't seem to be the problem. Don't know what to say there. You can still use IMCC though.

        Neither the assembler nor IMCC have anything to do with the parrot interpretter (which is actually a virtual machine). However, both the assembler and IMCC have the ability to assemble parrot assembly into parrot bytecode. Traditionally, this has been the job of the assembler, but IMCC, the optimizer, has gotten advanced enough so that it can also assemble, and is actually better at it. Give it a try! It shouldn't break like the assembler did; it is written in pure C.

      perl -MFindBin -le 'print $FindBin::Bin'

      You do realize that this tells FindBin to look for the location of the script in your file system but that this script isn't in the file system at all, it is just on the command line. So FindBin simply notes that the script name was '-e' which probably means there is no script so it simply returns getcwd()?

      So it isn't really testing FindBin much at all. Almost none of the code used in the original situation is used in your test case (then again, almost none of the code used in the original situation is of any value in finding the location of a Perl script, but that is another story).

                      - tye
        Um, well, hmmm... seems I blew that one. Regardless though; IMCC is still the better choice. (-:
Re: Problems compiling Parrot
by Elian (Parson) on Mar 26, 2003 at 15:00 UTC
    Parrot doesn't have an install target, and at the moment things only work from within the parrot build directories. As part of the build, Parrot creates a bunch of modules so the assembler (which is written in perl) can Do Its Thing properly. Those modules aren't needed to actually run parrot--for that you only need the parrot executable and your bytecode--but you do need them to assemble.

    IMCC, as has been pointed out, will assemble without them, so you might want to try that instead.

    Also, problems with parrot builds are best asked on perl6-internals--you're far more likely to get someone quickly who can answer your question. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://245824]
Approved by Thelonius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-04-19 03:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (475 votes), past polls