Installation
These are the installation instructions for LuaGnome. It is distributed primarily as source tarball, with precompiled binaries possibly available for Linux (different architectures), Windows, and as Debian packages (most likely not the latest versions). You can also get the latest source from the CVS repository on LuaForge.
Prerequisites
The following software is required to build LuaGnome:
- Lua 5.1 with some libraries: lfs, bit, lxp
- gcc
- make
- gccxml
- ffi (foreign function interface)
- (optional) cmph
- The libraries to support, i.e. glib, gdk, gtk, atk, cairo etc., with their header files.
Instructions
- Fetch the source from either CVS or as source tarball, unpack.
- Run the script ./configure (which is a Lua script, not autoconf)
- Run make
- Run make install
On success, you can now run the included tests, examples or other programs. If something didn't work, please use your skillz to fix it, otherwise write about your problems on the project's forums on LuaForge.
About CMPH
This is a library to create and use minimal perfect hash (mph) tables. LuaGnome relies heavily on hashing to look up functions, constants, types and fundamental types. Thus having a good hashing algorithm and functions available improves execution speed and reduces memory usage. All these tables are computed at build time, saved as .c files which are then compiled into the modules.
Note: a hash function computes a hash value for a given input string. A hash algorithm maps an input string to a bucket number, and requires at least one hash function.
Cmph comes with various algorithms. Two of them are currently supported by LuaGnome, which doesn't link with the cmph library, but implements the (simple) lookup functions directly to save space (and because cmph doesn't offer saving a hash table to a .c file).
- The older fch algorithm already delivers excellent results.
- The newer bdz algorithm, available starting with cmph version 0.8, results in slightly smaller hash table data which is generated a lot faster.
- A fallback algorithm (named simple) is not part of cmph. It produces somewhat larger data tables and probably runs somewhat slower at runtime, but doesn't require cmph to build.
For comparison, the complete build of LuaGnome on Linux/i386 with all 10 libaries supported as of 12/2008 results in the following combined binary sizes:
Algorithm | Size in kB |
---|---|
simple | 415 |
fch | 372 |
bdz | 370 |