LuaSQL is not installer-friendly.

Lua is a nifty little language that I am putting to work in a personal project. Unfortunately it is lacking in some departments — while it has a library distribution framework in LuaRocks, it doesn’t have momentum enough for this system to be comprehensive and up-to-date.

LuaSQL is a perfect example. This little library provides a very think DBI-style layer to talk to various databases. But it’s not available as a LuaRock.

Instead it is necessary to install it by hand. It’s packaged as a tarball, which isn’t so bad. But there’s no configure script, so some changes must be made by hand before it will compile.

For ubuntu, the locations of the libraries are different from whatever platform the original LuaSQL code is written on. Also, you will get two gcc errors when you go to ‘make’; the first is a PIC error, which is easily fixed by adding -fPIC to the command line switches. The second is a little more subtle.

Lua is written in ANSI C, according to all the literature. This seems to actually mean C99. LuaSQL uses the gcc switch -ansi, which actually defaults to C90, not C99. You need to replace the -ansi switch with -std=c99 for LuaSQL to compile properly.

This entry was posted in Geekery. Bookmark the permalink.