« Previous -
Next » -
tnxgalaxy, 05/27/2010 01:46 pm
added some clarifications about how to install lua on ubuntu 10.04. Added as well the regular way to download a file on Mac OS X (using curl, wget not being built in)
Installing Luabind on Linux, Mac OS X, ...¶
Since luabind is not available from macports (I think certain Linux Distributions do not provide it too), here the short summary how to install luabind on a Unix like system :)
To build luabind, you need liblua. Install it, for example on a Mac using macports:
sudo port install lua
On Ubuntu 10.04:
sudo apt-get install liblua5.1-0-dev
Getting the source¶
While writing this, the most current version is 0.9. Get it!
On Mac OS X:
curl -O http://sunet.dl.sourceforge.net/project/luabind/luabind/0.9/luabind-0.9.tar.gz
Extract the source¶
tar zxf luabind-0.9.tar.gz
Building and installing¶
On Ubuntu 10.04:
install boost build:
sudo apt-get install boost-build libboost1.40-dev
and compile / install with the following command:
sudo bjam --prefix=/usr/local install
On Mac OS X, bjam might be annoying and complicated, use this small build script. Put it in the luabind root directory.
This script is configured for a Mac OS X having lua and boost installed in /opt/local (using macports).
Please adjust LUA_INCLUDE_DIR, LUA_LIBRARY_DIR and LIB_EXTENSION if you have a different setup.
#!/bin/sh LUA_INCLUDE_DIR=/opt/local/include LUA_LIBRARY_DIR=/opt/local/lib LIB_EXTENSION=dylib rm -rf build mkdir -p build/src for i in src/*.cpp do gcc -I$LUA_INCLUDE_DIR -I. -fPIC -c $i -o build/$i.o done gcc -shared -o build/libluabind.$LIB_EXTENSION build/src/*.o \ -L$LUA_LIBRARY_DIR -lstdc++ -llua
To install the thing, just copy lib and header into the preferred path. For example:
sudo cp -r luabind /usr/local/include sudo cp build/libluabind.* /usr/local/lib
Hope that works for you.