Problems installing dependencies: nngraph, image, and cunn

519 views
Skip to first unread message

Josh

unread,
Apr 19, 2016, 11:16:17 PM4/19/16
to torch7
I want to try the "Deep Tracking" demo that uses Torch7, but I am having difficulty installing its dependencies (nngraph, image, and cunn).

I have installed Torch using the instructions given here, and it appears to have installed successfully as I am able to run "th", which presents me with an interactive Torch session.

I have then tried installing nngraph, but I encounter the following error relating to the shared library libTH.so not being found:
$ sudo luarocks install nngraph
[sudo] password for josh: 
Installing https://raw.githubusercontent.com/torch/rocks/master/nngraph-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/nngraph-scm-1.rockspec... switching to 'build' mode
Cloning into 'nngraph'...
remote: Counting objects: 39, done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 39 (delta 0), reused 25 (delta 0), pack-reused 0
Receiving objects: 100% (39/39), 1.61 MiB | 325.00 KiB/s, done.
Checking connectivity... done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/usr/bin/.." -DCMAKE_INSTALL_PREFIX="/usr/lib/luarocks/rocks/nngraph/scm-1" && make
   
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /usr/share/cmake/torch/TorchExports.cmake:64 (message):
  The imported target "TH" references the file
     "/usr/lib/libTH.so"
  but this file does not exist.  Possible reasons include:
  * The file was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and contained
     "/usr/share/cmake/torch/TorchExports.cmake"
  but not all the files it references.
Call Stack (most recent call first):
  /usr/share/cmake/torch/TorchConfig.cmake:29 (INCLUDE)
  CMakeLists.txt:4 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_nngraph-scm-1-6197/nngraph/build/CMakeFiles/CMakeOutput.log".
Error: Build error: Failed building.

I am unsure as to why the file /usr/lib/libTH.so does not exist after installing Torch, especially given that it seems to have installed successfully.

Also, rather strangely, when listing the installed packages (luarocks list), it shows that all three dependencies are already installed:
Warning: Failed loading manifest for /home/josh/.luarocks/lib/luarocks/rocks: /home/josh/.luarocks/lib/luarocks/rocks/manifest: No such file or directory
Installed rocks:
----------------
argcheck
   scm-1 (installed) - /usr/lib/luarocks/rocks
audio
   0.1-0 (installed) - /usr/lib/luarocks/rocks
cudnn
   scm-1 (installed) - /usr/lib/luarocks/rocks
cunn
   scm-1 (installed) - /usr/lib/luarocks/rocks

cunnx
   scm-1 (installed) - /usr/lib/luarocks/rocks
cutorch
   scm-1 (installed) - /usr/lib/luarocks/rocks
cwrap
   scm-1 (installed) - /usr/lib/luarocks/rocks
dok
   scm-1 (installed) - /usr/lib/luarocks/rocks
env
   scm-1 (installed) - /usr/lib/luarocks/rocks
fftw3
   scm-1 (installed) - /usr/lib/luarocks/rocks
gnuplot
   scm-1 (installed) - /usr/lib/luarocks/rocks
graph
   scm-1 (installed) - /usr/lib/luarocks/rocks
graphicsmagick
   1.scm-0 (installed) - /usr/lib/luarocks/rocks
hdf5
   0-0 (installed) - /usr/lib/luarocks/rocks
image
   1.1.alpha-0 (installed) - /usr/lib/luarocks/rocks

itorch
   scm-1 (installed) - /usr/lib/luarocks/rocks
lbase64
   20120820-1 (installed) - /usr/lib/luarocks/rocks
lightningmdb
   scm-1 (installed) - /usr/lib/luarocks/rocks
lpeg
   1.0.0-1 (installed) - /usr/lib/luarocks/rocks
lua-cjson
   2.1.0-1 (installed) - /usr/lib/luarocks/rocks
lua-pb
   scm-0 (installed) - /usr/lib/luarocks/rocks
luacrypto
   0.3.2-1 (installed) - /usr/lib/luarocks/rocks
luaffi
   scm-1 (installed) - /usr/lib/luarocks/rocks
luafilesystem
   1.6.3-1 (installed) - /usr/lib/luarocks/rocks
lzmq
   0.4.3-1 (installed) - /usr/lib/luarocks/rocks
nn
   scm-1 (installed) - /usr/lib/luarocks/rocks
nngraph
   scm-1 (installed) - /usr/lib/luarocks/rocks

nnx
   0.1-1 (installed) - /usr/lib/luarocks/rocks
optim
   1.0.5-0 (installed) - /usr/lib/luarocks/rocks
paths
   scm-1 (installed) - /usr/lib/luarocks/rocks
penlight
   1.3.2-2 (installed) - /usr/lib/luarocks/rocks
qtlua
   scm-1 (installed) - /usr/lib/luarocks/rocks
qttorch
   scm-1 (installed) - /usr/lib/luarocks/rocks
signal
   scm-1 (installed) - /usr/lib/luarocks/rocks
struct
   1.4-1 (installed) - /usr/lib/luarocks/rocks
sundown
   scm-1 (installed) - /usr/lib/luarocks/rocks
sys
   1.1-0 (installed) - /usr/lib/luarocks/rocks
threads
   scm-1 (installed) - /usr/lib/luarocks/rocks
torch
   scm-1 (installed) - /usr/lib/luarocks/rocks
totem
   0-0 (installed) - /usr/lib/luarocks/rocks
trepl
   scm-1 (installed) - /usr/lib/luarocks/rocks
uuid
   0.2-1 (installed) - /usr/lib/luarocks/rocks
xlua
   1.0-0 (installed) - /usr/lib/luarocks/rocks

However, when I try to run the DeepTracking demo, Torch complains that it cannot find the nngraph module:

$ th train.lua
/usr/bin/luajit: /usr/share/lua/5.1/trepl/init.lua:383: module 'nngraph' not found:Failed loading module nngraph in LuaRocks rock nngraph scm-1
no field package.preload['nngraph']
no file '/tmp/buildd/.luarocks/share/lua/5.1/nngraph.lua'
no file '/tmp/buildd/.luarocks/share/lua/5.1/nngraph/init.lua'
no file '/usr/share/lua/5.1/nngraph.lua'
no file '/usr/share/lua/5.1/nngraph/init.lua'
no file './nngraph.lua'
no file '/usr/share/luajit-2.1.0-beta1/nngraph.lua'
no file '/usr/local/share/lua/5.1/nngraph.lua'
no file '/usr/local/share/lua/5.1/nngraph/init.lua'
no file '/home/josh/.luarocks/share/lua/5.1/nngraph.lua'
no file '/home/josh/.luarocks/share/lua/5.1/nngraph/init.lua'
no file '/tmp/buildd/.luarocks/lib/lua/5.1/nngraph.so'
no file '/usr/lib/lua/5.1/nngraph.so'
no file './nngraph.so'
no file '/usr/local/lib/lua/5.1/nngraph.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/home/josh/.luarocks/lib/lua/5.1/nngraph.so'


I'm rather confused by all this. Are the dependencies actually installed?

If so, why can't they be found by Torch and how do I resolve this?

If not, why are they being listed as installed when they are not and how do I go about installing them given the above libTH.so issue?

Thanks!

Ladislav Jech

unread,
Jan 8, 2017, 6:10:44 AM1/8/17
to torch7
I am facing similar situation on Gentoo system while working on Torch packages. 

My ebuild package file for Torch based on CMAKE original Torch file install however library here:
/usr/lib64/lua/5.1/libTH.so.0

In my case it is causing same issue while compiling TH++ Facebook library where Torch is also dependency.

The torch actually installs here:
usr/lib64/lua/5.1/libluaT.so.0
   usr/lib64/libtorch.so
   usr/lib64/lua/5.1/libTH.so.0

based on my system LUA settings:
"-DLUADIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua'))"
"-DLIBDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LIB $(usex luajit 'luajit' 'lua'))"
"-DLUA_BINDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_BIN $(usex luajit 'luajit' 'lua'))"
"-DLUA_INCDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_INC $(usex luajit 'luajit' 'lua'))"
"-DLUA_LIBDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
"-DSCRIPTS_DIR=$($(tc-getPKG_CONFIG) --variable INSTALL_BIN $(usex luajit 'luajit' 'lua'))"
"-DLUALIB=`equery files luajit |grep lib64/libluajit | grep .so | awk 'NR==0; END{print}'`"
"-DLUA=/usr/bin/luajit"

So this is easy to fix by creating symlink in general.

Dne středa 20. dubna 2016 5:16:17 UTC+2 Josh napsal(a):
Reply all
Reply to author
Forward
0 new messages