I am running Ubuntu linux and have had a little trouble finding a compatable TPT distribution. I have decided to compile like A Real Man - equiped with MinGW and a text editor. Why get an IDE when I won't use it ever again? So I have invoked g++, -I'ed all code-containing directories to find headers, and then downloaded zlib and bzlib (apt-get libbz2-dev) and have had no trouble from them yet.
An odd thing has happened: g++ is complaining about a header called "lua.h" - it doesn't exist! It seems to be used extensively, but I can't find it anywhere in the source I downloaded. (I have run generator.py.) I am wondering as to what use it has and why I don't have it. Here are some details:
Aweful, manual build script thing:
definitions="-D USE_STDINT" # used by a BSON.h typedef
headerSearch="-I./src -I... -I... ..." # REALLY long
sourceSearch="./src/*.c* ./generated/*.c* ..." # also really long
g++ -o powder $definitions $headerSearch $sourceSearch > buildLog.txt 2>&1
Error message in buildLog.txt:
In file included from ./src/lua/LuaCompat.c:1:0:
./src/lua/LuaCompat.h:14:17: fatal error: lua.h: No such file or directory
compilation terminated.
In file included from ./src/lua/socket/auxiliar.h:34:0,
from ./src/lua/socket/auxiliar.c:10:
./src/lua/socket/../LuaCompat.h:14:17: fatal error: lua.h: No such file or directory
compilation terminated.
... // Tons more of the same
I would appreciate it very much if someone with more experience shed some light on my problem! Criticisms and recommendations welcome.
You need to install the liblua-x.x.x-dev package. Once you have done that you should find the headers at /usr/include/luaX.X and the shared libraries and /usr/lib/lua/X.X.
I don't remember which version of Lua you're supposed to compile TPT against, so just replace x.x.x with the version. It's probably 5.1.0 or something like that.
I was a bit confused then. The #include's seem to use qoted, program-specific header names rather than angle bracket system library names. Will I need to -I liblua or will g++ auto-include them?
I don't know how to use those tools. So I am throwing TPT source at g++ until it works, if ever it does...
sudo apt-get install build-essential libsdl1.2-dev libbz2-dev zlib1g-dev liblua5.1.0-dev git scons libfftw3-dev
git clone git://github.com/simtr/The-Powder-Toy.git
cd The-Powder-Toy && scons
Yeah, I think I'll give up on a manual build. It is making me want to poke my eyes out. I didn't realise there was such a simple solution! The last time I tried to compile TPT, I downloaded the recommended IDE for Windows and, well, got bored trying to make the project files work. I was scarred for life: I've never attempted to compile stuff for windows since.