Luarocks on windows not recognizing my lua_libdir

我们两清 提交于 2020-04-30 11:00:38

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!