pveber / ocaml-r

Objective Caml binding embedding the R interpreter
GNU General Public License v3.0
35 stars 4 forks source link

ocaml-r is not compatible with R 3.0 #2

Closed pveber closed 7 years ago

pveber commented 11 years ago

Compilation fails with R 3.0:

[pbil:~/w/ocaml-r 17:12]$make
ocaml setup.ml -build 
W: Field XMETAType is set but matching plugin is not enabled.
W: Field XMETAType is set but matching plugin is not enabled.
W: Cannot find source file matching module 'R_lang_parser_y' in library R_syntax
W: Cannot find source file matching module 'R_lang_parser_y' in library R_syntax
W: Cannot find source file matching module 'Standard' in library R
Finished, 1 target (0 cached) in 00:00:02.
+ ocamlfind ocamlc -g -I src -linkpkg -package calendar -cclib -L/usr/lib/R/lib -cclib -lR -cclib -lRmath -cclib -lm src/base/R_base.cma src/R.cma src/R_interpreter.cma examples/test_suite.cmo -o examples/test_suite.byte
File "_none_", line 1:
Error: Error on dynamically loaded library: ./src/dllR_stubs.so: ./src/dllR_stubs.so: undefined symbol: R_SetErrorHook
Command exited with code 2.
Compilation unsuccessful after building 171 targets (138 cached) in 00:00:33.

The reason is that the function R_SetErrorHook is now put in a location that is chopped off from main/error.c at preprocessing.

Well, this function was undocumented and marked as temporary so this is not a big surprise after all. It was handy to hook a function that was called when there is an error, and that would update two global variables. One was for the error message, the other for the sexp used for the call.

Here's where it happens. Naively, I'd think we can get both values after the call to R_tryEval:

pveber commented 11 years ago

The naive fix is here.

UnixJunkie commented 7 years ago

should this be closed?

pveber commented 7 years ago

I guess so: I could live with the fix for a few years now :o)