Lisp HUG Maillist Archive

Where does REQUIRE look for modules?

Hi!

I've saved a console-only image of LW following the description
provided with ILISP. I basically did something like this:

  (in-package "CL-USER")
  (load-all-patches)
  (compile (defun my-restart () 
             #+Unix (capi:ensure-motif-libraries)
             (mp:initialize-multiprocessing)))
  (save-image "lw-ilisp-capi" :restart-function 'my-restart 
                              :environment nil
                              #+Win32 :console #+Win32 t)
  (quit)

Now ILISP works fine, but while (REQUIRE "COMM") works as advertised
in the LW IDE, in my console image I get:

  CL-USER 2 > (require "COMM")
  Error: Unknown module "COMM".
    1 (abort) Return to level 0.
    2 Return to top-level loop.
    3 Return from multiprocessing.

What went wrong? What am I supposed to do to fix this?

I tried to find out by which mechanism LW is trying to find the
REQUIREd modules, but there is no documentation string for REQUIRE,
and "Help on Symbol" in the IDE will only open the CLHS entry which
says the mechanism is implementation-dependent. The index of the LW
Reference Manual doesn't mention REQUIRE either. I'm sure I missed
something obvious but I'm lost...

This is LW Professional 4.2.6 on Linux. 

Thanks for your help,
Edi.

PS: While writing this mail I checked the KnowledgeBase on the Xanalys
website and noticed the new lispworks.com location. Unfortunately,
clicking on the Xanalys symbol in the LW online documentation
(intro.html) now leads to a 404 error. I'd suggest that you redirect
this page <http://www.xanalys.com/software_tools/> to
www.lispworks.com.


Re: Where does REQUIRE look for modules?

* Edi Weitz wrote:

>   CL-USER 2 > (require "COMM")
>   Error: Unknown module "COMM".
>     1 (abort) Return to level 0.
>     2 Return to top-level loop.
>     3 Return from multiprocessing.

> What went wrong? What am I supposed to do to fix this?

What is the value of lispworks:*lispworks-directory*, and does it make
sense?  I suspect that REQUIRE &c depend on this directory to find
`known' modules.  My guess is that this is set to something
nonsensical, or just wrong.  It's not at all clear to me how this gets
set, actually.  I know that I used to set it in the site init file
and/or the image-dumping file, but I don't seem to do that now.  When
I dump an image like yours, it is set OK.  *However* if I start an
image with -init file.lisp, where file.lisp is empty, it doesn't get
set correctly and (require "COMM") barfs.

--tim


Re: Where does REQUIRE look for modules?

Unable to parse email body. Email id is 499

Re: Where does REQUIRE look for modules?

* davef  wrote:

> That's true: system modules are found relative to
> *lispworks-directory*.

> But in the case that *lispworks-directory* is incorrectly set, then
> REQUIRE would signal a file-not-found error.

> Edi's error indicates that the system does not know about the module
> "COMM".

That's right, of course.  And the mysteriosity I experienced with
reading an empty init file isn't because *lispworks-directory* is set
wrongly (it's not), it's because my site init file sets the
case-insensitive modules bit.

Sorry for being confused!

--tim


Re: Where does REQUIRE look for modules?

Unable to parse email body. Email id is 497

Re: Where does REQUIRE look for modules?

davef@xanalys.com writes:

>    Now ILISP works fine, but while (REQUIRE "COMM") works as advertised
>    in the LW IDE, 
> 
> If (require "COMM") works, you must have set the internal variable
> that allows case-insensitive comparison of module names.
>  
>                  in my console image I get:
> 
>      CL-USER 2 > (require "COMM")
>      Error: Unknown module "COMM".
>        1 (abort) Return to level 0.
>        2 Return to top-level loop.
>        3 Return from multiprocessing.
> 
>    What went wrong? What am I supposed to do to fix this?
> 
> (require "comm")

Woops, sorry. That was it. I could have sworn that I used "COMM" in
both cases but it looks like I used "comm" in the IDE and "COMM" in
Emacs/ILISP. Sorry for the confusion. (I should add that the CSS used
by the LW documentation renders the fonts so small that I can hardly
see a difference between "COMM" and "comm" on Mozilla/Linux while
looking at <lwref-u-35.htm>... :)

Anyway, thanks for your help (and thanks to Tim Bradshaw).

What about my related question about where LW finds modules? Can I add
other directories and/or can I add my own modules (like with, say,
CMUCL 18d)?

Thanks again,
Edi.


Updated at: 2020-12-10 09:01 UTC