问题
i want to install nngraph on lua using luarocks using this code
luarocks --from=https://raw.githubusercontent.com/torch/rocks/master/ install nngraph
but it's give me an error it said :
Error: Failed finding Lua library. You may need to configure LUA_LIBDIR.
does anyone have same experience? can you solve it ?
this was my config-5.2.lua :
rocks_trees = {
{ name = [[user]],
root = home..[[/luarocks]],
},
{ name = [[system]],
root = [[d:\shared\ta\_bootstrap\_install\]],
},
}
variables = {
MSVCRT = 'MSVCRT',
LUALIB = 'D:\\Shared\\TA\\_bootstrap\\_install\\lib\\liblua.dll.a',
LUA_LIBDIR = 'D:\\Shared\\TA\\_bootstrap\\_install\\lib'
}
verbose = false -- set to 'true' to enable verbose output
回答1:
Is your config-5.2.lua
file located in one of the searched paths? I installed the stand-alone binaries (with Lua version 5.3), which searches for C:/Program Files (x86)/luarocks/config-5.3.lua
& %APPDATA%/luarocks/config-5.3.lua
. Neither of these files existed on my system & I had to create one manually. Running the luarocks
command without any arguments will show you where it searches. If you want to use a custom location, you can set the LUAROCKS_CONFIG
environment variable.
I was able to get mine working by adding the following variables to my configuration (Note: I am using MinGW/GCC compiler):
rocks_trees = {
{ name = [[system]], root = [[C:/Development/Lua53]] },
}
variables = {
LUA = 'C:/Development/Lua53/bin/lua',
LUA_BINDIR = 'C:/Development/Lua53/bin',
LUA_INCDIR = 'C:/Development/Lua53/include',
LUA_LIBDIR = 'C:/Development/Lua53/lib',
CC = 'gcc',
LD = 'gcc',
}
The CC
& LD
variables are only necessary if it has trouble finding the compiler or linker (defaults to mingw32-gcc
on my system).
Sources:
- http://lua-users.org/wiki/LuaRocksConfig
- http://lua-users.org/lists/lua-l/2015-12/msg00172.html
- https://github.com/luarocks/luarocks/wiki/config-file-format
I hope this helps.
Edit: If all else fails, you may want to have a look at LuaDist. It is a Lua distribution with its own package management system & includes LuaRocks & some other libraries/utilities pre-installed. I haven't tried it yet, but I plan to.
来源:https://stackoverflow.com/questions/52026115/luarocks-on-windows-not-recognizing-my-lua-libdir