Statically linking C code into ECL
Daniel Kochmański
daniel at turtleware.eu
Mon Dec 26 16:32:32 UTC 2016
Gabriel Dos Reis writes:
> On Mon, Dec 26, 2016 at 8:06 AM, Daniel Kochmański <daniel at turtleware.eu>
> wrote:
>
>> Faré writes:
>>
>> > Is there an official or encouraged way?
>>
>> No.
>>
>
> Should there be one?
Imho the best way to build C sources against ECL is to produce ELF from
ECL (object file, shared object, static library) and use it as one of
the libraries you use in your C application (such example is shown in
exmaples/build/ – used build tool is make). If you want to use C/C++
libraries in CL application there is FFI for that. To put it in another
words, ECL is meant to be embeddedable in C/C++ application, not to make
a platform for embedding C/C++ libraries in Common Lisp.
The question about an official or encouraged way for compiling lisp
files with c files inside the C::BUILDER interface is a question,
whenever builder should be used for compiling CL libraries/applications
or if it should be a general-purpose building tool (or at least a
building tool for both Common Lisp and C/C++).
I think that to keep things sane we should stick to the first
interpretation, but if there are good reasons for the latter I'm not
ruling out adding official support for making C::BUILDER a wrapper
around C toolchain. I just don't see valid reasons for that.
>
> I've lost (for a year or two) ability to build OpenAxiom with ECL and I've
> found it more and more difficult and time consuming to debug building
> programs with ECL that involves some C and C++ source libraries.
Please file a bug if you can track down the cause of such situation (or
provide easy to follow reproduce steps) at
https://gitlab.com/embeddable-common-lisp/ecl/issues/ .
Best reagards,
Daniel
--
Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland
TurtleWare - Daniel Kochmański | www.turtleware.eu
"Be the change that you wish to see in the world." - Mahatma Gandhi
More information about the ecl-devel
mailing list