gheber / kenzo

A repackaged version of the Kenzo program by Francis Sergeraert and collaborators.
https://sur-l-analysis-sit.us/
Other
50 stars 8 forks source link

Can’t figure out how to run Kenzo #127

Open guillaumebrunerie opened 7 years ago

guillaumebrunerie commented 7 years ago

I’m trying to run Kenzo but it doesn’t seem to work. This is probably an issue with me rather than with Kenzo, as I don’t know much about Lisp (in particular how packages/systems/modules work) but I would welcome any help.

I have installed SBCL (locally, as I do not have admin rights), cloned the Kenzo repository, and simlinked Kenzo to ~/.local/share/common-lisp/source/Kenzo. Now, from the command line I run sbcl, then in the prompt (require :asdf) and then (require :kenzo). The first time it did a lot of things, and now it only returns ("abbreviations" "macros" "various" "classes" "combinations" "chain-complexes" "chcm-elementary-op" "effective-homology" "homology-groups" "searching-homology" ...) I guess that’s ok, and that it has been loaded.

But now how do I use it? I tried running the first line of 00_Overview.ipynb in the sbcl prompt, namely (def m23 (moore 2 3)), but it fails with the following error:

* (def m23 (moore 2 3))
; in: DEF M23
;     (DEF M23 (MOORE 2 3))
; 
; caught STYLE-WARNING:
;   undefined function: DEF
; 
; caught WARNING:
;   undefined variable: M23

;     (MOORE 2 3)
; 
; caught STYLE-WARNING:
;   undefined function: MOORE
; 
; compilation unit finished
;   Undefined functions:
;     DEF MOORE
;   Undefined variable:
;     M23
;   caught 1 WARNING condition
;   caught 2 STYLE-WARNING conditions

debugger invoked on a UNBOUND-VARIABLE in thread #<THREAD "main thread" RUNNING {10028DE963}>: The variable M23 is unbound.

If I try (moore 2 3), I get debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD "main thread" RUNNING {10028DE963}>: The function COMMON-LISP-USER::MOORE is undefined.

I also tried things like (kenzo:moore 2 3) but then I get debugger invoked on a SB-INT:SIMPLE-READER-PACKAGE-ERROR in thread #<THREAD "main thread" RUNNING {10028DE963}>: Package KENZO does not exist.Stream: #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {1000189D43}>

What am I missing? Thanks!

gheber commented 7 years ago

Kenzo defines a package called "CAT". You should call cat-init before doing anything else. For example,

C:\Users\gheber>sbcl --eval "(ql:quickload :kenzo)"
This is SBCL 1.3.10, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.

WARNING: the Windows port is fragile, particularly for multithreaded
code.  Unfortunately, the development team currently lacks the time
and resources this platform demands.
To load "kenzo":
  Load 1 ASDF system:
    kenzo
; Loading "kenzo"

* (in-package "CAT")

#<PACKAGE "CAT">
* (cat-init)

---done---
* (def m23 (moore 2 3))

[K1 Simplicial-Set]
*

Does that work for you?

The Jupyter notebook hides some of the initialization work.

guillaumebrunerie commented 7 years ago

It works, thanks! Maybe that should be added to the README file?

gheber commented 7 years ago

Will do.