Gnu plot在lua/torch(OS X)上出现错误。

我想在torch中运行一些需要gnuplot库的代码,但是我得到以下错误; `` ` /Users/mattsmith/torch/install/bin/luajit: ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:127: Gnuplot终端未设置 堆栈回溯: [C]:在函数'error'中 ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:127: 在函数'getfigure'中 ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:808: 在函数'图案' ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:288: 在函数'getCurrentPlot'中 ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:308: 在函数'writeToCurrent'中 ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:836: 在函数“gnulplot”中 ...attsmith/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:976: 在函数'plot'中 practical3.lua:217:在主块中 [C]:在函数'dofile'中 ...mith/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131:在主块中 [C]:在0x0104467190处

`` `

我在这里阅读[Lua Error:“未设置Gnuplot终端”](https://stackoverflow.com/questions/29882271/lua-error-gnuplot-terminal-is-not-set),我需要安装gnu plot可执行文件。所以我下载了这个并遵循了这里的网站说明[http://gnuplot.sourceforge.net/ReleaseNotes\_5\_0.html](http://gnuplot.sourceforge.net/ReleaseNotes_5_0.html),然后我得到了这个错误; `` ` 从./term.h 包括: ../term/lua.trm:113:10:致命错误:'lua.h'文件未找到 包括<lua.h> ^ 1个错误生成。 使[3]:***[term.o]Error1 装配[2]:***[安装递归]Error1 使[1]:***[安装]错误2 做:***[安装递归]Error1

`` `

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

谢谢

点赞
用户10688641
用户10688641

找到 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 相同的错误的“包含”。它们都在同一个路径上。因此,以同样的方式修改包含。

2020-04-08 01:50:08