On Thu, 29 Oct 2020, riles(a)triton.net wrote:
That is very interesting since it is a gretl file that is causing
the problem. The code I sent does not declare any variable named->
z.I think my version of Gretl might be earlier than yours. I am
using
gretl: gui client for gretl version 2020b
and compiling with gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1).
Do you think that maybe the different versions is the reason you
are getting this error and not me?
Actually no; the line in question in gretl_matrix.h was already
present in the 2020b release. I guess the difference must lie with
the compiler (I'm using g++ 9.3.1 here). C++ defines "complex" as a
(template) class, apparently, which conflicts with the definition in
C's complex.h. I've worked around this by substituting "double
_Complex" for "double_complex" in gretl_matrix.h, which I think is
harmless in C (according to the standard, "complex" is a macro which
expands to "_Complex").
Anyway, the deletion of files issue is fixed in git. The point is
that producing the plot involves the creation of temporary files in
the user's "dot directory" or "dotdir" (which is supposed to be
invisible to the user), and libgretl_cleanup() removes all files
from that directory apart from ones that we know should not be
deleted. In your setup, "dotdir" is not defined, but "workdir" is,
in which case we take dotdir to equal workdir, hence workdir gets
cleaned out.
Now in git we check for dotdir == workdir and if that's the case we
don't clean out the directory. (In normal gretl usage these
directories are sure to be distinct.)
I guess a workaround for older libgretl would be, just don't call
libgretl_cleanup().
Allin