【问题标题】:Gnu plot error with lua/torch (OS X)lua/torch (OS X) 的 Gnu 绘图错误
【发布时间】:2016-01-25 06:43:16
【问题描述】:

我想在 Torch 中运行一些需要 gnuplot 库的代码,但是出现以下错误;

/Users/mattsmith/torch/install/bin/luajit: ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:127: Gnuplot terminal is not set
stack traceback:
    [C]: in function 'error'
    ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:127: in function 'getfigure'
    ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:808: in function 'figure'
    ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:288: in function 'getCurrentPlot'
    ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:308: in function 'writeToCurrent'
    ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:836: in function 'gnulplot'
    ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:976: in function 'plot'
    practical3.lua:217: in main chunk
    [C]: in function 'dofile'
    ...mith/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
    [C]: at 0x0104467190

我在这里读到Lua Error: "Gnuplot terminal is not set" 我需要安装 gnu plot 可执行文件。所以我下载了这个并按照这里的网站说明http://gnuplot.sourceforge.net/ReleaseNotes_5_0.html 然后我得到了这个错误;

In file included from ./term.h:414:
../term/lua.trm:113:10: fatal error: 'lua.h' file not found
#include <lua.h>
         ^
1 error generated.
make[3]: *** [term.o] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1

不太确定我是否以正确的方式进行处理。任何帮助将不胜感激!

谢谢

【问题讨论】:

标签: macos lua gnuplot torch


【解决方案1】:

查找 lua.h 所在的位置。对我来说,它在:/usr/local/Cellar/lua/5.3.5_1/include/lua

然后,打开gnuplot安装文件里面的lua.trm,找到#include lua.h,替换成path/lua.h。就我而言:/usr/local/Cellar/lua/5.3.5_1/include/lua/lua.h

您会注意到还有其他“包含”会抛出与 lua.h 相同的错误。都在同一条路上。因此,以相同的方式修改包含。

【讨论】:

    猜你喜欢
    • 2015-08-15
    • 2016-09-30
    • 2012-08-03
    • 1970-01-01
    • 1970-01-01
    • 2017-06-04
    • 2014-10-27
    • 1970-01-01
    • 2015-06-22
    相关资源
    最近更新 更多