This section describes the prerequisites for installing and configuring kons-9 on Ubuntu 20,04; in other words, it describes what should already be installed and configured before you start. Please check over the list of prerequisites and make sure they’re all installed and properly configred before you try to install and use kons-9.
First, use apt to update your system’s local package index. In your Terminal run:
sudo apt update
Make sure git is installed running this in Terminal:
sudo apt install git
review your git settings
git config --list --show-origin
and if needed
Then visit this page:
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
and find Your Identity
section. There you will find example of setting your 2
most important git settings, that is your name and email.
kons-9 is developed and tested with Stell Bank Common Lisp (SBCL). For best results working with it, install and configure a recent version of SBCL on your Linux system. These instructions were tested with SBCL version 2.0.1.debian, but any version of SBCL from 2.0 onward should work well.
The easiest to install is to run the following command in Terminal:
sudo apt install sbcl
If you prefer, you can instead install SBCL by following instructions from the SBCL Getting Started page.
https://www.sbcl.org/getting.html
In your terminal try sbcl. Your output should resemble the example/
sbcl This is SBCL 2.2.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.
Then press Ctrl+D to exit sbcl and go back to the prompt.
There are several editors that provide support for working with Common Lisp, but by far the most commonly-used one is GNU Emacs. These instructions assume that you have a recent version of GNU Emacs installed and configured to your liking.
Emacs may not necessarily be installed on your Ubuntu system by default, but it’s easy to install it using apt.
Here we assume you want to install emacs, a recent version of GNU Emacs that isn’t the very most recent one.
To find out which versions of Emacs your system can install, first update the
package index as shown above, then use apt search
to list the available versions
of Emacs:
sudo apt search emacs
apt search responds with a list of installable packages it knows about that are related to Emacs. Choose the one you prefer and use apt to install.
sudo apt install emacs
kons-9 relies on quicklisp to find and load dependencies, and these instructions assume that you have it installed on your local system. The easiest way to install quicklisp is to follow the installation instructions at the quicklisp home page.
Most Lispers want more than just text-editing support for working with Lisp. The Superior Lisp Interaction Mode for Emacs (SLIME) is an Emacs package that provides comprehensive support for running a Common Lisp implementation, sending forms to it for evaluation, controlling its debugger, and generally making life easier for Lisp programmers.
The easiest way to set up SLIME so that it works with quicklisp is to use quicklisp to install it. These instructions assume that you followed the instructions for installing quicklisp, as we discussed above.
Open a terminal window and run sbcl:
$ sbcl This is SBCL 2.2.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. ~*~
SBCL prints its banner and waits for input. Now use qucklisp to install swank, the Lisp side of the SLIME package:
~*~ (ql:quickload :swank) To load "swank": Load 1 ASDF system: swank ; Loading "swank" . (:SWANK) ~*~
SBCL fetches SLIME and loads the SWANK package.
SLIME consists of two parts:
- The SLIME package loads in Emacs and provides a user interface for Lisp.
- The SWANK package loads into your Common Lisp implementation and provides communication features that enable SLIME to talk to it and control it.
kons-9 currently depends on a development version of the GLFW library to create windows and render scenes. GLFW may not be installed on your Ubuntu system by default.
In your Terminal use apt to install libglfw3-dev.
sudo apt install libglfw3-dev
If apt signals that it has completed successfully then you’re ready to install and configure kons-9.
Open a terminal window and change to a directory where you want to keep the kons-9 project.
Then use git to clone the development repo into the chosen directory:
cd ~/Programming/Lisp git clone https://github.com/kaveh808/kons-9.git cd ./kons-9
Start SBCL REPL and run each line.
(push #p "~/Programming/Lisp/kons-9/" ql:*local-project-directories*) (ql:quickload "kons-9") (in-package :kons-9)
And run the code
(run)
That should show a window with a 3D grid. Pressing Tab on your keyboard should show a menu.
In your SBCL REPL execute the following code.
(load "~/Programming/Lisp/kons-9/test/test-demos.lisp")
If you are lucky you will see a series of demos flashed on the 2D grid.
If you are lucky the end of the output in the REPL will look like:
Test completed. T KONS-9>
If you are unlucky you will get an error. I got my error trying a development commit. Errors may produce lots of output but the relevant part may resemble the following:
Testing file demo-superquadric... superquadric 1... Date/time: 2022-11-16-15:49! An unhandled error condition has been signalled: Invalid index 16 for (SIMPLE-ARRAY T (32 16)), should be a non-negative integer below 16.
For the time being please raise an issue in this repo asking for help and detailing your problem.