The torch project: https://github.com/torch/torch7
Everything gets installed under /opt/lua
$ mkdir -p /opt/lua && sudo chown $USER /opt/lua
LuaJit http://luajit.org (2.0.3)
$ make PREFIX=/opt/lua/luajit install
$ ln -s /opt/lua/luajit/bin/luajit-2.0.3 /opt/lua/luajit/bin/lua
add /opt/lua/luajit/bin to $PATH
LuaRocks http://www.luarocks.org/ (2.1.2)
$ ./configure --with-lua=/opt/lua/luajit --prefix=/opt/lua/luarocks
$ make buid
$ make install
Change launch scripts /opt/lua/luarocks/bin/luarocks* to start like this:
#!/opt/lua/luajit/bin/lua
package.path = [[/opt/lua/luarocks/share/lua/5.1/?.lua;]]..package.path
...
Change config (/opt/lua/luarocks/etc/luarocks/config-5.1.lua) to look like this:
fs_use_modules = false
rocks_trees = {
{ name = [[user]], root = home..[[/.luarocks]] },
{ name = [[system]], root = [[/opt/lua/luarocks]] },
{ root="/opt/lua/luajit", bin_dir="/opt/lua/luajit/bin", lib_dir="/opt/lua/luajit/lib/lua/5.1"}
}
rocks_servers = {
[[https://raw.github.com/torch/rocks/master]],
[[http://luarocks.org/repositories/rocks]]
}
Patch LuaRocks to make it work with torch:
Edit /opt/lua/luarocks/share/lua/5.1/luarocks/fs/unix/tools.lua
Find line (~265) with ... vars.CURL.." -L and change it to vars.CURL.." -k -L to make curl accept all SSL certificates
Edit /opt/lua/luarocks/share/lua/5.1/luarocks/manif.lua
Find line (~117) with "manifest-"..cfg.lua_version..".zip", and remove it
Add /opt/lua/luarocks/bin to $PATH
Make LuaRocks findable by luajit:
$ ln -s /opt/lua/luarocks/share/lua/5.1/luarocks /opt/lua/luajit/share/lua/5.1/luarocks
Qt http://qt-project.org/downloads (4.8.6)
Install binary via DMG
$ luarocks install sundown
$ luarocks install cwrap
$ luarocks install paths
$ luarocks install torch
$ luarocks install nn
$ luarocks install dok
$ luarocks install gnuplot
$ luarocks install qtlua
$ luarocks install qttorch
$ luarocks install luafilesystem
$ luarocks install penlight
$ luarocks install sys
$ luarocks install xlua
$ luarocks install image
$ luarocks install optim
$ luarocks install lua-cjson
$ luarocks install trepl
Rock 'camera' (https://github.com/clementfarabet/lua---camera) needs OpenCV from http://opencv.org/ (2.4.9)
$ mkdir build && cd build
$ cmake -G "Unix Makefiles" -D CMAKE_INSTALL_PREFIX=/Users/$USER/Library/Developer/opencv/ -D CMAKE_OSX_ARCHITECTURES=x86_64 -D BUILD_PERF_TESTS=OFF -D BUILD_opencv_legacy=YES -D WITH_CUDA=OFF ..
$ make -j8
$ make install
then
$ OpenCV_DIR="/Users/$USER/Library/Developer/opencv" luarocks install camera
Got only black images from the cam. Looks like a bug on OS X. Fix: clementfarabet/lua---camera#11