Hello,
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). I fixed the first one by setting the CC environment variable and worked around the second one by changing some few lines in the sources of the groveler. After that I got errors due to some libraries. I would like to check if this is an silicate problem or if the groveler is the cause. So here is my question: What "stable" applications that use the groveler exist? Applications that are known to run under Windows are preferred.
Thanks for your help,
best regards,
Karl
On Wed, Nov 30, 2011 at 1:40 PM, Karl Heinrichmeyer karl@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.
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,
Luís Oliveira luismbo@gmail.com writes:
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.
Windows has no concept of a default system compiler (for C compilers, at least). While there can be better strategies to find it, it's very important to try gcc.exe from PATH as the first attempt; every more likely place should be tried after that one.
While it's fine to surprise users by doing the right thing, it's more important to allow a *predictable* right thing to happen if the system is rightly configured. A good user will ensure that GCC.EXE is in the PATH whenever he expects some software to use gcc.
What include parameter are you referring to? Do you have a patch?
One place that is obviously wrong is that (format nil "I~A" (directory-namestring ...)) in grovel.lisp. It's pretty common in modern Lisp code, and it *screams* "WE DON'T CARE ABOUT WINDOWS". I'll look deeper for other similar things. Btw, isn't it about time to just stop writing code like that? Even ASDF knows something about PATHNAME-DEVICEs (in its peculiar ad-hoc manner that shouldn't be replicated, of course).
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.
The port of IOLIB, fortunately, doesn't rely on grovel when run on Windows (all grovel entries are reader-conditioned away). Generally, it's a perfect strategy for system APIs and a good thing to do for many libraries: you just replicate structure definitions and rely on them being stable (or upgraded in a compatible way, which is much easier when most of them have cbSize component). All platform's "subculture" is against grovelling, unlike the Unix one.
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@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,