我想在炬管中运行一些需要gnuplot lib的代码,但是出现以下错误;
/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
不太确定我是否要采用正确的方法。任何帮助将不胜感激!
谢谢
查找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错误相同的错误。全部都在同一条路径上。因此,以相同的方式修改包括。