如何在Ubuntu上使用torch7配置vscode?

时间:2016-12-14 12:37:43

标签: lua visual-studio-code torch vscode-settings

我下载Lua和Ravi 5.3 Debugger插件并更改lanuch.json。我只需将火炬激活中的所有路径添加到其中。

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Ravi Debugger",
        "type": "lua",
        "request": "launch",
        "program": "${workspaceRoot}/main.lua",
        "stopOnEntry": true,
        "cwd": "${workspaceRoot}",
        "LUA_PATH": "$/home/yan/.luarocks/share/lua/5.1/?.lua;/home/yan/.luarocks/share/lua/5.1/?/init.lua;/home/yan/torch/install/share/lua/5.1/?.lua;/home/yan/torch/install/share/lua/5.1/?/init.lua;./?.lua;/home/yan/torch/install/share/luajit-2.1.0-beta1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua",
        "LUA_CPATH": "/home/yan/torch/install/lib/?.so;/home/yan/.luarocks/lib/lua/5.1/?.so;/home/yan/torch/install/lib/lua/5.1/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so"
    }
]
}

然后错误发生在消息:

Debugger initialized
Program terminated with error: error loading module 'libpaths' from file '/home/yan/torch/install/lib/lua/5.1/libpaths.so':
/home/yan/torch/install/lib/lua/5.1/libpaths.so: undefined symbol: lua_replace

我没有谷歌正确的解决方案。提前谢谢!

1 个答案:

答案 0 :(得分:0)

看来你正在使用lua 5.1。如果你查看Lua ann Ravi 5.3 Debugger的描述,你可以找到这个评论:

  

您可能无法调试Lua 5.0,5.1或5.2脚本 - 仅测试5.3并获得官方支持