Rakudo in 17 syllables
Update 27/09/09: As of Parrot revision 41493 none of this is necessary, Parrot’s generic platform code checks if the time functions are available and replaces them if need-be (which is all moving the file from darwin’s code to generic was doing anyway).
The Haiku OS project released their Alpha 1 a few days ago and since then I have been trying it on and off. I like what I see and by their official release I expect it will be a very nice operating system.
As I did with OpenSolaris I wanted to put my time using the system to good use and test Rakudo on it. I happily discovered that GCC, Make, Subversion, Git and Perl are already installed by default so it was just a matter of getting Rakudo and building it.
As I unhappily discovered there are some issues which require a bit of hacking to get it to work. My methods are probably not ideal but they work
The first step was opening a terminal window; right-click, select Add-Ons and select OpenTerminal (or press OPT-ALT-T, opt is the ‘Super key’ or ‘Windows key’).
I checked out Rakudo with the familar:
~> git clone git://github.com/rakudo/rakudo.git
cd rakudo
Generated Parrot:
~> perl Configure.pl --gen-parrot
And it is this point that things go wrong. The Parrot build fails when building the time function, my quick and easy work around was to copy the hires_timer.c file from the darwin-specific code to the generic-code.
~/rakudo/parrot/config/gen/platform> mv generic/hires_timer.c generic/hires_timer.c.bak
~/rakudo/parrot/config/gen/platform> cp darwin/hires_timer.c generic/hires_timer.c
Attempting to rebuild Parrot got me past the initial hurdle but it still fails when dealing with the glut libraries. Luckily running
~/rakudo/parrot> perl Configure.pl --help
Yielded the –without-opengl flag for Parrot. Compiling Parrot without OpenGL (which doesn’t seem to be necessary anyway) makes it skip anything glut-related.
So all I needed to do was pass that command to Parrot, and repeating the help command in Rakudo’s directory informed me that I could do that the easy way with:
~/rakudo> perl Configure.pl --gen-parrot --gen-parrot-option='--without-opengl'
After this, Parrot compiled quite nicely and all was left was:
~/rakudo> make install
And there it is, a working perl6 binary on Haiku:
The spectests completed with only one failure which, as with Solaris, was easily fixed.
So now that you have successfully compiled Parrot and Rakudo on Haiku, run:
~> gcc --version
As you can see, by default, the Haiku project uses gcc 2.5 (which is 8 years old). They do this to retain compatibility with old BeOS programs. There is a GCC4 available, but apparently Parrot doesn’t need it.
However, assuming you don’t want a Parrot from the dark-ages, you can compile it with GCC4 by using:
~/rakudo> perl Configure.pl --gen-parrot --gen-parrot-option='--without-opengl' --gen-parrot-option='--cc=/boot/develop/abi/x86/gcc4/tools/gcc-4.3.3-haiku-090629/bin/gcc'
Make sure you wipe out your parrot_install first with ~/rakudo> rm -r parrot_install
Enjoy


