Parrot becoming a rhinocerous

ambs on 2004-07-31T15:29:37

Is Parrot becoming a rhinocerous, an elephant, a dragon or a dinossaur? I just can't compile it in my 1Ghz Pentium 3. It stucks in the same file for more than 30 minutes. I do not know how much more, as I interrupted it.

The file (at least, one of them) is ops/core_ops_cg.c. On my system, it takes up 380Kb of disk space. It does not contain so much comments like that... as I think it is a generated file. But, can't we divide and conquer?


Computed gotos

lbr on 2004-07-31T19:57:22

That's computed gotos, which CAN'T be split up. If it takes forever, you likely have too little RAM to hold the compiler process in memory, so
./Configure --cgoto=0
is your friend.

You're swapping...

Elian on 2004-08-01T12:26:31

And it doesn't make much difference what speed your processor is, since by far the most time is taken waiting for the disk to churn.

core_ops_cg.c is, as noted, the computed goto core. To make this work, all of parrot's op functions are mashed together into a single function. It's huge, it gives GCC fits, and it takes a goodly chunk of memory to go. If you've less than 256M free, that file'll take forever to compile. (Even longer with optimizations turned on, because gcc usually gets halfway through it, gives up, and retries with no optimizations)

Passing in a --cgoto=0 flag to Configure.pl will disable that particular core. Adding more RAM to your box can drop compile times for that core by an order of magnitude. (And I don't joke here)

Re:You're swapping...

ambs on 2004-08-01T16:21:30

Let's see if I understood correctly:
  • I have 256MB of phisical ram, so, I should not expect to compile it :-)
  • --cgoto=0 will turn off that core... what this means? I will have one, not using gotos and less efficient?

Re:You're swapping...

Elian on 2004-08-01T21:22:15

With 256M of RAM, you should expect to compile it.... very, very slowly. It'll swap a lot, though if you're not using much RAM (like, say, you're not running X11, or are logged out if its a windows box) it'll build less slowly.

Parrot's got several generated cores. The computed goto core's the fastest, but it has others. The --cgoto=0 disables the computed goto core, which'll make things build faster, and parrot will still run, albeit a bit more slowly than it might otherwise.

Re:You're swapping...

ambs on 2004-08-01T21:36:41

Yes, with --cgoto=0 it compiles very quicly. At the moment I don't have anything written in parrot to test efficiency. I just like to compile it from time to time to see what new things are getting in it.

I was trying to compile it in X11 and with some apps running. So, just for curiosity, tomorrow I'll try to compile it remotely on the machine and check if it compiles.

Thanks for the explanations.

Re:You're swapping...

ambs on 2004-08-02T19:48:55

Running X, but not logged-in (under X) and compiling by ssh works just fine. All tests successfully.

Thanks!