|
From: Daniel J S. <dan...@ie...> - 2014-03-01 22:42:17
|
I've tried to build gnuplot in a directory other than the "src" directory but it failed because the demo/plugin/Makefile is missing from the "build" directory. The reason is that demo/plugin/Makefile is in the repository and not generated from the ./prepare and ./configure build process. If I use ../gnuplot/configure --with-qt --disable-plugins gnuplot builds without problem. Should I try fixing that? Or is the change to a Makefile.in or Makefile.am.in obvious to someone else? Thanks, Dan |
|
From: <pl...@pi...> - 2014-03-02 03:13:27
|
Hi,
I'm trying to get a status result back from a system call but am getting
inconsistent behaviour from the automatic typecasting magic.
bash$ test=OK;echo $test; echo $?
OK
0
gnuplot
Version 4.7 patchlevel 0 last modified 2012-10-16
....
gnuplot> cmd="test=OK;echo $test; echo $?;"
gnuplot> res=0;print system (cmd);print res
OK
0
0
gnuplot> res=0; res= system (cmd);print res
OK
0
gnuplot> res=0; if (res==0) {print "test OK"}
test OK
gnuplot> res=0; res=res+ system (cmd);print res
Non-numeric string found where a numeric expression was expected
gnuplot> res=0; res=res || system (cmd);print res
non-integer passed to boolean operator
Now I know automatic typing is _supposed_ to be inconsistent ( it's a
feature not a bug). but this seems nonsensical.
The first and second invocations are as expected and prints integer zero
(the status result returned by the shell). So what the heck is it
complaining about when I try to add integer zero to integer zero?
How is it that it manages to print the zero result directly but when I
try to add it , it suddenly becomes a "non numeric" expression? Then a
"non integer".
Is this really what it's supposed to be doing?
Best regards. Peter.
|
|
From: sfeam <sf...@us...> - 2014-03-02 04:00:19
|
On Sunday, 02 March 2014 01:47:57 AM pl...@pi... wrote:
> Hi,
>
> I'm trying to get a status result back from a system call but am getting
> inconsistent behaviour from the automatic typecasting magic.
>
> bash$ test=OK;echo $test; echo $?
> OK
> 0
>
> gnuplot
> Version 4.7 patchlevel 0 last modified 2012-10-16
> ....
>
> gnuplot> cmd="test=OK;echo $test; echo $?;"
> gnuplot> res=0;print system (cmd);print res
> OK
> 0
> 0
>
> gnuplot> res=0; res= system (cmd);print res
> OK
> 0
>
> gnuplot> res=0; if (res==0) {print "test OK"}
> test OK
>
> gnuplot> res=0; res=res+ system (cmd);print res
> Non-numeric string found where a numeric expression was expected
>
> gnuplot> res=0; res=res || system (cmd);print res
> non-integer passed to boolean operator
>
>
> Now I know automatic typing is _supposed_ to be inconsistent ( it's a
> feature not a bug). but this seems nonsensical.
>
> The first and second invocations are as expected and prints integer zero
> (the status result returned by the shell). So what the heck is it
> complaining about when I try to add integer zero to integer zero?
gnuplot> help system
`system "command"` executes "command" using the standard shell. See `shell`.
If called as a function, `system("command")` returns the resulting character
stream from stdout as a string.
Your printout above shows exactly this.
After setting res = system(...) it is a string
containing "OK\n0"
> How is it that it manages to print the zero result directly but when I
> try to add it , it suddenly becomes a "non numeric" expression? Then a
> "non integer".
It doesn't print 0. It prints "OK\n0"
> Is this really what it's supposed to be doing?
Yes.
Ethan
|
|
From: Hans-Bernhard B. <HBB...@t-...> - 2014-03-03 01:17:47
|
On 01.03.2014 23:42, Daniel J Sebald wrote: > I've tried to build gnuplot in a directory other than the "src" > directory but it failed because the demo/plugin/Makefile is missing from > the "build" directory. That should be fixed now. I want ahead and had demo/plugin/Makefile go through both automake and autoconf. |
|
From: Daniel J S. <dan...@ie...> - 2014-03-03 05:43:43
|
On 03/02/2014 07:17 PM, Hans-Bernhard Bröker wrote: > On 01.03.2014 23:42, Daniel J Sebald wrote: >> I've tried to build gnuplot in a directory other than the "src" >> directory but it failed because the demo/plugin/Makefile is missing from >> the "build" directory. > > That should be fixed now. I want ahead and had demo/plugin/Makefile go > through both automake and autoconf. Builds here, both inside and outside source tree. Thanks, Dan |