[m-users.] Building Mercury Modules with Functions to be Called from C

Charles Shuller charles.shuller at gmail.com
Wed Sep 12 22:51:13 AEST 2018


Hello,

When attempting to build a library of mercury functions to be called from
C, I wind up individually compiling to C, then using C tools for everything
else.   Is there a better approach??

What I've got working in my Proof of Concept is to compile each module
separately with:

   mmc --grade hlc --compile-to-c  min.m

And then use my C compiler (gcc) on the output C file.

In larger apps, I'd like to try and mirror the approach I use with C, which
is to build a convenience library (i.e. a static lib that is only ever used
by main and unit tests of the project, and is statically linked against)
and call into mercury modules from there.

I thought there was a command that would easily do that, something like:
mmc --make my_lib.a, but I can't find the docs anymore.

Additionally, I am hoisting up my larger projects with CMake, instead of
GNU Make.


Thanks!

Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20180912/667b8ecf/attachment.html>


More information about the users mailing list