[mkcl-devel] Native compilation on Windows

Ralph Möritz ralph.moeritz at outlook.com
Thu Oct 25 07:16:04 UTC 2012


> On Wed, Oct 24, 2012 at 10:24 AM, Ralph Möritz 
> <ralph.moeritz at outlook.com<mailto:ralph.moeritz at outlook.com>> wrote: 
> I just downloaded MKCL-1.1.0 & tried compiling a small "Hello, world" 
> program on Windows without success. Here's what I tried: 
> 
> 1. Add "C:\Program Files\MKCL 1.1\bin" to my PATH. 
> 2. Run `mkcl -not-fasl-p -compile hello.lisp` which produces lisp.o 
> 3. Now what? I've tried to link using `gcc -o hello.exe hello.o 
> -lmkcl_1.1.0` which produces an error: 
> 
> Such a direct call to gcc cannot work with a ".o" produced by the MKCL 
> compiler (see [1] below as to why). 

Ah! Thanks for elaborating.


> I've also tried `mkcl -o hello.exe -link hello.o` which produces the 
> following error: 
> 
> build-program failed: Unknown keyword :LISP-FILES 
> 
> 
> That instead should have worked! You have quite clearly hit a bug in 
> MKCL-1.1.0. 
> But you see, that access from the command line to the 
> #'compiler:build-program facility 
> is somewhat seldom used and has bit-rot without me noticing. I will 
> fix it in the coming 
> hours and that fix should be part of MKCL-1.1.1 (to be released soon I 
> expect). 

Great, thanks.


> Let me stress the point that such a use of MKCL on the command line, 
> although supported, 
> is somewhat atypical. Like other Common Lisp systems, MKCL is mostly 
> used through a REPL, 
> either MKCL's own default REPL (somewhat basic) or the REPL of SLIME (a 
> much nicer one). 
> Also, producing a full OS native executable is a fairly rare event 
> since the typical user of 
> MKCL will be building his CL world by loading (fasl or source) 
> libraries at the REPL prompt. 
> Were you knowingly testing this command line option or did you hit on 
> it more or less by chance? 
> In the second case I could suggest you some easy alternatives depending 
> on your goal. 

In my spare time I'm writing a chess engine. Chess engines are usually provided
to users as statically linked native executables. Of course I'm using SLIME 
interactively during development, but I'd like to be able to build the executable from the 
command-line as well. Normally I use SBCL, but I'm experimenting with ECL & MKCL specifically 
to be able to produce native executables from my Lisp code.

Regards,
Ralph 		 	   		  



More information about the mkcl-devel mailing list