How to get Rakudo Perl 6

Rakudo is made available through a series of distributions that contain the compiler, documentation, and some modules–things that we think might be useful to someone wanting to write Perl 6 programs. These distributions are called Rakudo * or Rakudo Star.

The latest tarballs and MSI files for Rakudo Star distributions are currently available at http://rakudo.org/downloads/star/.

Building the compiler from source

Tarballs of each monthly compiler release are available from http://rakudo.org/downloads/rakudo.
These tarballs do not contain the documentation or modules found in Rakudo Star. It is strongly recommended that you download a Rakudo Star distribution unless you are a developer looking to hack on the compiler internals.

Since Rakudo is under rapid development, potential developers should download Rakudo directly from github and build from there:

$ git clone git://github.com/rakudo/rakudo.git

If you don’t have git installed, you can also get a tarball or zip of the latest development snapshot of Rakudo from github by visiting http://github.com/rakudo/rakudo/tree/nom and clicking “Download”. Then unpack the tarball or zip.

Building Rakudo from the sources requires Perl 5.8 or newer, a C compiler, a make utility, git, and in case you build for the parrot backend the ICU4C library.

Once these prerequisites are installed, build and install Rakudo as follows:

$ cd rakudo
$ perl Configure.pl --gen-parrot --gen-moar --gen-nqp --backends=parrot,jvm,moar
$ make
$ make install

If you want to build Rakudo for a single backend, just run Configure.pl in this example:

$ perl Configure.pl --gen-moar --gen-nqp --backends=moar

This will build and install a “perl6″ or “perl6.exe” executable, by default in the install/bin/ subdirectory of the rakudo build directory.

The “–backends” option tells which backends to use. To build both for parrot and jvm backend pass both as shown above. The first mentioned backend will be installed as “perl6″ (or “perl6.exe”) in addition to “perl6-p” and “perl6-j”/”perl6-m”. The option “–gen-parrot” is not needed when building for jvm only. Identically the option –gen-moar is only needed when building for the “moar” backend.

The “–gen-parrot” option tells Configure.pl to automatically download (via ‘git’) and build the version of Parrot most appropriate for the copy of Rakudo you currently have. It’s okay to use the –gen-parrot option on later invocations of Configure.pl; the configure system will re-build Parrot only if a newer version is needed for whatever version of Rakudo you’re working with.

Likewise “–gen-nqp” downloads and builds a copy of NQP, a smaller Perl 6 compiler used for building Rakudo.
And finally “–gen-moar” will download and build MoarVM, a virtual machine built especially for Rakudo Perl 6 and the NQP Compiler Toolchain.

To run a Perl 6 program with Rakudo, include the install directory in your system PATH variable and issue a command like:

$ perl6 hello.pl

If the Rakudo compiler is invoked without an explicit script to run, it enters a small interactive mode that allows Perl 6 statements to be executed from the command line. Each line entered is treated as a separate compilation unit, however (which means that subroutines are preserved after they are defined, but variables are not).

Running the test suite

Entering “make test” will run a small test suite that comes bundled with Rakudo. This is a simple suite of tests, designed to make sure that the Rakudo compiler is basically working and that it’s capable of running a simple test harness.

Running “make spectest” will import relevant portions of the official Perl 6 test suite from Github (http://github.com/perl6/roast) and run all of the tests that are currently known to pass.

Note On GCC Version 4.1.2/4.1.3

These versions of GCC contain a bug that prevents building of Rakudo in the way described above. A workaround that has been known to work is to configure with optimization, like this:

perl ./Configure.pl --gen-parrot --gen-parrot-option=--optimize

We’ve looked for a workaround we could do in the code to try and avoid triggering the GCC bug, but there didn’t seem to be an obvious one. Please either try the workaround above, or use a different version of GCC.

Packages

For a number of platforms there are packaged versions of Rakudo (the compiler only), which are very easy to install, but might be out of date.

17 Responses to How to get Rakudo Perl 6

  1. Is there a Debian/Ubuntu package?

    Thanks

  2. Pingback: Perl 6: My first script « Programming notes

  3. But really, no debian/ubuntu package? I thought debian/ubuntu *are* the most popular Linux distributives, aren’t they?

  4. crackcell says:

    wired, no deb package.

  5. Rakudo packages are now available on Debian unstable. I’ve ironed out the last issue with i386 yesterday :-p

    See this announce for some more details.

    All the best

  6. Jeremiah says:

    There is now! The rakudo package and parrot are both packaged for Debian. If you are running Debian testing, code named wheezy, you can just do an apt-get install rakudo. If you’re running Debian stable, you’ll have to download rakudo as a deb and install it.

  7. Ravido says:

    WTF ? What is Rakudo? I was on Perl6.org ?!
    I just clicked on the download button!?
    Well, after the Fisher Price designed Home page with Butterflie,
    I was expecting a User friendly download page with:
    Windows Xp, Vista,7 : Perl6 x86.msi ; Perl6 x86-64.msi
    Debian, Ubuntu : Perl6.deb
    >>Then after the install, I would have clic on the Perl6 icone on my Desktop, et voilà!
    No, I’m told to compile… and blablabla…
    “The only requirement is that you know how to be nice to all kinds of people (and butterflies).”>>> LOL!!! except the beginners under Ubuntu or Windows!

    • F says:

      I must agree with you. Having a 1-click installation and usage access under windows, should not be to much to ask for. This is 2012. I do not mean to be “un-nice” to no-one. But, it should be recognized to be of VERY EXTREMELY very very (extremely) high interest to the perl 6 development that millions of users started using rakudo on their pc’s. Thanks for your work p6 developers. F

  8. j.d. laub says:

    It’s sad some folks don’t understand what “be nice (to volunteers)” means. A little bit of offset to the negative vibe:

    Thank you, Rakudo team. Your directions were clear, and nearly perfect. (The “Running the test suite” section above is slightly outdated, in a minor way.) For some reason, during the install, my perl5.8.5 seemed to silently no-op the chmod of install/bin/perl6 (while perl5.8.3 worked fine); I’ll try to dig into that in a bit. But with little pain, I was able to get a HelloWorld to run, and am getting psyched to start using Perl6 for more than just playing. Nice work!

  9. m6locks says:

    All you Debian/Ubuntu people check this out:

    http://packages.debian.org/sid/rakudo

  10. Rajeev Jha says:

    Here are the instructions for building on mac osx lion
    create a new dir, say nuke and cd to it (xcode should be installed)
    1)wget https://github.com/downloads/rakudo/star/rakudo-star-2011.07.tar.gz
    2) tar -zxvf rakudo-star-2011.07.tar.gz
    3)cd rakudo-star-2011.07
    4)perl Configure.pl –gen-parrot
    5)make
    6)make install
    Run perl6 from
    nuke/rakudo-star-2011.07/perl6

    works like a charm ;o)

  11. Steve Lane says:

    This is awesome!

    On a Debian Stable machine, I did:


    root@debianbox> apt-get install rakudo parrot/testing parrot-minimal/testing parrot-devel/testing

    and it Just Worked.

    Thanks very much!

  12. pflory says:

    Cool. Installed without any problems on Mac OS X, 10.7.2, on Feb 18, 2012
    using the instructions provided:

    $ cd rakudo
    $ perl Configure.pl –gen-parrot
    $ make
    $ make install
    $ make test

    Simple!

  13. irfan says:

    Run rakodu on Mac OS X version 10.7.3

    1)
    download https://github.com/downloads/rakudo/star/rakudo-star-2012.04.tar.gz

    2)
    perl Configure.pl –prefix= –gen-nqp –gen-parrot

    * option enable choice of path where you want to push the binaries of perl6
    It will avoid clash with existing Perl version running in system
    After command executed successfully check prefix dir, it should show following dir’s
    drwxr-xr-x 3 root staff 102 Apr 29 23:06 share
    drwxr-xr-x 3 root staff 102 Apr 29 23:06 include
    drwxr-xr-x 6 root staff 204 Apr 29 23:06 lib
    drwxr-xr-x 3 root staff 102 Apr 29 23:06 src
    drwxr-xr-x 14 root staff 476 Apr 29 23:08 bin

    3)
    make

    4)
    make rakudo-test

    All tests successful.
    Files=23, Tests=227, 15 wallclock secs ( 0.09 usr 0.06 sys + 11.54 cusr 2.86 csys = 14.55 CPU)
    Result: PASS

    5)
    make rakudo-spectest

    6)
    make install

  14. Crisewng says:

    hey everybody
    when i install rakudo alway display this information .
    my system is mac os x 10.7.4
    gcc version is: i686-apple-darwin10-gcc-4.2.1
    gmake version is :Built for x86_64-apple-darwin11.3.0
    perl version is :v5.12.4 ,

    i really need your help .thanks a lot .

    current instr.: ‘compile_file’ pc 1466 (tools/dev/pbc_to_exe.pir:465)
    called from Sub ‘main’ pc 230 (tools/dev/pbc_to_exe.pir:74)
    gmake: *** [parrot-nqp] 错误 1
    Command failed (status 512): gmake install-dev

  15. Patrick Lauer says:

    And of course there are packages for gentoo:

    http://packages.gentoo.org/package/dev-lang/rakudo

    Have fun :)

Leave a Reply