On Tue, 1 Mar 2022, Ignacio Diaz-Emparanza wrote:
Reporting about the gretl crash:
1) I changed "Use local setting for decimal point" to "on" in my
laptop
(Ubuntu 20.04 and gretl built on 2022-02-25). StrucTs script worked without
problem.
2) Now I changed "Use local setting for decimal point" to "off" in my
office's desktop PC (Ubuntu 20.04 and gretl built on 2022-02-23). StructTs
script makes gretl crash (the same as with the option in "on".
3) I had a look to gdb (I don't have valgrind installed) but ... now I am not
a so advanced linux user.
4) I run the script in a terminal with gretlcli obtaining a halt with this
error: "cannot find system Renviron. Fatal error: unable to open the base
package". I go to gretl preferences and in "Path to R library" I see
"/usr/lib/libR.so"
5) I open a terminal and go to /usr/lib to see if the file exists, yes it
exists. The output of ls -ll libR* is
lrwxrwxrwx 1 root root 13 nov 2 22:13 libR.so -> R/lib/libR.so
I check with a "cat" if the link is working at it is. The original
"real"
place of libR.so is /usr/lib/R/lib/libR.so
6) I go to gretl's preferences again and change the R library path to
/usr/lib/R/lib/libR.so, I try to run the script again and... it works!
My conclusion: what is causing the crash is the soft link. Don't ask me why I
had a path to this soft link. No idea.
Thanks for following up on this, Ignacio. The problem is not a soft
link as such.
In my gretl preferences I had the path to libR.so set to the actual
path on my system, namely /opt/R/lib64/R/lib/libR.so. As an
experiment, I created a symlink /usr/local/lib/libR.so and changed
my gretl preferences to point to the symlink. I then ran gretl in
Spanish, both with and without the locale decimal character option,
and everything worked OK.
However, I think I see what's happening. On my system I have the
environment variable R_HOME set to "/opt/R/lib64/R". I guess in your
case that variable is not set. So I suspect the following: if you
pass the actual path to libR.so, gretl can infer where R_HOME is and
all is OK. If you pass a symlink and R_HOME is NOT set, R doesn't
know where its files are and gretl can't help.
Anyway, it seems clear that the crash is in libR.so, which can't
find "Renviron" under the stated conditions: called via symlink with
R_HOME undefined. Maybe gretl could help with some fancy footwork,
using the OS to resolve a libR symlink.
Allin