Allin Cottrell wrote:
On Mon, 6 Jul 2009, chris wrote:
> my last 2 patches didn't include new files, so I've added the debugger
> patch again. The debugger should now be able to skip loops and mle
> constructs.
>
Thanks. Right now I'm still digesting the Rlib material, but I'll
get to the debugger as soon as I can.
> Thanks for integrating the libr patches. Is it possible to use
> the "normal" R headers and use libr with dlopen?
>
Not sure, I'll have to experiment, but my thought is that -- in a
Windows build for example -- we can:
* Make sure the appropriate R headers are available at build time.
* Write wrapper code to obtain pointers to the actual R functions
at runtime via dlopen.
* At runtime, check the registry and work out where R.dll might
be, and try opening it.
I had a look around the internet. Perhaps we could create our wrappers
with relaytool
http://autopackage.org/apbuild-relaytool.php and make
them portable using libtdl
http://developer.apple.com/documentation/developertools/glibtool/libtool_....
But I didn't test them.
I won't have much time in the next two weeks to check mail and even less
to code. I feel a bit bad to throw the code on the list and then to run
away. So if theres some messy/boring work I will be happy to do it in in
mid July.
> The attached libr patch fixes a bug in my code, that should make
> current cvs usable again.
>
Ah, good. But note that
-static int Rinit;
+static int Rinit=0;
thanks, i'm quite new to C, and there are a lot of subtleties like this.
If anyone wants to experiment with Christoph's Rlib
functionality,
you need to
* Ensure that the shared library, libR.so, is enabled in your R
installation and can be found by the dynamic linker. And also
that the pkg-config file libR.pc is accessible to pkg-config (use
PKG_CONFIG_PATH if needed). Re-run gretl's configure script.
* Ensure that R_HOME is set to the parent directory in the R tree
that contains etc/Renviron.
For example, on my system R lives in /opt/R, so I do:
waverley:~$ locate libR.pc
/opt/R/lib/pkgconfig/libR.pc
waverley:~$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/R/lib/pkgconfig
waverley:~$ locate Renviron
/opt/R/lib/R/etc/Renviron
waverley:~$ export R_HOME=/opt/R/lib/R
waverley:~$ grep lib/R /etc/ld.so.conf
In my patch this was all a bit messy. Thanks for cleaning up!
Christoph