[Openmcl-devel] https://github.com/Clozure/ccl/releases
R. Matthew Emerson
rme at clozure.com
Mon May 6 10:11:39 PDT 2024
> On May 5, 2024, at 8:49 PM, Grégory Vanuxem <g.vanuxem at gmail.com> wrote:
>
> The first time I wanted to try out Clozure CL I postponed its use
> because I was lacking concrete information to build and/or install
> CCL.
> I just rebuilt a new image with code cloned from GitHub, and looking
> at the documentation of how to build CCL I remembered what I was
> asking myself at that time. Even if I did what I will say I was
> unsure. I had absolutely knowledge about Clozure CL, just that it was
> a Common Lisp implementation that conforms to ANSI standards.
>
> So if you don't know like me at that time, the name of the Clozure CL
> executable, I think it could be handy to replace in the file mentioned
> in object:
>
> -- After unpacking the binaries, you can rebuild CCL by evaluating
> (rebuild-ccl :full t) as usual.
> ++ After unpacking the binaries, you can rebuild CCL by evaluating
> (rebuild-ccl :full t) with the usual lx${arch} executable.
>
> Or something like that. It is really not a common name for an
> executable, I guess some history is involved here, but even a shell
> script, imagine CCL is installed in /usr/bin for example, you have to
> use 'uname' or something else to evaluate CL code by CCL. This is not
> very UNIX-likish.
Thank you for the feedback.
I’m so used to CCL’s quirks that I sometimes don’t notice potentially-confusing issues like this.
The sample ccl script could be handy when your home directory is shared via NFS (or something like it) to machines with different CPU architectures (hence the call to uname).
If you keep CCL (binaries, interface databases, source code) all in one directory, you can put a little script like this into a directory on your path:
#!/bin/sh
exec /path/to/ccl/lx86cl64 “$*”
If you call that script “ccl”, then that can work fine.
If you save your own heap images outside of the ccl directory, this won’t be sufficient, because CCL, by default, uses the directory that contains the heap image as the ccl directory. In that case, you need to set CCL_DEFAULT_DIRECTORY to the directory containing the CCL sources and interface databases.
For example, when everything is in one directory, and “ccl” is the little shell script I mentioned above:
% ccl
Clozure Common Lisp Version 1.12.2 (v1.12.2-33-g124a7548) DarwinX8664
? (probe-file "ccl:")
#P"/Users/rme/ccl/ccl/"
? (#_getpid)
94502
? (require 'asdf)
ASDF
("uiop" "UIOP" "asdf" "ASDF")
? (quit)
%
Now, suppose I save a heap image in my home directory, and start up with that:
% ccl
Clozure Common Lisp Version 1.12.2 (v1.12.2-33-g124a7548) DarwinX8664
? (save-application "rme.image")
% ccl -I rme.image
Clozure Common Lisp Version 1.12.2 (v1.12.2-33-g124a7548) DarwinX8664
? (probe-file "ccl:")
#P"/Users/rme/"
? (#_getpid)
; Warning: Interface file #P"/Users/rme/darwin-x86-headers64/libc/functions.cdb" does not exist, and the containing directory does not exist.
; This may mean that that the "ccl:" logical-pathname host has not been properly initialized. ; While executing: CCL::CDB-OPEN, in process listener(1).
> Error: Foreign function not found: X86-DARWIN64::|getpid|
> While executing: CCL::LOAD-EXTERNAL-FUNCTION, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 > :pop
? (require 'asdf)
> Error: Module ASDF was not provided by any function on *MODULE-PROVIDER-FUNCTIONS*.
> While executing: REQUIRE, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 > :pop
?
If I set CCL_DEFAULT_DIRECTORY then things work.
% export CCL_DEFAULT_DIRECTORY=~/ccl/ccl
% ccl -I rme.image
Clozure Common Lisp Version 1.12.2 (v1.12.2-33-g124a7548) DarwinX8664
? (probe-file "ccl:")
#P"/Users/rme/ccl/ccl/"
? (#_getpid)
94517
?
But, if CCL_DEFAULT_DIRECTORY ends up in the “global” environment (like I unwisely did above), it can get in the way. https://github.com/Clozure/ccl/issues/479 is about that: "Sometimes it happens that CCL_DEFAULT_DIRECTORY ends up being set in the environment, and points to sources in an unexpected location."
More information about the Openmcl-devel
mailing list