[cffi-devel] cffi-grovel on windows 7

Karl Heinrichmeyer karl at gudrun-heinrichmeyer.de
Wed Nov 30 20:59:37 UTC 2011


This was the error i got when i tried to load osicat. The include 
parameter is highlighted.

? (ql:quickload "osicat")
To load "osicat":
   Load 4 ASDF systems:
     alexandria cffi cffi-grovel trivial-features
   Install 1 Quicklisp release:
     osicat
; Fetching #<URL 
"http://beta.quicklisp.org/archive/osicat/2011-06-19/osicat-20110619-git.tgz">
; 51.27KB
==================================================
52,505 bytes in 0.15 seconds (346.45KB/sec)
; Loading "osicat"
[package osicat-sys]..............................
[package osicat-posix]; E:/Apps/Mingw/bin/gcc.exe -m32 
-I/Apps/CommonLisp/quicklisp/dists/quicklisp/software/c
ffi_0.10.6/ -fPIC -o 
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/qui
cklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.exe 
C:/Users/Karl_H/AppData/Local/comm
on-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quicklisp/software/osicat-20110619-git/pos
ix/basic-unixint.c
 > Error: External process exited with code 1.
 >        Command was: "E:/Apps/Mingw/bin/gcc.exe" 
"-m32"*_"-I/Apps/CommonLisp/quicklisp/dists/quicklisp/softwar
e/cffi_0.10.6/"_ *"-fPIC" "-o" 
"C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/Commo
nLisp/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.exe" 
"C:/Users/Karl_H/AppData
/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quicklisp/software/osicat-20110
619-git/posix/basic-unixint.c"
 >        Output was:
 >        
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists
/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c:1:0: 
warning: -fPIC ignored for target (all code
  is position independent)
 >        
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists
/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c:16:27: 
fatal error: grovel/common.h: No such fil
e or directory
 >        compilation terminated.
 >
 > While executing: CFFI-GROVEL::INVOKE, in process listener(1).
 > Type :POP to abort, :R for a list of available restarts.
 > Type :? for other options.


I applied some changes to grovel.lisp that seem to fix the problem with 
the groveler. The problem was that (directory-namestring ...) doesn't 
include the device name that is used for the drive letter (this is at 
least true for ccl and ecl on windows 7 64bit). That is the drive letter 
is missing in the namestring and neither the cffi install directory nor 
the lib is found by the compiler and so on. This patch may be a little 
improvisational but thats due to the little time i spend with lisp 
programming yet. I send the path as attachment.

There is still a problem with osicat after applying the patch but this 
seems osicat related:

? (ql:quickload "osicat")
To load "osicat":
   Load 4 ASDF systems:
     alexandria cffi cffi-grovel trivial-features
   Install 1 Quicklisp release:
     osicat
; Fetching #<URL 
"http://beta.quicklisp.org/archive/osicat/2011-06-19/osicat-20110619-git.tgz">
; 51.27KB
==================================================
52,505 bytes in 0.20 seconds (258.96KB/sec)
; Loading "osicat"
[package osicat-sys]..............................
[package osicat-posix]; E:/Apps/Mingw/bin/gcc.exe -m32 
-IE:/Apps/CommonLisp/quicklisp/local-projects/cffi/ -o
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quicklis
p/software/osicat-20110619-git/posix/basic-unixint.exe 
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7
-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c
; 
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quickl
isp/software/osicat-20110619-git/posix/basic-unixint.exe 
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1
.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.gr
ovel-tmp.lisp
................; E:/Apps/Mingw/bin/gcc.exe -m32 
-IE:/Apps/CommonLisp/quicklisp/local-projects/cffi/ -shared -
o 
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quickl
isp/software/osicat-20110619-git/posix/libosicat.dll 
C:/Users/Karl_H/AppData/Local/common-lisp/cache/ccl-1.7-f
95-win-x86/E/Apps/CommonLisp/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/wrappers.c
............
..................................................
[package osicat-windows]..........................
[package osicat].
Read error between positions 3522 and 4277 in 
E:/Apps/CommonLisp/quicklisp/dists/quicklisp/software/osicat-201
10619-git/src/osicat.lisp.
 > Error: Unbound variable: OSICAT-POSIX:S-IFLNK
 > While executing: CCL::CHEAP-EVAL, in process listener(1).
 > Type :GO to continue, :POP to abort, :R for a list of available restarts.
 > If continued: Retry getting the value of OSICAT-POSIX:S-IFLNK.
 > Type :? for other options.

I hope this may help,

best regards,

Karl




Am 30.11.2011 20:30, schrieb Luís Oliveira:
> On Wed, Nov 30, 2011 at 1:40 PM, Karl Heinrichmeyer
> <karl at gudrun-heinrichmeyer.de>  wrote:
>> When I tried to load the osicat library via quicklisp yesterday i got an
>> error because the cffi-groveler couldn't find the c compiler and because the
>> path in the include parameter was ill formed (the drive letter was missing).
> Regarding the first issue, unless Windows has some new concept of a
> default system compiler, I guess all we can do is look for more likely
> places. Right now, it's looking at "c:/msys/1.0/bin/gcc.exe". Perhaps
> it could do better than that.

It is fine to use the CC environment variable, but it would be nice if 
there was any note in the manual that the variable is important.

> What include parameter are you referring to? Do you have a patch?
>
> Osicat is probably the best test-case for cffi-grovel on Windows.
> There's also a port of iolib to Windows:
> <http://src.knowledgetools.de/tomas/winapi/index.html>.
>
> Cheers,
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20111130/6de58bfe/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-I-applied-some-changes-to-grovel.lisp-that-seem-to-f.patch
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20111130/6de58bfe/attachment.ksh>


More information about the cffi-devel mailing list