Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@deltheil
Created November 28, 2014 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deltheil/d867acefb037a22f9e14 to your computer and use it in GitHub Desktop.
Save deltheil/d867acefb037a22f9e14 to your computer and use it in GitHub Desktop.
A quick'n'dirty work around to install koraykv/torch-svm

torch-svm

Here's a quick'n'dirty work around to install torch-svm:

Clone the repo

git clone git@github.com: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) by TARGET_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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment