I'm trying to run a neural network from torch inside Java. I'm using luaj as a wrapper.
The problem is that when I require for example the torch
module which depends on the libpaths
module which is a shared library it throws the following error:
module 'libpaths' not found: libpaths
no field package.preload['libpaths']
libpaths.lua
Before I require any module I set the package.cpath
and package.path
to the folders where the libraries are because before it only looked in the default path which was just the project folder. However I have the feeling that 'require' only looks in the package.path for modules and not in the cpath because then it would also find libpaths.so. Also because this output includes only the directories from path and not cpath:
/home/erika/.luarocks/share/lua/5.1/libpaths.lua
/home/erika/.luarocks/share/lua/5.1/libpaths/init.lua
/home/erika/torch/install/share/lua/5.1/libpaths.lua
/home/erika/torch/install/share/lua/5.1/libpaths/init.lua
./libpaths.lua
/home/erika/torch/install/share/luajit-2.1.0-beta1/libpaths.lua
/usr/local/share/lua/5.1/libpaths.lua
/usr/local/share/lua/5.1/libpaths/init.lua
I tried package.searchpath() with the path from the cpath and 'libpath' and it did find the libpaths.so. I tried a lot of different things but nothing seems to work so I would really appreciate some help!
I use Lua 5.1.5, my OS is Ubuntu 14.04 LTS.