From: Russell Wallace
Subject: Compiling with GCL on Windows
Date: 
Message-ID: <f3df1bdb-2068-4eef-9318-bb41999b0de8@8g2000hse.googlegroups.com>
I have a GCL install on Windows that works fine in interpreter mode,
and I'm trying to get it to compile a program, i.e. via GCC. Google
finds the following suggested methods:

(compile-file "main.lisp":system-p t)
(compiler::link '("main.o" "libuser32.a") "main.exe")

Result:

Compiling main.lisp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0,
Speed=3
Finished compiling main.lisp.
'.' is not recognized as an internal or external command,
operable program or batch file.

C:\ayane>dir *.exe
 Volume in drive C is OS
 Volume Serial Number is 0422-C2D0

 Directory of C:\ayane

29/10/2008  09:43           454,232 raw_main_map.exe
               1 File(s)        454,232 bytes
               0 Dir(s)  67,711,852,544 bytes free

C:\ayane>raw_main_map.exe
Program too big to fit in memory

The other suggested method:

C:\ayane>\PROGRA~1\GCL-2.6.6-ANSI\lib\gcl-2.6.6\unixport
\saved_ansi_gcl -compile
 main.lisp

Compiling main.lisp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0,
Speed=3
Finished compiling main.lisp.

C:\ayane>gcc -o main.exe main.o \PROGRA~1\GCL-2.6.6-ANSI\mingw\lib
\libuser32.a
main.o(.text+0xb):main.c: undefined reference to `vs_base'
main.o(.text+0x17):main.c: undefined reference to `vs_limit'
main.o(.text+0x1d):main.c: undefined reference to `vs_top'
[a couple more screenfuls of undefined references]

In both cases, the problem isn't with the compiling step per se, but
with the linking. Any idea what I'm doing wrong or what the correct
procedure is?

(I'm trying to do this for two reasons: I want to do some stuff that
will eventually need to run as fast as possible, and I would also like
to be able to use a profiler; are there better ways to achieve these
objectives?)

From: ········@gmail.com
Subject: Re: Compiling with GCL on Windows
Date: 
Message-ID: <3a14b382-7fd7-46fa-888f-f23558eb762b@m73g2000hsh.googlegroups.com>
Russell Wallace:
> I have a GCL install on Windows

I would suggest:

(substitute #\E #\G "GCL")

-PM
From: ·······@eurogaran.com
Subject: Re: Compiling with GCL on Windows
Date: 
Message-ID: <0de4b1e3-9422-4473-85b6-c608fcfc831d@8g2000hse.googlegroups.com>
> (substitute #\E #\G "GCL")
Of course ECL was designed with memory restrictions in mind, but the
error message:
"Program too big to fit in memory."
can indicate a more general problem with Gweendoves memory management
configuration.
Just "let Windows manage virtual memory", since the user is considered
too stupid to do it.
(if want-work-done (replace-ASAP "Windows" "Linux"))
From: Russell Wallace
Subject: Re: Compiling with GCL on Windows
Date: 
Message-ID: <b5eb2599-a7e4-426a-88c7-2c1ce3e153fb@y29g2000hsf.googlegroups.com>
On Oct 29, 11:17 pm, ········@gmail.com wrote:
> (substitute #\E #\G "GCL")

I had the impression ECL was intended for, well, embedded work; but
maybe I'm wrong. Is there a simple out-of-the-box procedure for using
it to compile a Lisp program and run a profiler on the result?
From: ········@gmail.com
Subject: Re: Compiling with GCL on Windows
Date: 
Message-ID: <ba68001b-5489-470b-a59f-a5652c2ddb36@v30g2000hsa.googlegroups.com>
On 30 Ott, 14:21, Russell Wallace <···············@gmail.com> wrote:
> I had the impression ECL was ... for ... embedded work

ECL is simply a Lisp that compiles to C.
If you want to embed it or not, is left to you.

(Anyway, it works best in non embedded mode! No non-Lisp code
involved!!)

ECL doesn't come with a profiler, but you can use this simple one
(which is more or less the one of Peter Norvigs PAIP):

http://cybertiggyr.com/lh/profile.lisp

(See the 'with-profiling' macro at the end of the file).

-PM
From: Russell Wallace
Subject: Re: Compiling with GCL on Windows
Date: 
Message-ID: <e534ebd0-908f-4d96-bf4d-31b95b8048b0@v72g2000hsv.googlegroups.com>
On Oct 30, 7:33 pm, ········@gmail.com wrote:
> ECL doesn't come with a profiler, but you can use this simple one
> (which is more or less the one of Peter Norvigs PAIP):
>
> http://cybertiggyr.com/lh/profile.lisp

Thanks! SBCL's profiler seems to be less than 100% accurate, so I'll
use this one as well and cross check the results.

It never occurred to me that it might be possible to write a profiler
as a chunk of portable code within the program to be profiled. I think
Lisp is the only language that can do that :-)
From: Russell Wallace
Subject: Re: Compiling with GCL on Windows
Date: 
Message-ID: <34704fc6-5763-4e3a-9a80-9df3f25b04b7@l42g2000hsc.googlegroups.com>
Problem solved. I installed SBCL, the version coded yellow on the
chart, meaning it may or may not work. Turns out it comes with two
profilers, and the statistical one doesn't work on Windows, but the
other one does. So there's no need for GCL.