From hin-tak.leung at cimr.cam.ac.uk  Mon Dec 18 17:42:10 2006
From: hin-tak.leung at cimr.cam.ac.uk (Hin-Tak Leung)
Date: Mon, 18 Dec 2006 16:42:10 +0000
Subject: [Rd] Error compiling on HP-UX
In-Reply-To: <4586B3C3.1090702@biostat.ku.dk>
References: <200612181434.17135.pascal.niklaus@ipw.agrl.ethz.ch>
	<4586B3C3.1090702@biostat.ku.dk>
Message-ID: <4586C4E2.2050903@cimr.cam.ac.uk>

Peter Dalgaard wrote:
> Pascal A. Niklaus wrote:
>> Dear all,
>>
>> I hope this is the right mailing list for my question -- I felt that this was 
>> too technical for R-help.
>>
>> I am trying to compile R-2.4.0 on a HP-UX system:
>>
>> ./configure 
>> MAKE=gmake --prefix=$HOME --without-x  --without-tcltk --disable-R-profiling --without-readline --disable-multibyte
>>
>> R is now configured for ia64-hp-hpux11.23
>>
>>   Source directory:          .
>>   Installation directory:    /home/agrl/pniklaus
>>
>>   C compiler:                gcc  -g -O2 -std=gnu99
>>   Fortran 77 compiler:       f90  -g
>>
>>   C++ compiler:              g++  -g -O2
>>   Fortran 90/95 compiler:    f90 -g
>>
>>   Interfaces supported:
>>   External libraries:
>>   Additional capabilities:   NLS
>>   Options enabled:           shared BLAS
>>
>>   Recommended packages:      yes
>>
>> gmake gives me the following error:
>>
>> gcc -I../../src/extra/zlib -I../../src/extra/bzip2 -I../../src/extra/pcre  -I. -I../../src/include -I../../src/include -I/home/agrl/pniklaus/include -DHAVE_CONFIG_H    -g -O2 -std=gnu99 -c 
>> platform.c -o platform.o
>> In file included from /usr/include/netdb.h:69,
>>                  from platform.c:1428:
>> /usr/include/sys/socket.h:535: error: static declaration of 'sendfile' follows 
>> non-static declaration
>> /usr/include/sys/socket.h:506: error: previous declaration of 'sendfile' was 
>> here
>> /usr/include/sys/socket.h:536: error: static declaration of 'sendpath' follows 
>> non-static declaration
>> /usr/include/sys/socket.h:508: error: previous declaration of 'sendpath' was 
>> here
>>
>> I am not sure whether this is a problem with the platform's installed 
>> libraries or with the way R includes these files. Including netdb.h alone in 
>> a test file does not result in any error.
>>
>>   
> This sits in the include file: We have unconditional declarations
>    extern sbsize_t sendfile __((int, int, off_t, bsize_t,
>                                const struct iovec *, int));
>    extern sbsize_t sendpath __((int, char *, off_t, bsize_t,
>                                const struct iovec *, int));
> 
> and then later on
> 
> #ifdef __STDC__
> static sbsize_t sendfile __((int, int, off_t, bsize_t, const struct
> iovec *, int));
> static sbsize_t sendpath __((int, char *, off_t, bsize_t, const struct
> iovec *, int));
> ...
> 
> which I guess is detected as an error by the gcc compiler. There might
> be a way of turning this check off, but I can't spot any in my man page
> for gcc.

That's not quite all there is. The first two are unconditional, but
the next two are within some deep nested ifdef blocks -
__STC__ is defined as it should be (I think you can switch this off
by defining K&R in gcc, but honestly you do *not* want that),
__cplusplus is not defined as it
should not be, but I do not understand why/where _APP32_64BIT_OFF_T
is defined:
==========================
#ifdef _APP32_64BIT_OFF_T
#ifndef __cplusplus
#ifdef __STDC__
static sbsize_t sendfile __((int, int, off_t, bsize_t, const struct 
iovec *, int));
static sbsize_t sendpath __((int, char *, off_t, bsize_t, const struct 
iovec *, int));
#else /* __STDC__ */
static sbsize_t sendfile(a,b,c,d,e,f) int a,b,f; off_t c; bsize_t d; 
__const struct iovec * e; { return __sendfile64(a,b,c,d,e,f\
); }
static sbsize_t sendpath(a,b,c,d,e,f) int a,f; char *b; off_t c; bsize_t 
d; __const struct iovec * e; { return __sendpath64(a,b,\
c,d,e,f); }

#endif /* __STDC__ */
#endif /* __cplusplus */
#endif /* _APP32_64BIT_OFF_T */
===========================

>> I have put config.h, config.log and the socket.h files on the web:
>>
>> http://azug.minpet.unibas.ch/~pascal/R/config.log
>> http://azug.minpet.unibas.ch/~pascal/R/config.h
>> http://azug.minpet.unibas.ch/~pascal/R/socket.h
>>
>> Is there any further information I can provide
>>   
> 
> The gcc version might be helpful
>> Thank you for your help
>>
>> Pascal Niklaus
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>   
> 
>



[Rd] Error compiling on HP-UX
Hin-Tak Leung