Subject: Re: newbie graphics question
From: rpw3@rpw3.org (Rob Warnock)
Date: Fri, 12 Dec 2003 06:10:02 -0600
Newsgroups: comp.lang.lisp,comp.lang.scheme
Message-ID: <UfycnUrVarmHLUSiXTWc-g@speakeasy.net>
Kenny Tilton  <ktilton@nyc.rr.com> wrote:
+---------------
| Anyway, CL folks call C libs (such as OpenGL) all the time using the 
| FFI. And in CL we load libs dynamically (tho I suppose you could build 
| your own CMUCL and link it against some other lib at the same time, but 
| I just made that up so don't bet on it).
+---------------

If you don't want to build special images for every possible combination
of FFI code you might use, what you can also do that works on a standard
image (at least on FreeBSD, Linux, and several others) and that I find
much more convenient than CMUCL's LOAD-FOREIGN (which always fork/execs
the Unix linker as a child process!) is to separately pre-compile/load
your C code as a ".so" (DSO) sharable library (using the same flags the
linker that's run by LOAD-FOREIGN would use for your platform), and use
the internal routine SYSTEM::LOAD-OBJECT-FILE to do the "dlopen()". Just
remember to ensure that the DSO is loaded *both* in the compiler image
when compiling files that ALIEN:DEF-ALIEN-ROUTINE functions in that DSO,
*and* at run time before any of those routines are called.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607