Here's a quick'n'dirty work around to install torch-svm:
Clone the repo
git clone [email protected]:koraykv/torch-svm.git && cd torch-svm
Get the rockspec
curl -LOJ https://github.com/torch/rocks/raw/master/svm-0.1-0.rockspec
Open svm-0.1-0.rockspec
and replace the build
section with the following one:
build = {
type = "command",
build_command = [[
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)" && $(MAKE)
]],
install_command = "cd build && $(MAKE) install"
}
Open CMakeLists.txt
:
- replace
TARGET_LINK_LIBRARIES(svmutil luaT TH)
byTARGET_LINK_LIBRARIES(svmutil luajit luaT TH)
- remove the last directive:
ADD_TORCH_DOK(...)
Build and install:
luarocks make
Make sure the main library has the right extension (ugly hack™):
mv /usr/local/lib/lua/5.1/libsvmutil.{dylib,so}
Enjoy: luajit -lsvm