How to install Mercury lang?

Installing Mercury can be an intimidating process. Here are the steps I followed to get Mercury lang up and running.

  1. Download the latest ROTD. Thistutorial uses a ROTD dated 2018-04-30, you should replace this datethroughout.
  2. Uncompress the source archive
    :::bash
    $ tar -xzf mercury-srcdist-rotd-2018-04-30.tar.gz
  1. Configure the installation to use only a few grades. This will save you a tonof compile time. Later if you decide you need more advanced features you cancompile additional grades.
    :::bash
    $ cd mercury-srcdist-rotd-2018-04-30
    $ sudo apt-get install build-essential flex bison
    $ ./configure --disable-most-grades
At this point you may be asked to install additional dependencies. Install
the dependencies and keep running `./configure` until it succeeds.
  1. Build the project
    :::bash
    $ make
  1. Install the project
    :::bash
    $ make install
  1. Add mercury to your PATHs. Add the following lines to your ~/.bashrc(~/.bash_profile on a mac).
    :::bash
    export PATH="/usr/local/mercury-rotd-2018-04-30/bin:$PATH"
    export MANPATH="/usr/local/mercury-rotd-2018-04-30/man:$MANPATH"
    export INFOPATH="/usr/local/mercury-rotd-2018-04-30/info:$INFOPATH"
  1. Close the terminal and open a new one. Or $ source ~/.bashrc
  2. Get learning