[gambit-list] quest for running gambit on POS embedded devices

Bradley Lucier lucier at math.purdue.edu
Mon Mar 5 16:25:39 EST 2012


On Mon, 2012-03-05 at 11:31 -0500, Marc Feeley wrote:

> I can feel your pain and determination.  So here are some ideas which
> should help debug this.
> 
> 1) Make sure you use --enable-ansi-c when configuring Gambit.  This
> will force the use of a small subset of the ANSI-C headers and
> libraries (such as stdio.h, stdlib.h, math.h).  This is the place to
> start for a small embedded device with minimal peripherals.  If you
> are compiling with your own makefile, this will happen automatically
> (unless you have a config.h or other header file which defines
> HAVE_WAITPID, which causes lib/os.h to assume you are on a POSIX
> system with all the POSIX goodies).


If you build Gambit on a linux box, say, then in lib/_num.scm change


(##define-macro (use-fast-bignum-algorithms) #t)


to


(##define-macro (use-fast-bignum-algorithms) #f)


and rebuild Gambit (to update _num.c), then you will get rid of the
extra code for the "fast" bignum algorithms and save about 150KB on my
box (which isn't a lot, but every sometimes every byte counts).  Before:


heine:~/programs/gambc-v4_6_4-devel> ll */*.so
-rwxrwxr-x 1 lucier lucier 6676291 2012-02-23 13:49 lib/libgambc.so*


After:


heine:~/programs/gambc-v4_6_4-devel> ll */*.so
-rwxrwxr-x 1 lucier lucier 6526571 2012-03-05 11:42 lib/libgambc.so*


Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20120305/d495597f/attachment.htm>


More information about the Gambit-list mailing list