Tuesday, May 23, 2006

perl6 howto in ubuntu dapper

I will present an small howto compile and install perl6 and parrotvm on an ubuntu dapper

machine. I followed this howto with small corrections when the build/install went astray

http://dresden-pm.org/cgi-bin/twiki/view/PM/PugsFirstBloodEnglish
Check out the current parrot source tree

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

cd parrot


Try to run configure script to see what is missing

perl Configure.pl --prefix=/opt/parrot



In my case it died at some step

step auto::gcc died during execution: Linker failed (see test.ldo) at lib/Parrot/Configure/Step.pm line 365
Parrot::Configure::Step::cc_build() called at config/auto/gcc.pm line 36

auto::gcc::runstep('auto::gcc=HASH(0x83a1018)',
'Parrot::Configure=HASH(0x826970c)') called at lib/Parrot/Configure.pm
line 239
eval {...} called at lib/Parrot/Configure.pm line 235
Parrot::Configure::runsteps('Parrot::Configure=HASH(0x826970c)') called at Configure.pl line 443


It was an fuzzy error so i read that i need the Haskel compiler ,Let's try it

sudo apt-get install ghc6


Then I looked in the test.ldo content

view test.ldo


There is light now in my head aha no c++ file so i created the symlink

sudo ln -s /usr/bin/g++ /usr/bin/c++


I rerun the configure script

perl Configure.pl --prefix=/opt/parrot


All was ok so i installed the parrotVM

sudo make install

It's time now for perl6 compiler (aka pugs)

svn co http://svn.perl.org/perl6/pugs/trunk pugs


cd pugs


You need some devel libraries and some environment variables

sudo apt-get install zlib1g-dev libperl-dev


export PUGS_EMBED="perl5 parrot"


export PARROT_PATH=${HOME}/path/to/src/parrot/


perl Makefile.PL


time make


this can be used as cpu burn benchmark
real 64m59.178s
user 31m25.294s
sys 0m54.823s

sudo make install


pugs -e '"What say you?".say;'



ps: there is now an list for perl6.users
I tried to write the goodbye world example this way but didn't worked yet

pugs -e ' "What".say."You";'
***
unexpected "\""
expecting ".", subroutine name, array subscript, hash subscript or code subscript
at -e line 1, column 13


No comments: