Skip to content

FYI: issue with arpa/inet.h on SunOS 5.9 (old gcc?)

4 messages · Don MacQueen, Brian Ripley

#
This just information of my experience installing R on SunOS 5.9 
today, not a request for help.
(in case anyone cares, and if not, I apologize for the distraction)

I am building R 2.6.0 (patched; svn revision 43319, 2007-11-01) and 
encountered the problem described below.

I believe the problem is an old gcc (version 3.0.4, built some 5 
years ago), because the warnings do not occur when I specify
    CC = cc
in the environment before configuring, and building R succeeds.

Hence I'm mailing to r-devel instead of r-bugs, as suggested in the 
warning messages.

I don't have much information about the cc I used (I'm not the 
sysadmin of this or any Solaris machine), other than it resides in 
/opt/SUNWspro, and appears to be part of "Sun Studio 11", whatever 
that is.


The messages from R's configure were:

configure: WARNING: arpa/inet.h: present but cannot be compiled
configure: WARNING: arpa/inet.h:     check for missing prerequisite headers?
configure: WARNING: arpa/inet.h: see the Autoconf documentation
configure: WARNING: arpa/inet.h:     section "Present But Cannot Be Compiled"
configure: WARNING: arpa/inet.h: proceeding with the preprocessor's result
configure: WARNING: arpa/inet.h: in the future, the compiler will 
take precedence
configure: WARNING:     ## ----------------------------------- ##
configure: WARNING:     ## Report this to r-bugs at R-project.org ##
configure: WARNING:     ## ----------------------------------- ##

And then the same set of warnings for
   netdb.h
   netinet/in.h
   sys/socket.h

At the very end configure reports:

configure: WARNING: could not determine type of socket length


Then, make fails with:

In file included from /usr/include/netinet/in.h:41,
                  from /usr/include/netdb.h:98,
                  from ../../../R-patched/src/main/platform.c:1586:
/usr/include/sys/stream.h:307: parse error before "projid_t"
make[3]: *** [platform.o] Error 1
make[3]: Leaving directory `/apps/kosapps/R/R-2.6.0/build/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/apps/kosapps/R/R-2.6.0/build/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/apps/kosapps/R/R-2.6.0/build/src'
make: *** [R] Error 1
#
What OS was that compiler built for?  This happened when you had a 
version of gcc built for the wrong version of the OS, as gcc captures 
system headers.  (There's a warning about that in the R-admin manual.)

The 'report to' message is autogenerated by autoconf.

SunStudio 11 is a recent version of Sun's compilers, and much to be 
preferred to gcc 3.0.4 on that platform (and probably to any version of 
gcc there).
On Mon, 5 Nov 2007, Don MacQueen wrote:

            

  
    
1 day later
#
Of course. It was built for Solaris 2.7.
(I did look at R-admin, but not carefully and thoroughly enough.)

Thank you.
-Don
At 7:33 AM +0000 11/6/07, Prof Brian Ripley wrote:

  
    
#
On Wed, 7 Nov 2007, Don MacQueen wrote:

            
Good to know (and I didn't expect you to know it was in the manual, was 
just pointing out where to look for further help).