Hi,

The `c:build-shared-library' solution built by calling the attached lisp
file with the following from a Makefile

   ecl -norc -shell ecl-build.lisp

has been working very well and results in a surprisingly stable OCaml
Lisp hybrid executable.

However the current solution loads required libraries (e.g., alexandria)
at runtime and depends on a local instillation of quicklisp.  Would it
be possible to compiling all dependencies into a single linked library
with no external runtime dependencies using `c:build-shared-library'?
Something like a ":monolithic t" option?

Thanks -- Eric

Attachment: ecl-build.lisp
Description: Binary data

Eric Schulte <schulte.e...@gmail.com> writes:

> Juan Jose Garcia-Ripoll <juanjose.garciarip...@googlemail.com> writes:
>
>> On Sat, Jun 25, 2011 at 8:48 PM, Eric Schulte <schulte.e...@gmail.com>wrote:
>>
>>> Thank you, such an interface sounds ideal.  Do you have any idea of a
>>> time scale for such an implementation, e.g., on the order of days weeks
>>> or months?
>>>
>>
>> I just finished the following patch:
>>
>
> Wow, I should have included hours and minutes in my orders of magnitude
> for implementation ETA.
>
> Thanks for the quick implementation, I'll begin using this new
> functionality immediately and get back to you if I run into any
> problems.
>
> Cheers -- Eric
>
>>
>>  - When building shared and statically linked libraries, ECL creates
>>  an extra function that performs two tasks: initializing ECL if it
>>  wasn't done before, and initializing the library. This can be used to
>>  create standalone libraries to be linked with other programs. The
>>  name of the function typically begins with main_dll or main_lib but
>>  it is output by ECL on screen.
>>
>> An example is shown below. It has been uploaded to CVS/git but it might not
>> be functioning perfectly because of other issues -- namely the thing with
>> compiled data mentioned on a separate thread, which is still under testing.
>>
>> Feel free to report problems. Best,
>>
>> Juanjo
>>
>> $ ecl -norc
>> ECL (Embeddable Common-Lisp) 11.1.1
>> Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
>> Copyright (C) 1993 Giuseppe Attardi
>> Copyright (C) 2000 Juan J. Garcia-Ripoll
>> ECL is free software, and you are welcome to redistribute it
>> under certain conditions; see file 'Copyright' for details.
>> Type :h for Help.
>> Top level.
>>> (si::system "cat foo.lsp")
>> (defun foo (x)
>>  (print x))
>>
>> 0
>>> (defparameter *object* (compile-file "foo" :system-p t :verbose nil))
>>
>> ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/cmp.fas"
>> ;;; Compiling (DEFUN FOO ...).
>> ;;; Emitting code for FOO.
>> ;;; Note:
>> ;;;   Invoking external command:
>> ;;;   gcc -I. -I/Users/jjgarcia/include/ -g -O2 -fPIC -fno-common -Ddarwin
>> -O2 -w -c foo.c -o foo.o
>> *OBJECT*
>>> (c:build-shared-library "foo" :lisp-files (list *object*))
>>
>> ;;; Note:
>> ;;;   Library initialization function is main_dll_FOO
>> [...]
>>
>> In this case
>>
>> main_dll_FOO(int argc, char **argv);
>>
>> is the initialization routine of the library. Note that this calls cl_boot()
>> but _you_ should manually insert a call to cl_shutdown() somewhere in your
>> program.
>>
>> Juanjo

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to