Permalink
Switch branches/tags
version-14_01_1 version-14_01 version-13_05_2 version-13_05_1 version-13_05 version-12_08-branchpoint version-12_08-GIT version-11_07_2 version-11_07_1 version-11_07 version-11_07-branchpoint version-11_01 version-11_01-branchpoint version-10_04_2 version-10_04_1 version-10_04 version-10_04-branchpoint version-0_13_1 version-0_13-branchpoint version-0_12_2 version-0_12_1 version-0_12-branchpoint version-0_11_0 version-0_11-branchpoint version-0_10 version-0_9_1 version-0_9 version-0_9_x-snapshot version-0_9_x-snapshot-19991220 unstable-version-0_13_1-x86_64-unknown-linux-gnu-libc2_3 unstable-version-0_13_1-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_13-branch-x86_64-unknown-linux-gnu-libc2_3 unstable-version-0_13-branch-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_12_2-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12_2-i386-pc-solaris2_8 unstable-version-0_12_1-i686-pc-linux-libc2_3-gnu-O4-intermod unstable-version-0_12_1-i686-pc-linux-libc2_3-gnu-O2 unstable-version-0_12_1-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12_1-i386-pc-solaris2_8 unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O5 unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O4-intermod unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O4-hlc unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O2 unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O5 unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O3 unstable-version-0_12-branch-i386-pc-solaris2_8 unstable-version-0_11_0-sparc-sun-solaris2_7 unstable-version-0_11_0-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5 unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-lcc unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-hlc unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4-asm unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O3 unstable-version-0_11_0-i386-pc-solaris2_8 unstable-version-0_11-branch-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-hlc unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-hlc unstable-version-0_11-branch-alpha-dec-osf5_1 unstable-version-0_10_y-sparc-sun-solaris2_7 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-intermod unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-hlc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O4-hlc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O2 unstable-version-0_10_y-i586-pc-linux-libc2_1-gnu-O0 unstable-version-0_10_y-alpha-dec-osf5_1 unstable-version-0_10_y-alpha-dec-osf3_2 unstable-version-0_10_x-sparc-sun-solaris2_7 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O4-hlc unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O3 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O2 unstable-version-0_10_x-i586-pc-linux-libc2_1-gnu-O0 unstable-version-0_10_x-alpha-dec-osf3_2 termination2_trunk stable-version-0_11_0-i686-pc-linux-libc2_3-gnu-O5-intermod stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5 stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-lcc stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-hlc stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4 stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4-asm stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O3 stable-version-0_11-branch-i686-pc-linux-libc2_3-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-lcc stable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5 stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-lcc stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-hlc stable-version-0_11-branch-alpha-dec-osf5_1
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
101 lines (82 sloc) 4.24 KB
INTRODUCTION
============
Michael T. Richter <ttmrichter@gmail.com>
This document explains the process of bootstrapping a Mercury environment from
the Git repository.
PREREQUISITES
-------------
If you do not have a Mercury environment already set up on your system, you
cannot build the Mercury compiler from revision control, full stop. Mercury,
like almost every other self-hosted natively-compiled language, needs itself to
compile itself. To accomplish this you will have to build one of the releases:
either a numbered release (like, say, 11.07.2) or one of the ROTD releases. For
purposes of bootstrapping from the master branch of the Git repository it is
recommended to start with the most recent ROTD release since older versions of
the Mercury compiler are frequently not able to build the bleeding edge in Git.
The releases can be downloaded from the Mercury website's downloads page:
http://dl.mercurylang.org/index.html.
Other prerequisites can be found in relevant README.* files in the
distribution's root directory.
BUILDING THE PREREQUISITE RELEASE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default the Mercury distribution builds a number and variety of "grades"
(c.f. the user guide). Building numerous grades is overkill for purposes of
bootstrapping. After downloading and expanding the selected prerequisite, the
following command sequence should be issued:
----
./configure --enable-minimal-install
make
sudo make install
----
This will do the minimal build necessary to have a usable Mercury compiler for
bootstrapping. Note that once this prerequisite release is built, there is no
further need for tarballs when building Mercury from Git.
BOOTSTRAPPING
-------------
Once the minimal prerequisite compiler has been built and installed, a
reasonably complete distribution can be bootstrapped. However the build
tree must be clean or the build may fail. Clean and then build the complete
distribution by issuing the following command sequence:
----
make realclean
./prepare.sh
./configure
make
sudo make install
----
This, however, will take a surprisingly long time by most prospective users'
standards. (In particular the `make install` phase will take a very long time.)
This is because, as mentioned above, Mercury compiles its standard library in a
number of grades. The number of grades, and therefore build time, can be
reduced by using the configure script's `--enable-libgrades=<grade list>`
option, where <grade list> is a comma separated list of grades. For information
about which grades may be relevant, see the documentation on grades and grade
components:
http://www.mercurylang.org/information/doc-latest/mercury_user_guide/Grades-and-grade-components.html
People wanting to simply experiment with Mercury would be best-served with
using only the `asm_fast.gc` grade or `hlc.gc` on OS X.
Since building Mercury can take a long time, you may prefer to use multiple
processors during the build process. Adding "PARALLEL=-jN" without the
quotes to make's command line will tell make to run N tasks at once.
Substitute N with the number of processors in your system, or fewer if you
want to use other processors for other tasks. For example:
----
make PARALLEL=-j4
sudo make PARALLEL=-j4 install
----
ALTERNATIVES TO BOOTSTRAPPING
-----------------------------
Unless you are planning to contribute to the Mercury project, bootstrapping
from the SCM head is likely not a desired approach. For just experimenting
with and/or learning the language the best approach is to either download one
of the stable (numbered, like 11.07.2) releases or, if you want to experiment
with the latest and greatest features, one of the more recent ROTD releases.
Doing this eliminates the need to build the compiler twice since a full build
and install can be done directly from the tarballs.
One possible reason to go through a bootstrap (or at least through a quick
`asm_fast.gc` build followed by a more complete build) is that on 64-bit
systems in specific, a bootstrapped compiler is very slightly faster than one
built once from the tarballs. This is because the tarballs must be compatible
with both 32- and 64-bit systems while a bootstrapped system can take advantage
of 64-bit specific enhancements.
We strongly recommend the use of the `hlc.gc` grade on OS X (See README.MacOS).