From: Edward Wilson
Subject: compiling lisp with GCL
Date: 
Message-ID: <5174eed0.0407311127.2abcf398@posting.google.com>
Can someone point me to some documentation on how to compile Lisp to C
(machine) using GCL; I have looked everywhere and can not find
anything on how to do this.    The whole reason I installed gcl in the
first place was to be able to compile Lisp to C, I had no problems
compiling gcl, it runs great--but now I want to compile Lisp programs
to C and can not find any documentation anywhere.

-
ed

From: Christian Pietsch
Subject: Re: compiling lisp with GCL
Date: 
Message-ID: <cegv60$2ied8$1@hades.rz.uni-saarland.de>
Edward Wilson wrote:
> Can someone point me to some documentation on how to compile Lisp to C
> (machine) using GCL; I have looked everywhere and can not find
> anything on how to do this.

The command-line switch you want to use is ``-c-file''.
Try something like this:

$ gcl -c-file -compile mandelbrot.lisp

Afterwards, you will find a file mandelbrot.c in your current
directory.

The switch is mentioned in the man page. For me, this works:
$ man 1 gcl

Cheers,
Christian

-- 
  Christian Pietsch
  http://www.interling.de
From: Edward Wilson
Subject: Re: compiling lisp with GCL
Date: 
Message-ID: <5174eed0.0408011439.593540d4@posting.google.com>
> $ gcl -c-file -compile mandelbrot.lisp

Ok, this worked, thank you.  Do I have to link against a particular
lib, I was not able to link - see output below:
 
[····@webwarrior lisp]$ gcc -o callme callme.c testme.o -I.
testme.o: In function `L1':
testme.o(.text+0x4): undefined reference to `vs_limit'
testme.o(.text+0xa): undefined reference to `vs_base'
testme.o(.text+0x10): undefined reference to `vs_top'
testme.o(.text+0x1a): undefined reference to `vs_overflow'
testme.o(.text+0x20): undefined reference to `Ct_body'
testme.o(.text+0x2e): undefined reference to `vs_base'
testme.o(.text+0x34): undefined reference to `vs_top'
testme.o: In function `init_code':
testme.o(.text+0x49): undefined reference to `do_init'
testme.o: In function `L1':
testme.o(.text+0x3c): undefined reference to `Lformat'
collect2: ld returned 1 exit status
[····@webwarrior lisp]$ 


> The switch is mentioned in the man page. For me, this works:
> $ man 1 gcl
This didn't work for me, perhaps ``make install'' did not install the
man pages.

-
ed
From: Camm Maguire
Subject: Re: compiling lisp with GCL
Date: 
Message-ID: <54isbxi9x6.fsf@intech19.enhanced.com>
Greetings!

Compiled objects must be linked from within gcl itself.  Try:

gcl
>(compile-file "foo.lisp")
>(load "foo.o")
>....run your compiled functions...

or if your file has top level commands:

gcl -compile foo.lisp
gcl -batch foo.o

Take care,

······@yahoo.com (Edward Wilson) writes:

> > $ gcl -c-file -compile mandelbrot.lisp
> 
> Ok, this worked, thank you.  Do I have to link against a particular
> lib, I was not able to link - see output below:
>  
> [····@webwarrior lisp]$ gcc -o callme callme.c testme.o -I.
> testme.o: In function `L1':
> testme.o(.text+0x4): undefined reference to `vs_limit'
> testme.o(.text+0xa): undefined reference to `vs_base'
> testme.o(.text+0x10): undefined reference to `vs_top'
> testme.o(.text+0x1a): undefined reference to `vs_overflow'
> testme.o(.text+0x20): undefined reference to `Ct_body'
> testme.o(.text+0x2e): undefined reference to `vs_base'
> testme.o(.text+0x34): undefined reference to `vs_top'
> testme.o: In function `init_code':
> testme.o(.text+0x49): undefined reference to `do_init'
> testme.o: In function `L1':
> testme.o(.text+0x3c): undefined reference to `Lformat'
> collect2: ld returned 1 exit status
> [····@webwarrior lisp]$ 
> 
> 
> > The switch is mentioned in the man page. For me, this works:
> > $ man 1 gcl
> This didn't work for me, perhaps ``make install'' did not install the
> man pages.
> 
> -
> ed

-- 
Camm Maguire			     			····@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah
From: Alex Mizrahi
Subject: Re: compiling lisp with GCL
Date: 
Message-ID: <2n2bagFruco2U1@uni-berlin.de>
(message (Hello 'Edward)
(you :wrote  :on '(31 Jul 2004 12:27:11 -0700))
(

 EW> Can someone point me to some documentation on how to compile Lisp to
 EW> C (machine) using GCL; I have looked everywhere and can not find
 EW> anything on how to do this.    The whole reason I installed gcl in
 EW> the first place was to be able to compile Lisp to C, I had no
 EW> problems compiling gcl, it runs great--but now I want to compile
 EW> Lisp programs to C and can not find any documentation anywhere.

have you tried (compile-file "myfile.lisp")? 8-]

(afaik) gcl and ecl first produce C file from lisp, then compile them using
gcc and dyn-load result. with some switches you can say it too keep
temporary C file to see what's in it.

however, it will be not standalone C file - it requires core with library of
Lisp functions. but i think you can link it all into one executable, add C
code there and so on..

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
(prin1 "Jane dates only Lisp programmers"))