Windows上的行李架无法识别我的lua_libdir [英] Luarocks on windows not recognizing my lua_libdir

查看:542
本文介绍了Windows上的行李架无法识别我的lua_libdir的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用luarocks在Lua上安装nngraph 使用此代码

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 :

错误:无法找到Lua库.您可能需要配置LUA_LIBDIR.

Error: Failed finding Lua library. You may need to configure LUA_LIBDIR.

有人有相同的经历吗?你能解决吗?

does anyone have same experience? can you solve it ?

这是我的config-5.2.lua:

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

推荐答案

您的config-5.2.lua文件是否位于搜索到的路径之一中?我安装了独立的二进制文件(使用Lua 5.3版),该文件会搜索C:/Program Files (x86)/luarocks/config-5.3.lua& %APPDATA%/luarocks/config-5.3.lua.这些文件都不存在于我的系统&中;我必须手动创建一个.在不带任何参数的情况下运行luarocks命令将向您显示其搜索位置.如果要使用自定义位置,则可以设置LUAROCKS_CONFIG环境变量.

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.

通过向配置中添加以下变量,我可以正常工作(注意:我正在使用MinGW/GCC编译器):

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',
}

CC& LD变量仅在找不到编译器或链接器时才需要(在我的系统上默认为mingw32-gcc).

The CC & LD variables are only necessary if it has trouble finding the compiler or linker (defaults to mingw32-gcc on my system).

来源:

  • 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

我希望这会有所帮助.

:如果其他所有操作均失败,则可能需要查看 LuaDist .它是一个Lua发行版,具有自己的软件包管理系统&包括LuaRocks&预先安装了一些其他库/实用程序.我还没有尝试过,但是我打算.

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.

这篇关于Windows上的行李架无法识别我的lua_libdir的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆