root/INSTALL

Revision 21703, 10.6 kB (checked in by rhr, 4 months ago)

[INSTALL] howto build Lenny's ghc on Etch: give up

  • Property svn:mime-type set to text/plain; charset=UTF-8
  • Property svn:eol-style set to native
Line 
1Note: To build v6-alpha, see the INSTALL.v6-alpha file instead.
2
3INSTALLING PUGS VIA CABAL
4-------------------------
5
6The current recommended way to build Pugs is via cabal-install.
7
8Follow these steps:
9
101. Make sure you have Cabal, HTTP, zlib and cabal-install installed
11   (in this order):
12
13    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Cabal
14    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP
15    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib
16    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cabal-install
17
18If you're unsure how to install this, the instructions contained in the README
19file of Cabal will help you get started. Those instructions work for all the
20above packages.
21
222. Type the following commands:
23
24    cabal update
25    cabal install Pugs
26
27...and you're done.  To build an optimized Pugs for benchmarking or smoke
28testing, replace the second command with:
29
30    cabal install -O2 Pugs
31
323. To upgrade the current Pugs installation to the latest released version,
33   simply type the same two lines of commands above:
34
35    cabal update
36    cabal install Pugs
37
38INSTALLING PUGS ON CYGWIN
39-------------------------
40For installing pugs on cygwin via cabal, please follow these instructions:
41http://use.perl.org/~rurban/journal/36897
42
43
44
45---8<------8<------8<------8<------8<------8<------8<------8<------8<------8<---
46                   Cut here - Instructions below are outdated!
47---8<------8<------8<------8<------8<------8<------8<------8<------8<------8<---
48
49
50BUILDING PUGS
51-------------
52
53Pugs needs the Glasgow Haskell Compiler (GHC), version 6.8.2 or above.
54
55To install GHC, download a binary build from http://haskell.org/ghc/.
56Although source code for GHC is available, it will take a very long time to
57build by yourself. (Several hours)
58
59Additionally, Pugs uses the Cabal framework (http://haskell.org/cabal/),
60which is usually bundled with GHC itself. (The 6.6.1 source code contains it.)
61
62http://jnthn.net/perl6/ has binary builds for Win32.  For Mac OS X (PowerPC),
63http://www.unobe.com/packages/ has binary builds too. If you'd like to build
64Pugs by hand, http://wiki.kn.vutbr.cz/mj/?Perl%206%20and%20Parrot has some
65instructions.
66
67Debian Etch's (stable as of 2007) version of GHC is too old to compile pugs,
68see the section below on compiling the version from testing.  GHC 6.6.1 debs
69for etch are available (not apt-gettable):
70i386 http://feather.perl6.nl/~diakopter/
71amd64 http://airen.bcm.umontreal.ca/ghc-pugs-etch/
72
73Do not use ActivePerl on OS X to run Makefile.PL.  ActivePerl is built as a
74Universal binary, and the pugs build system will try to use build
75information from ActivePerl and cause the build to fail.  The Perl from
76MacPorts (http://www.macports.org/) seems to work well.
77
78For dynamic loading/inlining of Haskell modules, you should install the
79hs-plugin library, available here:
80
81    http://www.cse.unsw.edu.au/~dons/code/hs-plugins
82
83During the build process, the script will try to install HsJudy (a Haskell binding to the Judy array library written in C). If you don't have Judy installed, this step might fail, so you should install Judy. Most distros include that library.
84
85To install Pugs on your system, simply type this in the command line:
86
87    cpansign -v         # optional; see SIGNATURE for details
88    perl Makefile.PL
89    make                # or 'nmake' on Win32
90    make test
91    make install
92
93Both make and make test can take a long time (perhaps hours).
94
95To change the installation location, pass PREFIX=/opt/wherever to
96Makefile.PL like so:
97
98    perl Makefile.PL PREFIX=/your/prefix/here
99
100XXX NOTE!!!!!!!!
101PREFIX doesn't actually work right now. So ignore what I just said. But if
102it did work, that's how you would do it.
103
104Do not set PREFIX to your Perl 5 installation dir, as that would overwrite
105some of the files there with their Pugs counterparts.
106
107ENVIRONMENT VARIABLES
108---------------------
109
110There are several environment variables that control pugs's build process.
111
112You may use the GHC environment variable to set the ghc executable before
113you run "perl Makefile.PL", for example:
114
115    export GHC=${HOME}/bin/ghc (bash)
116    setenv GHC ${HOME}/bin/ghc (csh)
117
118To control which optional subsystems are embedded in Pugs, set the
119PUGS_EMBED variable. For example:
120
121    export PUGS_EMBED="parrot noperl5" (bash)
122    setenv PUGS_EMBED "parrot noperl5" (csh)
123
124Perl5 is now embedded by default.  Use "noperl5" to disable.
125
126To build with an embedded parrot interpreter, make sure the PUGS_EMBED
127variable contains "parrot", and set the PARROT_PATH variable to point to
128the directory in which you checked out the parrot source tree. For example:
129
130    export PARROT_PATH=${HOME}/src/parrot (bash)
131    setenv PARROT_PATH ${HOME}/src/parrot (csh)
132
133The HARNESS_PUGS environment may come to handy once you want to limit
134CPU and RAM usage of your smoking (*NIX only):
135
136    HARNESS_PUGS=util/limited_pugs make smoke
137
138Modify util/limited_pugs in your local copy if it doesn't fit your needs.
139
140MAKE TARGETS
141------------
142
143The default make target builds an optimized Pugs. This means that Pugs will
144be slower to compile, but will run much faster. To disable this, run:
145
146    make soon
147
148To run the test suite with a pretty HTML matrix showing test results:
149
150    make smoke
151
152(See also the HARNESS_PUGS environment in the previous section.)
153
154To turn on profiling in the GHC compiler:
155
156    make prof
157
158To hack on Pugs using the GHC interactive shell:
159
160    make ghci
161
162BUILD CONFIGURATION CONSOLIDATION VIA config.yml
163------------------------------------------------
164
165To keep the multitude of configuration options and mechanisms under
166control for the build, we're moving over some of the above to a
167centralized file, "config.yml" under the build root. This file is in
168YAML format[1]; if it does not exist, one with defaults will be created
169for you.
170
171The options you can control there include:
172
173- optimization level: whether `make` means `make optimized` or
174  `make unoptimized` by default.
175
176- precompilation options: by default, pugs is built with the Standard Prelude
177  compiled into it. This makes many Perl 6 builtins available to pugs, and
178  loads fast. You can specify additional modules to inline a precompiled
179  version of into the executable: Test.pm is a good choice if running the
180  test suite. The cost of this is a longer build process which requires much
181  more RAM.
182
183- GHC heap size: if precompiling modules other than Prelude.pm into pugs, you
184  will probably need to increase the amount of RAM GHC permits itself to use,
185  otherwise it will abort the build. And if your machine is low on RAM, and
186  itself runs out of memory while building pugs, you can set this to a low
187  value (but turn off optimization and precompilation too).
188
189- install_dir: if set, `make install` will put everything under this
190  directory. Do not set this to your Perl 5 installation, since that
191  will overwrite some of the files there with the Pugs counterparts
192  (as will make install PREFIX= as noted above.)
193
194You can override values set in this file temporarily via the single
195PUGS_BUILD_OPTS environment variable. For example, if you normally do
196precompile Prelude.pm but want a faster build just this once:
197
198    env PUGS_BUILD_OPTS=precompile_prelude=false make
199
200See `util/config-template.yml` for more information.
201
202[1] See <http://yaml.org/>. Only a subset of the YAML syntax is permitted
203at the moment, to avoid a dependency on the full parser.
204
205
206COMPILING GHC ON DEBIAN ETCH
207----------------------------
208
209Note (Aug 2008): Pugs requires ghc 6.8 now.  Lenny has this, but you can't
210reasonably build it on Etch - it build-deps Lenny's gcc, which build-deps
211Lenny's dpkg...  Just install the binary package from http://www.haskell.org/ghc/
212
213This is a somewhat tricky procedure at present, because installing a new ghc may
214make old libghc6-* packages uninstallable.  The following procedure should work
215around that, but be warned it hasn't been tested in exactly this way.  Complain
216on #perl6 if you have trouble.  Thanks to moritz++, Aankhen``++, and diakopter++
217for helping to figure this out. -rhr
218
2191. Compile the new version of GHC from testing:
220    echo 'deb-src ftp://ftp.debian.org/debian/ lenny main contrib non-free' >> /etc/apt/sources.list
221    apt-get update
222    apt-get build-dep ghc6
223    apt-get source --compile ghc6
224    Don't install the debs yet!
2252. Remove old GHC packages
226    dpkg --get-selections|grep ghc
227    Check to see what you'll need to reinstall later
228    apt-get remove haddock
229    dpkg --get-selections|grep ghc|awk '$2 == "install" {print $1}'|xargs apt-get remove
230    dpkg --get-selections|grep libghc
231    Make sure no libghc6-* packages are installed
2323. Install new GHC
233    dpkg -i ghc6_6.6.1-*.deb
234    This may give a warning about not deleting /usr/lib/ghc-6.6, that seems to be harmless
2354. Satisfy build-deps for GHC libs
236    apt-get build-dep haddock
237    apt-get source --compile haddock
238    dpkg -i haddock*.deb
239    apt-get build-dep haskell-utils
240    apt-get source --compile haskell-utils
241    dpkg -i haskell-utils*.deb
242    dpkg -i ghc6-doc_6.6.1-*.deb
243    dpkg -i ghc6-prof_6.6.1-*.deb
244    apt-get build-dep libghc6-mtl-dev libghc6-network-dev libghc6-time-dev
2455. Build and install GHC libs
246    apt-get source --compile libghc6-mtl-dev
247    dpkg -i libghc6-mtl-dev*.deb
248    apt-get source --compile libghc6-network-dev
249    dpkg -i libghc6-network-dev*.deb
250    apt-get source --compile libghc6-time-dev
251    dpkg -i libghc6-time-dev*.deb
252
253
254NOTES FOR GHC 6.6.1 AND REVISION > 19955
255----------------------------------------
256
257This is only a way to get a running pugs with ghc 6.6.1 during the
258migration phase to ghc 6.8.x. It does *NOT* solve any issues. It is tested
259with the  following environment (I believe only the ghc part is essential for
260this workaround):
261
262- GNU/Linux 2.6.22-14
263- libc6 2.6.1-1ubuntu10
264- gcc-Version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
265- perl 5.8.8
266- Cabal-1.1.6.2, base-2.1.1, filepath-1.0, (ghc-6.6.1),
267  haskell98-1.0, mtl-1.0.1, network-2.0.1, parsec-2.0, readline-1.0,
268  regex-base-0.72, regex-compat-0.71, regex-posix-0.71, rts-1.0,
269  stm-2.0, template-haskell-2.1, time-1.1.1, unix-2.1
270
271The last revision that builds directly from repository on this environment
272was r19955.
273
2741. Update to current version
275  svn update .
276
2772. Revert some files to former version
278  svn update -r19955 src/Pugs/Meta/Str.hs src/Pugs/Types.hs src/UTF8.hs \
279            Pugs.cabal.in util/build_pugs.pl third_party/ \
280            src/Pugs/Compile/Pugs.hs src/Pugs/Eval.hs
281
2823. Build it ...
283  perl Makefile.PL && make
284
2854. ..possibly twice, if it failed
286  make
287
2885. Skip building Test.pm.yml
289  cp ext/Test/lib/Test.pm blib6/lib/
290
291Last two steps seems sometimes to be necessary to avoid messages like this
292  ./pugs -CParse-YAML ext/Test/lib/Test.pm > blib6/lib/Test.pm.yml
293  pugs: user error (Not implemented: asYAML "Sub")
Note: See TracBrowser for help on using the browser.