[m-users.] Compiling Mercury code to High Level C step by step

Julien Fischer jfischer at opturion.com
Fri May 10 10:28:33 AEST 2019

On Thu, 9 May 2019, Ramesh Suri wrote:

> Is the High Level C backend mature?


> I have a program test.m which I want to compile to high level C and then compile the high level C. So say my program is hello.m, then I want to do:
> mmc [Some Mercury Options] hello.m

    $ mmc --grade hlc.gc hello

will compile the program using the high-level C backend.

> After this I want to see a file hello.c (and possibility other files too).
> Then I want to do:
> gcc [Some gcc options] hello.c [and maybe other files too]
> And this should generate hello executable.
> What are these commands?

The Mercury compile will invoke the C compiler etc for you.  If you want
to see how it invokes the C compiler, use the option --verbose-commands.


More information about the users mailing list