[Rcpp-devel] Building RProtoBuf on Windows

David Ibarra Gómez dibarra at aqualogy.net
Tue Mar 19 16:47:32 CET 2013


Maybe the best place it is rprotobuf-yada-bounces at lists.r-forge.r-project.org.

Nevertheless I have used RProtoBuf on windows and Debian, but downloading the package...


David Ibarra Gomez
Jefe de Proyectos
Dirección de Ingeniería de sistemas Aqualogy Aqua Ambiente dibarra at aqualogy.net

-----Mensaje original-----
De: rcpp-devel-bounces at lists.r-forge.r-project.org [mailto:rcpp-devel-bounces at lists.r-forge.r-project.org] En nombre de John Buonagurio
Enviado el: martes, 19 de marzo de 2013 16:34
Para: rcpp-devel at lists.r-forge.r-project.org
Asunto: [Rcpp-devel] Building RProtoBuf on Windows

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:

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

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?

Rcpp-devel mailing list
Rcpp-devel at lists.r-forge.r-project.org

Disclaimer: http://disclaimer.aqualogy.net/

More information about the Rcpp-devel mailing list