From: Karstens Rage
Subject: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <w5KdnSN5s8wFWKveRVn-hg@comcast.com>
I've been trying to test out CL-GD with CLISP 2.35 on Windows XP within
Emacs  (*inferior-lisp*)

This is my first attempt with anything ASDF related.

I notice that the .asd for cl-gd has unqualified names for the required
.lisp files so it must have to do the equivalent of 'cd' or set a search
directory for source before this can work. I also notice that the .asd
does something with *load-truename* so I have modified *load-truename*
(and many other vars within the ext package and in ASDF:: and in
CL-GD.SYSTEM:: but no matter what I try I still keep getting the error
that the operation is loading from my home directory (cygwin).

[405]> (setf *load-truename* #P"C:\\DVP\\cl-gd-0.4.8\\")

#P"C:\\DVP\\cl-gd-0.4.8\\"
[406]> (asdf:oos 'asdf:load-op :cl-gd)

*** - OPEN: file #P"C:\\cygwin\\home\\richard\\packages.lisp" does not exist
The following restarts are available:
...

Any suggestions on what I need to do to set this up?

r

From: Edi Weitz
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <umzm1xbd8.fsf@agharta.de>
On Sun, 25 Sep 2005 08:43:19 -0700, Karstens Rage <········@rage.com> wrote:

> I've been trying to test out CL-GD with CLISP 2.35 on Windows XP
> within Emacs (*inferior-lisp*)
>
> This is my first attempt with anything ASDF related.
>
> I notice that the .asd for cl-gd has unqualified names for the
> required .lisp files so it must have to do the equivalent of 'cd' or
> set a search directory for source before this can work.

If the names are unqualified they are assumed to be meant relative to
the location of the system definition, i.e. the ASD file.

Here's a short explanation of what ASDF does, maybe it helps:

  <http://weitz.de/asdf-install/>

> I also notice that the .asd does something with *load-truename*

This is unrelated to ASDF and only used to find the shared C library
cl-gd-glue.

> so I have modified *load-truename*

It doesn't make much sense to modify it:

  <http://www.lispworks.com/documentation/HyperSpec/Body/v_ld_pns.htm>

> (and many other vars within the ext package and in ASDF:: and in
> CL-GD.SYSTEM:: but no matter what I try I still keep getting the
> error that the operation is loading from my home directory (cygwin).
>
> [405]> (setf *load-truename* #P"C:\\DVP\\cl-gd-0.4.8\\")
>
> #P"C:\\DVP\\cl-gd-0.4.8\\"
> [406]> (asdf:oos 'asdf:load-op :cl-gd)
>
> *** - OPEN: file #P"C:\\cygwin\\home\\richard\\packages.lisp" does
> not exist The following restarts are available: ...
>
> Any suggestions on what I need to do to set this up?

Maybe some of the information above helps.  I'm not sure if CL-GD
works with CLISP/Cygwin at all, though.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Karstens Rage
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <-cGdnQgIwtDXcavenZ2dnUVZ_s-dnZ2d@comcast.com>
> Maybe some of the information above helps.  I'm not sure if CL-GD
> works with CLISP/Cygwin at all, though.
> 
> Cheers,
> Edi.
> 

I dont think I'm even getting to teh point where CL-GD works or doesn't

[418]> *default-pathname-defaults*

#P"C:"
[419]> (pathname (merge-pathnames "packages.lisp"))

#P"C:packages.lisp"

I think what is happening is that c:packages.lisp just looks for
packages.lisp in the current working directory, which happens to be my
home directory. Its doesn't seem to be looking in the directory where
the .asd is.

k
From: Edi Weitz
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <uirwpx9lp.fsf@agharta.de>
On Sun, 25 Sep 2005 11:28:23 -0700, Karstens Rage <········@rage.com> wrote:

> I dont think I'm even getting to teh point where CL-GD works or
> doesn't

I'd suggest that you try with a library that doesn't have external
dependencies first.  CL-GD relies on UFFI, the GD library and a shared
"glue" library so it'll be a lot harder to track down what's
happening.

> [418]> *default-pathname-defaults*
>
> #P"C:"

Have /you/ set it to #P"C:"?  On my CLISP (2.35 on Cygwin) it's #P"".

> [419]> (pathname (merge-pathnames "packages.lisp"))
>
> #P"C:packages.lisp"

Given your value for *DEFAULT-PATHNAME-DEFAULTS* this is correct.
What does that have to do with ASDF?

> I think what is happening is that c:packages.lisp just looks for
> packages.lisp in the current working directory, which happens to be
> my home directory. Its doesn't seem to be looking in the directory
> where the .asd is.

Dunno.  ASDF works for me with CLISP/Cygwin.

This what I have in my ~/.clisprc.lisp file:

  (in-package :cl-user)

  #-:asdf
  (load "c:/home/lisp/asdf")

  #+:asdf
  (dolist (dir-candidate (directory "c:/home/lisp/*/"))
    (when (ignore-errors (ext:probe-directory dir-candidate))
      (let ((asd-candidate (merge-pathnames "*.asd" dir-candidate)))
        (when (directory asd-candidate)
          (push dir-candidate asdf:*central-registry*)))))

I have all of my libraries below "c:/home/lisp/".  Loading simple libs
that don't rely on UFFI works fine:

  ···@Groucho:~$ clisp
    i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
    I I I I I I I      8     8   8           8     8     o  8    8
    I  \ `+' /  I      8         8           8     8        8    8
     \  `-+-'  /       8         8           8      ooooo   8oooo
      `-__|__-'        8         8           8           8  8
          |            8     o   8           8     o     8  8
    ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

  Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
  Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
  Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
  Copyright (c) Bruno Haible, Sam Steingold 1999-2000
  Copyright (c) Sam Steingold, Bruno Haible 2001-2005

  ;; Loading file /cygdrive/c/home/.clisprc.lisp ...
  ;;  Loading file /cygdrive/c/home/lisp/asdf.lisp ...
  ;;  Loaded file /cygdrive/c/home/lisp/asdf.lisp
  ;; Loaded file /cygdrive/c/home/.clisprc.lisp
  [1]> (lisp-implementation-version)
  "2.35 (2005-08-29) (built on winsteingoldlap.ad.alphatech.com [10.41.52.182])"
  [2]> (asdf:oos 'asdf:load-op :cl-fad)
  ; loading system definition from /cygdrive/c/home/lisp/cl-fad/cl-fad.asd into #<PACKAGE ASDF4226>
  ;; Loading file /cygdrive/c/home/lisp/cl-fad/cl-fad.asd ...
  ; registering #<SYSTEM #:CL-FAD #x1020B699> as CL-FAD
  ;; Loaded file /cygdrive/c/home/lisp/cl-fad/cl-fad.asd
  ;; Loading file /cygdrive/c/home/lisp/cl-fad/packages.fas ...
  ;; Loaded file /cygdrive/c/home/lisp/cl-fad/packages.fas
  ;; Loading file /cygdrive/c/home/lisp/cl-fad/fad.fas ...
  ;; Loaded file /cygdrive/c/home/lisp/cl-fad/fad.fas
  0 errors, 0 warnings
  NIL

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Karstens Rage
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <4NSdnQXg57WGnareRVn-sw@comcast.com>
Edi Weitz wrote:

> 
> Dunno.  ASDF works for me with CLISP/Cygwin.
> 
> This what I have in my ~/.clisprc.lisp file:
> 
>   (in-package :cl-user)
> 
>   #-:asdf
>   (load "c:/home/lisp/asdf")
> 
>   #+:asdf
>   (dolist (dir-candidate (directory "c:/home/lisp/*/"))
>     (when (ignore-errors (ext:probe-directory dir-candidate))
>       (let ((asd-candidate (merge-pathnames "*.asd" dir-candidate)))
>         (when (directory asd-candidate)
>           (push dir-candidate asdf:*central-registry*)))))
> 
> I have all of my libraries below "c:/home/lisp/".  Loading simple libs
> that don't rely on UFFI works fine:
> 
>   ···@Groucho:~$ clisp
>     i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
>     I I I I I I I      8     8   8           8     8     o  8    8
>     I  \ `+' /  I      8         8           8     8        8    8
>      \  `-+-'  /       8         8           8      ooooo   8oooo
>       `-__|__-'        8         8           8           8  8
>           |            8     o   8           8     o     8  8
>     ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8
> 
>   Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
>   Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
>   Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
>   Copyright (c) Bruno Haible, Sam Steingold 1999-2000
>   Copyright (c) Sam Steingold, Bruno Haible 2001-2005
> 
>   ;; Loading file /cygdrive/c/home/.clisprc.lisp ...
>   ;;  Loading file /cygdrive/c/home/lisp/asdf.lisp ...
>   ;;  Loaded file /cygdrive/c/home/lisp/asdf.lisp
>   ;; Loaded file /cygdrive/c/home/.clisprc.lisp
>   [1]> (lisp-implementation-version)
>   "2.35 (2005-08-29) (built on winsteingoldlap.ad.alphatech.com [10.41.52.182])"
>   [2]> (asdf:oos 'asdf:load-op :cl-fad)
>   ; loading system definition from /cygdrive/c/home/lisp/cl-fad/cl-fad.asd into #<PACKAGE ASDF4226>
>   ;; Loading file /cygdrive/c/home/lisp/cl-fad/cl-fad.asd ...
>   ; registering #<SYSTEM #:CL-FAD #x1020B699> as CL-FAD
>   ;; Loaded file /cygdrive/c/home/lisp/cl-fad/cl-fad.asd
>   ;; Loading file /cygdrive/c/home/lisp/cl-fad/packages.fas ...
>   ;; Loaded file /cygdrive/c/home/lisp/cl-fad/packages.fas
>   ;; Loading file /cygdrive/c/home/lisp/cl-fad/fad.fas ...
>   ;; Loaded file /cygdrive/c/home/lisp/cl-fad/fad.fas
>   0 errors, 0 warnings
>   NIL
> 
> Cheers,
> Edi.
> 

I put that into my .clisprc.lisp file and things are much better. Now
the only problem is the FFI rather than UFFI and the .dll rather than
the .so. Looking through special.lisp it seems it should look for both
rather than just the ".so" Maybe I take the .so out of the list so it
just looks for .dll?

;; Compiling file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.lisp ...
;; Wrote file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.fas
;; Loading file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.fas ...
*** - FFI::FOREIGN-LIBRARY: Cannot open library
       "C:\\CL\\PACKAGES\\cl-gd-0.4.8\\cl-gd-glue.so"

The library is cl-gd-glue.dll not .so

k
From: Edi Weitz
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <uek7cykjm.fsf@agharta.de>
On Sun, 25 Sep 2005 12:52:58 -0700, Karstens Rage <········@rage.com> wrote:

> I put that into my .clisprc.lisp file and things are much
> better. Now the only problem is the FFI rather than UFFI and the
> .dll rather than the .so. Looking through special.lisp it seems it
> should look for both rather than just the ".so" Maybe I take the .so
> out of the list so it just looks for .dll?
>
> ;; Compiling file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.lisp ...
> ;; Wrote file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.fas
> ;; Loading file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.fas ...
> *** - FFI::FOREIGN-LIBRARY: Cannot open library
>        "C:\\CL\\PACKAGES\\cl-gd-0.4.8\\cl-gd-glue.so"
>
> The library is cl-gd-glue.dll not .so

As I said - I don't expect CL-GD to work with CLISP, at least not out
of the box.  You might want to check out Carlos Ungil's version which
was specificially written for CLISP - see the link from the CL-GD
website.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Karstens Rage
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <jKqdnYkda-Ggv6reRVn-ug@comcast.com>
I do have the .dll from the Carlos Ungil's version and I replaced all
the original CL-GD files with the modified ones from Carlso as well. All
seems well except for the loading of the .dll. I wonder if the FFI
interface from CLISP has changed and the source for the glue file needs
to be recompiled.

r

Edi Weitz wrote:
> On Sun, 25 Sep 2005 12:52:58 -0700, Karstens Rage <········@rage.com> wrote:
> 
> 
>>I put that into my .clisprc.lisp file and things are much
>>better. Now the only problem is the FFI rather than UFFI and the
>>.dll rather than the .so. Looking through special.lisp it seems it
>>should look for both rather than just the ".so" Maybe I take the .so
>>out of the list so it just looks for .dll?
>>
>>;; Compiling file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.lisp ...
>>;; Wrote file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.fas
>>;; Loading file C:\CL\PACKAGES\cl-gd-0.4.8\gd-clisp.fas ...
>>*** - FFI::FOREIGN-LIBRARY: Cannot open library
>>       "C:\\CL\\PACKAGES\\cl-gd-0.4.8\\cl-gd-glue.so"
>>
>>The library is cl-gd-glue.dll not .so
> 
> 
> As I said - I don't expect CL-GD to work with CLISP, at least not out
> of the box.  You might want to check out Carlos Ungil's version which
> was specificially written for CLISP - see the link from the CL-GD
> website.
> 
> Cheers,
> Edi.
> 
From: carlitos
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <1127721982.898577.149660@g47g2000cwa.googlegroups.com>
Karstens Rage wrote:
> I do have the .dll from the Carlos Ungil's version (...)

I don't distribute any dll, do I? Anyway, I got it working (at least it
passes some tests) as follows (I'm writing this from memory, so there
could be errors):

--- .clisprc.lisp ---
(in-package :cl-user)
#-:asdf (load "c:/lisp/asdf")
#+:asdf (pushnew "c:/lisp/systems/" asdf:*central-registry*)
---------------------

cd c:/lisp
wget http://weitz.de/files/cl-gd.tar.gz
tar xvzf cl-gd.tar.gz
wget http://weitz.de/files/cl-gd-glue.dll
chmod +x cl-gd-glue.dll
mv cl-gd-glue.dll cl-gd-0.4.8
wget http://homepage.mac.com/ungil/cl-gd-clisp-0.4.8.tgz
tar xvzf cl-gd-clisp-0.4.8.tgz
[ edit cl-gd-0.4.8/gd-clisp.lisp and change "so" -> "dll" ]
cp cl-gd-clisp-0.4.8/* cl-gd-0.4.8
cd systems
ln -s ../cl-gd-0.4.8/cl-gd.asd .
ln -s ../cl-gd-0.4.8/cl-gd-test.asd .
cd
clisp
> (asdf:oos 'asdf:load-op :cl-gd)
> (asdf:oos 'asdf:load-op :cl-gd-test)
> (cl-gd-test:test)
[ most tests fails with "Could not create image from PNG file" errors ]
From: Edi Weitz
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <u3bnsx9vr.fsf@agharta.de>
FWIW, Luis Oliveira has just sent patches to make CL-GD work with
CLISP/CFFI.  If you're interested in this, download the latest version
(0.5.0), play with it, and report your results to the mailing list.

Make sure to read these messages about potential problems first:

  <http://common-lisp.net/pipermail/cl-gd-devel/2005-September/000030.html>
  <http://common-lisp.net/pipermail/cl-gd-devel/2005-September/000031.html>

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Edi Weitz
Subject: Re: ASDF problem (or maybe CL-GD but I don't think so)
Date: 
Message-ID: <ull1kszen.fsf@agharta.de>
On 26 Sep 2005 01:06:22 -0700, "carlitos" <············@bluewin.ch> wrote:

> [ most tests fails with "Could not create image from PNG file" errors ]

I think this is due to the DLL not understanding Cygwin's pathnames
(which start with something like "/cygdrive/c/").  Most likely you'll
have to build a Cygwin version of GD and the other supporting
libraries.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")