[Rcpp-devel] Building RProtoBuf on Windows

Dirk Eddelbuettel edd at debian.org
Tue Mar 19 17:05:48 CET 2013


On 19 March 2013 at 15:33, John Buonagurio wrote:
| Hi all,
| 
| I hope this is the best list for this question. I am attempting to build RProtoBuf on Windows - has anyone made recent progress on this and could you provide any suggestions? I managed to build the DLL with protobuf-2.5.0 and GCC 4.4 (MinGW) by making only a few changes to the source, but it fails to load in R:

The rprotobuf list [1] is probably appropriate, and you _may_ find someone able
to help.  I cannot help -- I only ever built RProtoBuf on Linux.

Dirk

[1]  https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rprotobuf-yada


 
| 1. DESCRIPTION: removed "OS_type: unix" and "X-CRAN-Original-OS_type: unix"
| 
| 2. SocketCopyingInputStream.h: removed includes of <netinet/tcp.h>, <sys/types.h> and <sys/socket.h> -- these are already conditionally included in sisocks.h?
| 
| 3. SocketCopyingInputStream.cpp: added explicit cast of void* to char* in recv function (Winsock convention)
| 
| 4. sisocks.h: added "#undef Realloc" and "#undef Free" due to conflict with win32 headers (per some StackOverflow discussion here: http://stackoverflow.com/a/11593943 ), and had to remove this bit of code:
|     #if defined __GNUC__ && !defined unix && !defined Win32 /* MacOS X hack (gcc on any platform should behave as unix - except for Win32, where we need to keep using winsock) */
|     #define unix
|     #endif
| 
| Finally, I ran ./configure in MSYS and added -lwsock32 to the makefile before running R CMD INSTALL. The R process crashed when loading with a generic error: "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ERROR: loading failed." I should note that I'm already using the protobuf library linked here in another project with no issues.
| 
| I was hesitant to make the changes to sisocks.h because somehow it seems to build correctly in the Rserve distribution through a complex system of preprocessor macros - I intend to look at that build process more in-depth and try to debug this with GDB, but could anyone provide any suggestions going forward? Do you think it's even worth attempting to get this working in Windows?
| 
| Thanks,
| John
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list