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.
- Download the latest ROTD. Thistutorial uses a ROTD dated 2018-04-30, you should replace this datethroughout.
- Uncompress the source archive
:::bash
$ tar -xzf mercury-srcdist-rotd-2018-04-30.tar.gz- 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.- Build the project
:::bash
$ make- Install the project
:::bash
$ make install- Add mercury to your PATHs. Add the following lines to your
~/.bashrc(~/.bash_profileon 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"- Close the terminal and open a new one. Or
$ source ~/.bashrc - Get learning