[Rprotobuf-yada] building on windows

eckuipers-web at yahoo.com eckuipers-web at yahoo.com
Mon Oct 25 17:50:48 CEST 2010


In sisocks.h Simon seems to be using #ifdef statements to handle windows 
properly, but for whatever reason it does not work on my machine.

SocketCopyingInputStream.h also needs to be tweaked a bit so that it includes 
<winsock.h> on windows instead of <sys/socket.h> and <netinet/tcp.h>

I made some quick hacks to force sisocks.h and SocketCopyingInputStream.h to use 
winsock but now i get more compilation errors related to some files sisocks.h 
includes (part of Rtools). Something must be messed up on my system...



----- Original Message ----
From: Dirk Eddelbuettel <edd at debian.org>
To: eckuipers-web at yahoo.com
Cc: rprotobuf-yada at lists.r-forge.r-project.org
Sent: Mon, October 25, 2010 10:48:03 AM
Subject: Re: [Rprotobuf-yada] building on windows


Hi Koert,

On 25 October 2010 at 06:12, eckuipers-web at yahoo.com wrote:
| Hey all,
| 
| I am trying to build and install under windows. These are the steps i did. I 
am 

| not sure if this is how it is supposed to be done.
| 
| 1) Configure/Make/Make install for google protobuf library using MinGW and 
MSYS
| No trouble here

I think I once tried and failed. Or maybe the presence of configure scared
me.  But well done -- that's correct.

| 2) Configure rprotobuf using MinGW and MSYS
| Run without problems
| 
| 3) By hand modify rprotobuf/pkg/src/Makevars
| I have to tell RTools where to find protobuf
| My Makevars now looks like this:
| PKG_CPPFLAGS=-I"c:/Devel/msys/1.0/local/include"
| PKG_LIBS=c:/Devel/R-2.10.1/library/Rcpp/lib/libRcpp.a 
| c:/Devel/msys/1.0/local/lib/libprotobuf.a

That's correct. I may want to look into making this possible for CRAN similar
to what we do with other packages where available (but rarely used on
Windows) libraries are provided to CRAN by volunteers to us. 

| 4) R CMD build pkg
| This seems to move along with some warnings until it needs netinet/in.h and 
| throws and ERROR.
| I have had this problem on windows before. I think last time i replaced the 
| include of netinet with an include of winsock or winsock2.
| The output of "R CMD build" is below.

Yes. That sound vaguely familar. 

'sisocks.h' is by R Core member Simon Urbanek and used in several of his
projects, including Rserve.  I am sure we can get this tamed.  

Do you want to give it a try with some #ifdef statements to get to the
standard old winsock / winsock2 here?

Dirk


| 
| Best Koert
| 
| 
**************************************************************************************

| 
| 
| * checking for file 'pkg/DESCRIPTION' ... OK
| * preparing 'pkg':
| * checking DESCRIPTION meta-information ... OK
| * cleaning src
| make: Nothing to be done for `clean'.
| * installing the package to re-build vignettes
| * installing *source* package 'RProtoBuf' ...
| 
|    **********************************************
|    WARNING: this package has a configure script
|          It probably needs manual configuration
|    **********************************************
| 
| 
| ** libs
|   making DLL ...
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| ConnectionCopyingInputStream.cpp -o ConnectionCopyingInputStream.o
| In file included from ConnectionCopyingInputStream.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from ConnectionCopyingInputStream.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| ConnectionCopyingOutputStream.cpp -o ConnectionCopyingOutputStream.o
| In file included from ConnectionCopyingOutputStream.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from ConnectionCopyingOutputStream.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| ConnectionInputStream.cpp -o ConnectionInputStream.o
| In file included from ConnectionInputStream.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from ConnectionInputStream.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| ConnectionOutputStream.cpp -o ConnectionOutputStream.o
| In file included from ConnectionOutputStream.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from ConnectionOutputStream.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| DescriptorPoolLookup.cpp -o DescriptorPoolLookup.o
| In file included from DescriptorPoolLookup.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from DescriptorPoolLookup.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c RSourceTree.cpp 
-o 

| RSourceTree.o
| In file included from RSourceTree.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from RSourceTree.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| RWarningErrorCollector.cpp -o RWarningErrorCollector.o
| In file included from RWarningErrorCollector.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from RWarningErrorCollector.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| RconnectionCopyingInputStream.cpp -o RconnectionCopyingInputStream.o
| In file included from RconnectionCopyingInputStream.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from RconnectionCopyingInputStream.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| g++ -I"c:/Devel/R-2.10.1/include" -I"c:/Devel/msys/1.0/local/include"  
| -I"c:/Devel/R-2.10.1/library/Rcpp/include"     -O2 -Wall  -c 
| SocketCopyingInputStream.cpp -o SocketCopyingInputStream.o
| In file included from SocketCopyingInputStream.cpp:1:
| rprotobuf.h:28:1: warning: "O_BINARY" redefined
| In file included from rprotobuf.h:26,
|                  from SocketCopyingInputStream.cpp:1:
| 
c:\devel\rtools\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/fcntl.h:67:1:

|  warning: this is the location of the previous definition
| In file included from SocketCopyingInputStream.cpp:2:
| SocketCopyingInputStream.h:5:24: error: sys/socket.h: No such file or 
directory
| In file included from SocketCopyingInputStream.h:7,
|                  from SocketCopyingInputStream.cpp:2:
| sisocks.h:32:24: error: netinet/in.h: No such file or directory
| sisocks.h:34:23: error: arpa/inet.h: No such file or directory
| In file included from SocketCopyingInputStream.cpp:2:
| SocketCopyingInputStream.h:11:25: error: netinet/tcp.h: No such file or 
| directory
| SocketCopyingInputStream.cpp: In member function 'virtual int 
| rprotobuf::SocketCopyingInputStream::Read(void*, int)':
| SocketCopyingInputStream.cpp:19: error: 'recv' was not declared in this scope
| make: *** [SocketCopyingInputStream.o] Error 1
|   ... done
| ERROR: compilation failed for package 'RProtoBuf'
| * removing 'C:/DOCUME~1/kkuipers/LOCALS~1/Temp/Rinst415685192/RProtoBuf'
|  ERROR
| Installation failed.
| Removing 'C:/DOCUME~1/kkuipers/LOCALS~1/Temp/Rinst415685192'
| _______________________________________________
| Rprotobuf-yada mailing list
| Rprotobuf-yada at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rprotobuf-yada

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



More information about the Rprotobuf-yada mailing list