MonetDB with R Integration for Windows Issues

Hello everyone, I have been trying to get Embedded R in MonetDB to run on Windows 7 and I ran into a bunch of problems. I was wondering if anybody else has been able to get it running or whether there are better workarounds for the issues that I found. I am using manually built MonetDB version 11.19.9 with R integration enabled. The problems I had to fix seem to stem from the fact that the MonetDB is built using the VS2010 compiler, while the R assemblies are built with the MinGW compiler, so sometimes the two do not play nicely together and the server crashes with access violation errors on several occasions. After some debugging of both MonetDB and R source I identified the following problems: 1. The call in rapi.c line 373: R_tryEvalSilent(VECTOR_ELT(R_ParseVector(mkString(rapiinclude), 1, &status, R_NilValue), 0), R_GlobalEnv, &evalErr); fails with an access violation error. The problem is that the path contained in the char array called rapiinclude uses backslashes (Windows style), while the R code expects a UNIX style path with forward slashes. I added a bit of code to rapi.c that replaces the backslashes with forward slashes in the path to work around this issue. 2. The call in rapi.c line 742: fprintf(stdout, "# MonetDB/R module loaded\n"); fails with an access violation (as well as the rest of fprintf calls in rapi.c). Passing file handles across dll boundaries can cause problems even when same compiler is used, here it is passed between dlls built with different compilers (VS2010 compiled lib_rapi.dll to MinGW compiled R.dll). I replaced all fprintf calls with printf to work around this issue. Fixing the above issues I managed to run MonetDB with embedded R on Windows 7 and all the R scripts I tried seemed to work fine until I tried to use an R library that had to be downloaded first automatically using the overloaded library() function as described in https://www.monetdb.org/content/embedded-r-monetdb . 3. The call in rapi.R line 32: install.packages(package,repos=c("http://cran.rstudio.com/"),lib=.rapi.libdir,quiet=T) causes access violation as well, but I have not been able to find a workaround for this yet (apart from manually downloading the R package and dropping it in rapi_packages folder in dbfarm, so no downloading needs to happen). These should be Windows specific issues as MonetDB and R can be compiled with the same compiler for *NIX systems, while the MonetDB build instructions for Windows explicitly state that there is no longer support for compilers other than Microsoft Visual Studio's. I would appreciate it if anybody can help me solve the problem with downloading R libraries or knows a way to get the R integration running on Windows without the custom code changes described above. Best regards, Bogdan Dimitrov ________________________________

Hello Bogdan, Yes, this sort of thing is damnably annoying is it not. I've not looked at the 'R' sources. Is the issue here a) C99 compliance or b) simply the build system (presumably autoconf and friends or cousins)?
participants (2)
-
Bogdan Dimitrov
-
g4@novadsp.com