[Mkcl-devel] Example of embedding MKCL?

Jean-Claude Beaudoin jean.claude.beaudoin at gmail.com
Wed Oct 1 05:31:45 UTC 2014


On Thu, Sep 18, 2014 at 6:15 AM, Arto Bendiken <arto at bendiken.net> wrote:

> Good morning,
>
> I'm wondering if there is somewhere any example of embedded use of
> MKCL from a C/C++ program? I have not yet located one anywhere.
>
> Attempting to proceed based on examples written for ECL is painful, as
> more has changed than just naming. I have not yet managed to get
> something as simple as [1] ported and to run after half an hour of
> effort.
>

I agree that the lack of ready-made embedding template may be frustrating.
I need to write some rather sooner than later but, you see, the API for it
is in a state of flux right now.
So, if one writes a set of examples for current MKCL 1.1.X then that set
will have to be quite seriously rewritten for upcoming MKCL 1.2.X.

(The dirty secret is that the embeddability template exists, almost
verbatim but in the rough, inside file src/cmp/cmpmain.lsp)


>
> Also, I should mention that I noticed that MKCL built from Git will
> install the shared library as /usr/local/lib/mkcl_1.1.10.so, without
> the customary lib- prefix. This means that in any case the -lmkcl
> linker flag will be ineffective without the manual creation of a
> /usr/local/lib/libmkcl.so symlink.
>

Indeed, internally MKCL has moved away from the -L -l feature of the
(Posix) C linker.
But it has been an unfortunate accident that this internal decision has
spilled over to the external interface.
I think I fixed that in the current Makefile.in on MKCL github master head.
Proper symbolic links should now be produced to support use of -lmkcl.


>
> Is MKCL still meant to usable embedded into C/C++ programs, or has it
> been evolving in other directions?
>

MKCL is more than ever meant  to be embeddable in C/C++ programs although I
have to admit I have not tried the C++ side in a long time.  Deep down,
MKCL's embedability has been significantly refined and improved over its
origins. It's only on its outer surface that appearances may be deceiving.


BTW, a github pull request would have been most welcome on these whole
matters provided that you would have clearly and explicitly stated in it
that the said pull request was provided by you to MKCL under the same
licensing terms as the bulk of the rest of MKCL (which means GNU LGPL). But
that may be for an other day...

Cheers,

Jean-Claude
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/mkcl-devel/attachments/20141001/0c889fa5/attachment.html>


More information about the mkcl-devel mailing list