Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation: error loading module 'libpaths' #17

Closed
lverwimp opened this issue Nov 10, 2015 · 8 comments
Closed

installation: error loading module 'libpaths' #17

lverwimp opened this issue Nov 10, 2015 · 8 comments

Comments

@lverwimp
Copy link

I installed Torch and DP, but I am getting this error whenever I try to use DP (Torch works):

require 'dp'
error loading module 'libpaths' from file '.../torch/install/lib/lua/5.1/libpaths.so':
.../torch/install/lib/lua/5.1/libpaths.so: undefined symbol: lua_replace
stack traceback:
[C]: in ?
[C]: in function 'require'
.../torch/install/share/lua/5.1/paths/init.lua:1: in main chunk
[C]: in function 'require'
.../torch/install/share/lua/5.1/torch/init.lua:12: in main chunk
[C]: in function 'require'
.../torch/install/share/lua/5.1/nnx/init.lua:28: in main chunk
[C]: in function 'require'
.../torch/install/share/lua/5.1/dp/init.lua:1: in main chunk
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?

Since libpaths.so is a binary file, it is impossible to detect why lua_replace is an undefined symbol. Any idea how I could solve this?

Thank you in advance!

@soumith
Copy link
Member

soumith commented Nov 10, 2015

before starting torch, try this line:

export LD_LIBRARY_PATH=~/torch/install/lib:$LD_LIBRARY_PATH

see if it helps.

If that does not help, try:

LD_PRELOAD=~/torch/install/lib/libluajit.so th

let me know if that works.

@lverwimp
Copy link
Author

Torch was already in the library path, but I found another solution: using qlua instead of lua.

Thank you!

@soumith soumith closed this as completed Nov 12, 2015
@rajeshnjr
Copy link

When i check itorch in my terminal(ubuntu) i am getting this following error
$ itorch
/home//torch/install/bin/luajit: error loading module 'lzmq' from file '/home/tis32/torch/install/lib/lua/5.2/lzmq.so':
/home/tis32/torch/install/lib/lua/5.2/lzmq.so: undefined symbol: luaL_setfuncs
stack traceback:
[C]: at 0x080b4080
[C]: in function 'require'
/home/tis32/torch/install/share/lua/5.2/itorch/main.lua:11: in main chunk
[C]: in function 'require'
(command line):1: in main chunk
[C]: at 0x0804d6d0
/home/tis32/torch/install/bin/luajit: error loading module 'libpaths' from file '/home/tis32/torch/install/lib/lua/5.2/libpaths.so':
/home/tis32/torch/install/lib/lua/5.2/libpaths.so: undefined symbol: luaL_setfuncs
stack traceback:
[C]: at 0x080b4080
[C]: in function 'require'
/home/tis32/torch/install/share/lua/5.2/paths/init.lua:1: in main chunk
[C]: in function 'require'
/home/tis32/torch/install/share/lua/5.2/torch/init.lua:12: in main chunk
[C]: in function 'require'
...e/tis32/torch/install/share/lua/5.2/itorch/IOHandler.lua:10: in main chunk
[C]: in function 'require'
(command line):1: in main chunk
[C]: at 0x0804d6d0
Jupyter Console 4.0.3

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic
ERROR: Kernel did not respond

Shutting down kernel

and when i check ipython it displays

$ ipython
Python 3.5.1 |Anaconda 2.4.1 (32-bit)| (default, Dec 7 2015, 11:17:45)
Type "copyright", "credits" or "license" for more information.

IPython 4.0.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

@AdrianScott
Copy link

Thanks, @soumith , that LD_LIBRARY_PATH line solved it for me.

I've added that to .bashrc and it's working great.

Thanks

@feaber
Copy link

feaber commented May 28, 2016

Hi, I have same error when try to require "torch" or "paths".

I know windows is not supported officialy, but perhaps You know some trick how to use correct lib.
Can You describe me how this "export LD_LIBRARY_PATH=~/torch/install/lib:$LD_LIBRARY_PATH" help on linux?

I'm using vanila lua5.1 on MinGW

@feaber
Copy link

feaber commented May 29, 2016

Hi, sorry for flooding the topic but I fix it.
I probably mess something with cmake.

My LUA lib is:
D:\lua5.1\lib

And "make install" does not put "libtorch.dll" and "libpaths.dll" in correct place ("D:\lua5.1\lib\lua\5.1" !).
(also I have to put "torch" folder containing .lua files in "D:\lua5.1\share\lua\5.1" manually
earlier)

I have build both using this:
cmake -E make_directory build
cd build
cmake .. -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DLUALIB=lua51.dll -DLUA_INCDIR="%LUA_INCDIR%" -DLUA_LIBDIR="%LUA_LIBDIR%" -DLUA="%LUA%"
make

Where:
LUA=lua
LUA_CPATH=d:\lua5.1\lib\lua\5.1?.dll;%APPDATA%\LuaRocks\lib\lua\5.1?.dll
LUA_INCDIR=D:/lua5.1/include
LUA_LIBDIR=D:/lua5.1/bin
LUA_PATH=C:\Program Files (x86)\LuaRocks\lua?.lua;C:\Program Files (x86)\LuaRocks\lua?\init.lua;%APPDATA%\LuaRocks\share\lua\5.1?.lua;%APPDATA%\LuaRocks\share\lua\5.1?\init.lua;d:\lua5.1\share\lua\5.1?.lua;d:\lua5.1\share\lua\5.1?\init.lua

And my PATH contains (on top):
D:\MinGW\bin;D:\lua5.1\bin;...

So great it worked :)) I have spend whole day fighting with this :)

I will try to read some more about Makefile/CMake and bring path for Windows/MinGW
This is odd because LUA_LIBDIR have to be set (or contain) to path containing "lua51.dll" and for "make install" it should be set to "D:\lua5.1\lib\lua\5.1"

Correct me if I missing something. I'm not C/LUA expert.

@rk1992
Copy link

rk1992 commented Feb 6, 2018

I installed DP but whenever i try to call it i get the following error

/home/rajkumar/torch/install/share/lua/5.2/trepl/init.lua:389: /home/rajkumar/torch/install/share/lua/5.2/trepl/init.lua:389: /home/rajkumar/torch/install/share/lua/5.2/trepl/init.lua:389: /home/rajkumar/torch/install/share/lua/5.2/torch/init.lua:102: class nn.ZeroGrad has been already assigned a parent class

stack traceback:
/home/rajkumar/torch/install/share/lua/5.2/trepl/init.lua:506: in function </home/rajkumar/torch/install/share/lua/5.2/trepl/init.lua:499>
[C]: in function 'error'
/home/rajkumar/torch/install/share/lua/5.2/trepl/init.lua:389: in function 'require'
[string "_RESULT={require 'dp'}"]:1: in main chunk
[C]: in function 'xpcall'
/home/rajkumar/torch/install/share/lua/5.2/trepl/init.lua:661: in function 'repl'
...umar/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk
[C]: in ?

@priyankasin
Copy link

While Extract the features from aligned images with batch-represent I got an error:

luajit: error loading module 'libpaths' from file '/home/samar/torch/install/lib/lua/5.2/libpaths.so':
/home/samar/torch/install/lib/lua/5.2/libpaths.so: undefined symbol: luaL_setfuncs
stack traceback:
[C]: at 0x004525b0
[C]: in function 'require'
/home/samar/torch/install/share/lua/5.2/paths/init.lua:1: in main chunk
[C]: in function 'require'
/home/samar/torch/install/share/lua/5.2/torch/init.lua:12: in main chunk
[C]: in function 'require'
./batch-represent/main.lua:3: in main chunk
[C]: at 0x004044a0

So can anyone who help me to solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants