[m-users.] Support installing Mercury

Zoltan Somogyi zoltan.somogyi at runbox.com
Thu Mar 29 12:12:11 AEDT 2018



On Wed, 28 Mar 2018 10:03:05 -0400, Astrid Garcia <mellgarcia0397 at gmail.com> wrote:
> My name is Astrid. I am trying to install Mercury in my Linux machine but
> it seems like it is not installing properly. I downloaded the package,
> unzipped it and put it in my Documents. Then I open the "Install" document
> to follow the steps. Using the command line I did "sh configure". It said
> that I needed 2 other packages, Bisno was one of them and I install them
> and it ran, then I run "make" and it worked fine, the next step was to run
> "make install" and it gave me an error when it tried to process the script
> "mkdir -p /usr/local/mercury-14.01/bin " so I created the bin directory
> using my path, the path of my computer where the directory of mercury is
> located. I typed "mkdir -p /home/astrid/Documents/mercury-14.01/bin", then
> it made the directory but nothing else ran. The next step was to run "make
> clean" so I did it and it ran everything. I am unsure if it install
> correctly since it gave me an error in the "make install" step and I
> created the directory in a different way. Then the process ended but I
> created a testing file with ".m" and I don't know how to call the compiler
> to test the file.

I agree with what Charles Schuller said, but have some other comments as well.

"mkdir" is a standard Unix command; it is not part of Mercury. The command
"mkdir -p /home/astrid/Documents/mercury-14.01/bin" just makes the named
directory; it is *not surprising* that it did not install Mercury. (In fact, it would
have been an enormous surprise if it *did*.) When an install process fails
somewhere in the middle, it is not enough to try to replace the failed step;
you have to somehow complete the *rest* of the install process as well.

The Mercury 14.01 distribution contains .c files that are generated by the Mercury
compiler (on the machine that created the distribution). The "mmake clean" command
deletes all such auto-generated .c files. Since your machine has no working
Mercury compiler installed on it yet, it cannot rebuild those files from their Mercury
sources. This means that your only choice is to delete the directory you tried to install from,
and start the installation process from scratch, starting with unpacking the tar file again.

If I were you, I would not put anything to do with Mercury under Documents.
None of the Mercury distribution, the Mercury installation, or Mercury programs
are documents.

If you have superuser privileges on the machine you are trying to install Mercury on,
then putting "sudo" in front of "make install", as Charles Schuller says,  should work
to install Mercury in /usr/local. If you don't have such privileges, or simply want to
install Mercury somewhere else, then you should give an argument such as
"--prefix=/home/astrid/mercury_installation" to configure. This will put the
Mercury compiler mmc into /home/astrid/mercury_installation/bin.
You will need to add this directory to your PATH before you can use it
to compile Mercury programs.

Zoltan.


More information about the users mailing list