forked from rakudo/rakudo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
174 lines (132 loc) · 7.17 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Build requirements (Installing from source)
For building Rakudo you need at least a C compiler, a "make" utility,
and Perl 5.8 or newer. To automatically obtain and build MoarVM
as well as NQP, you may also need a git client, which is also needed
for fetching the test suite.
Building rakudo can take up to 1G of memory when compiling for the
MoarVM runtime. The requirements are higher for the JVM backend.
(Perl is installed by default already). To enable parallel testing you
also need the CPAN module Test::Harness in version 3.16 or newer; you
can control the number of parallel jobs with the "TEST_JOBS" environment
variable.
Building and invoking Rakudo
If you're wanting the bleeding-edge version of the Rakudo Perl 6
compiler, we recommend downloading Rakudo directly from Github
and building it from there.
$ git clone git://github.com/rakudo/rakudo.git
If you don't have git installed, you can get a tarball of Rakudo
from <http://rakudo.org/downloads/rakudo/>. Then unpack the
tarball.
If you already have cloned Rakudo from github, you can get (pull) the
most recent version from github like this:
$ cd rakudo
$ git pull
Once you have an up-to-date copy of Rakudo, build it as follows:
$ perl Configure.pl --gen-moar --gen-nqp --backends=moar # Moar only
or:
$ perl Configure.pl --gen-nqp --backends=jvm # needs JDK 1.7 installed
then:
$ make
This will create a "perl6" or "perl6.exe" executable in the current
(rakudo) directory. Additionally, for each selected backend, there will
be a perl6-* binary. Note that if you have multiple (Perl 5) "perl"s in
your path, you may need to use a fully qualified path to the appropriate
executable (or update your PATH environment variable).
Programs can then be run from the build directory using a command like:
$ ./perl6 hello.pl
Simply running "perl6" will drop you into a REPL (read-eval-print-loop)
that you can use for exploratory programming:
$ ./perl6
If you would like readline-like features, such as command history, line
editing, and tab completion for builtins, you should install the Linenoise
module via panda:
$ panda install Linenoise
Important: To run Rakudo from outside the build directory, you must run
$ make install
This will install the "perl6" (or "perl6.exe" binary on windows) into
the "install/bin" directory locally, no additional root
privileges necessary.
If you want to have perl6, nqp, and moar installed into a
different directory, you may supply --prefix= to Configure.pl.
The "--gen-moar" above option tells Configure.pl to automatically
download and build the most appropriate version of NQP and MoarVM
into local "nqp/" and "moar/" subdirectories, install NQP and MoarVM
into the "install/" subdirectory, and use them for building Rakudo.
It's okay to use the "--gen-moar" option on later invocations of
Configure.pl; the configure system will re-build NQP and/or MoarVM
only if a newer version is needed for whatever version of Rakudo
you're working with.
If you already have MoarVM installed, you can use
"--with-moar=/path/to/bin/moar" to use it instead of
building a new one. This installed MoarVM must include its
development environment. Similarly, if you already have NQP
installed, you can specify "--with-nqp=/path/to/bin/nqp"
to use it. (Note that this must be NQP, not the NQP-rx that
comes with MoarVM.)
The versions of any already installed NQP or MoarVM binaries must
satify a minimum specified by the Rakudo being built -- Configure.pl
and "make" will verify this for you. Released versions of Rakudo
generally build against the latest release of MoarVM; checkouts of
Rakudo's HEAD revision from Github often require a version of MoarVM
that is newer than the most recent MoarVM monthly release.
Once built, Rakudo's "make install" target will install Rakudo and its
libraries into the directories specified by the MoarVM installation
used to create it or whatever you specified with the --prefix flag.
Until this step is performed, the "perl6" executable created by "make"
above can only be reliably run from the root of Rakudo's build directory.
After "make install" is performed, the installed executable can be run
from any directory (as long as the MoarVM installation that
were used to create it remain intact).
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 an interactive prompt.
See the manual page ("docs/running.pod") for more about command-line
options.
Build/install problems
Occasionally, there may be problems when building/installing Rakudo.
Make sure you have a backup of any custom changes you have done to the
source tree before performing the following steps:
Try to remove the "install/" subdirectory:
$ cd rakudo
$ rm -r install
$ git pull
$ perl Configure.pl --gen-moar --gen-nqp --backends=moar # for instance
$ make
Or, in case you are really stuck, start with a fresh source tree:
$ rm -r rakudo
$ git clone git://github.com/rakudo/rakudo.git
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 the official Perl 6 test suite from
the "roast" repository <http://github.com/perl6/roast/> and run all
of these tests that are currently known to pass.
You can compare your own results to the results of the daily runs in
<https://github.com/coke/perl6-roast-data/>.
At present we do not have any plans to directly store the official test
suite as part of the Rakudo repository, but will continue to fetch it
from the roast repository. Releases of Rakudo get a snapshot of
the roast repository as of the time of the release.
You can also use "make" to run an individual test from the command line:
$ make t/spec/S29-str/ucfirst.t
t/spec/S29-str/ucfirst.rakudo ..
1..4
ok 1 - simple
ok 2 - empty string
ok 3 - # SKIP unicode
ok 4 - # SKIP unicode
# FUDGED!
ok
All tests successful.
Files=1, Tests=4, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.57 cusr 0.06 csys = 0.65 CPU)
Result: PASS
If you want to run the tests in parallel, you need to install a fairly
recent version of the Perl 5 module Test::Harness (3.16 works for sure).
Spectest smolder requirements (Windows)
You need recent version of either Strawberry Perl or ActiveState Perl.
If you are working with ActiveState Perl you need the Mingw gcc compiler.
You need msys git installed and you need "\Program Files\Git\cmd" on your
execution path and NOT "\Program Files\Git\bin".
You need a win32 curl program.