Gnu plot error with lua/torch (OS X) - macos

I want to run some code in torch that requires the gnuplot lib however I get the following error;
/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
I read here Lua Error: "Gnuplot terminal is not set" that I require the gnu plot executable installed. So I downloaded this and followed the website instructions here http://gnuplot.sourceforge.net/ReleaseNotes_5_0.html and then I get this error;
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
Not too sure if I am going about this the correct way. Any help would be greatly appreciated!
Thanks

Find wherever lua.h is located. For me it was in: /usr/local/Cellar/lua/5.3.5_1/include/lua
Then, open lua.trm inside the gnuplot installation files, find #include lua.h and replace it with path/lua.h. In my case: /usr/local/Cellar/lua/5.3.5_1/include/lua/lua.h
You will notice that there are other "includes" that will throw the same error as the one with lua.h. There are all on the same path. Therefore, modify the includes the in the same manner.

Related

how to run run LMbench on mac

I followed these instructions. Download lmbench3.tar.gz from lmbench3
and Unpack LMbench to create a tree like so:
lmbench/
Results/
doc/
scripts/
src/
And Go to the lmbench directory, and type make results see
But the result is wrong:
7 warnings generated.
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_uint64_t=1 -DHAVE_int64_t=1 -DHAVE_DRAND48 -c getopt.c -o ../bin/i686-apple-darwin15.6.0/getopt.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_uint64_t=1 -DHAVE_int64_t=1 -DHAVE_DRAND48 -c lib_sched.c -o ../bin/i686-apple-darwin15.6.0/lib_sched.o
lib_sched.c:94:3: error: non-void function 'handle_scheduler' should return a
value [-Wreturn-type]
return;
^
1 error generated.
make[2]: *** [../bin/i686-apple-darwin15.6.0/lib_sched.o] Error 1
make[1]: *** [lmbench] Error 2
make: *** [build] Error 2
How to solve it?
You can change the statement
return;
into
return 0;
at line 94 of lib_sched.c
Then this file should compile without this error.

Make threw out an error but no detailed error message

Here's the last few lines from the output of running "make install" at root level /home/gm/TEST/:
make[3]: Leaving directory `/home/gm/TEST/tppf/tm/ipmgt'
ld ipfac.o ipfacV.o ipfac_rset.o ipfac_args.o ipfac_d2a.o ipfac_a2d.o ipfac_modr.o ipfac_mod.o ipfac_read.o ipfac_add.o ipfac_del.o ipfac_list.o ipfac_unlk.o ipfac_lock.o ipfac_util.o ipfac_lkid.o -r -o /home/gm/TEST/tppf/lib/ipfac_tppf.o
make[3]: Leaving directory `/home/gm/TEST/tppf/tm/ipfac'
make[2]: Leaving directory `/home/gm/TEST/tppf/tm'
make[1]: *** [i_tm] Error 2
make[1]: Leaving directory `/home/gm/TEST/tppf'
make: *** [i_tppf] Error 2
And the Makefile under /home/gm/TEST/tppf/tm/ipfac contains this rule:
install: ipfac.h $(TPPLIB)/ipfac_tppf.o
$(TPPLIB)/ipfac_tppf.o: $(PROPOBJS)
ld $(PROPOBJS) -r -o $(TPPLIB)/ipfac_tppf.o
Is there something wrong with the linking process? Make should've told me what the error actually is, but it didn't.
BTW, I think /home/gm/TEST/tppf/lib/ipfac_tppf. O was linked and created successfully, or at least it was there in directory /home/gm/TEST/tppf/lib/ after make failed and exited.
That line is not the error line. You can tell that it succeeded because there was no error message there, for building the target /home/gm/TEST/tppf/lib/ipfac_tppf.o.
The error is here:
make[1]: *** [i_tm] Error 2
The [1] means that it was the first level of makefile (note the recipe you are quoting here was in the 3rd level of makefile) and the [i_tm] means that the build of the target i_tm failed. You need to look back up further in the output of make, earlier than what you've shown us, and find the *** error line for building the i_tm target and see what errors were generated there.

cant compile gst-plaugin-bad-0.10 on ubuntu 12.04

I have floowing directory structure for gstraemer sources
/home/dev/cerbero/sources/linux_x86_64/gst-plugins-bad-0.10.23
when i run .autogen.sh it runs fine
but when i do "make"
it gives follwing error
gst-plugins_bad_compile_error
more specifically
Making all in gst
make[2]: Entering directory `/home/dev/cerbero/sources/linux_x86_64/gst-plugins- bad-0.10.23/gst'
make -C adpcmdec
make[3]: Entering directory `/home/dev/cerbero/sources/linux_x86_64/gst-plugins-bad-0.10.23/gst/adpcmdec'
CC libgstadpcmdec_la-adpcmdec.lo
adpcmdec.c:586:21: error: expected declaration specifiers or '...' before '(' token
adpcmdec.c:586:40: error: expected declaration specifiers or '...' before '(' token
adpcmdec.c:586:59: error: unknown type name 'adpcmdec'
adpcmdec.c:587:5: error: expected declaration specifiers or '...' before string constant
adpcmdec.c:587:22: error: expected declaration specifiers or '...' before 'plugin_init'
adpcmdec.c:587:35: error: expected declaration specifiers or '...' before string constant
adpcmdec.c:587:44: error: expected declaration specifiers or '...' before string constant
adpcmdec.c:587:52: error: expected declaration specifiers or '...' before string constant
adpcmdec.c:588:5: error: expected declaration specifiers or '...' before string constant
adpcmdec.c:576:1: warning: 'plugin_init' defined but not used [-Wunused-function]
make[3]: *** [libgstadpcmdec_la-adpcmdec.lo] Error 1
make[3]: Leaving directory `/home/dev/cerbero/sources/linux_x86_64/gst-plugins- bad-0.10.23/gst/adpcmdec'
make[2]: *** [adpcmdec] Error 2
make[2]: Leaving directory `/home/dev/cerbero/sources/linux_x86_64/gst-plugins-bad-0.10.23/gst'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/dev/cerbero/sources/linux_x86_64/gst-plugins-bad-0.10.23'
make: *** [all] Error 2
A few things before building
Did you install liboil and orc compiler?
Run ./configure --enable-orc if you did
Run ./configure if you did not
Then do a make
Remember to do a make distclean before you do the above steps or simply get clean source. Do not do this on the "dirty half built" folder directly.
It could also be a nasm/yasm issue though I doubt it.
EDIT: My suggestin is to install orc because that speeds up gstreamer by a lot!

Get make to show line number on error

I have a makefile, which is missing an ldflag. I know how to fix it, but I don't know which line in the makefile the error is generated on.
+ make
CCLD test
test-test.o: In function `write_png':
/home/lenovo/scratch/libass/test/test.c:52: undefined reference to `png_create_write_struct'
...
/home/lenovo/scratch/libass/test/test.c:57: undefined reference to `png_destroy_write_struct'
collect2: ld returned 1 exit status
make: *** [test] Error 1
How do I get make to print out the line the error is on?
(If anybody is wondering, it is a makefile from the libass project in the test directory.)
Try using remake to see if it helps.
http://static.usenix.org/events/lisa11/tech/full_papers/Bernstein.pdf
Heres an example obtained from the link above:
Hope this helps!

GCC 4.5.0: host-x86_64-unknown-linux-gnu/fixincludes: No such file or directory

When "make check" for GCC4.5.0, such error was occured:
make[1]: Entering directory `/home/username/tool/gcc-4.5.0'
/bin/sh: line 0: cd: host-x86_64-unknown-linux-gnu/fixincludes: No such file or directory
make[1]: *** [check-fixincludes] Error 1
make[1]: Leaving directory `/home/username/tool/gcc-4.5.0'
make: *** [do-check] Error 2
How to solve this problem? please....... & Thanks~~~~~
I had a same problem as you; the reason which fixincludes doesn't exist is because you never finished running "make"(+).
Apparently the check failed. The makefile tried to enter a directory that doesn't exist. What this means depends on the project you are trying to build.

Resources