teru@sodan.ecc.u-tokyo.ac.jp
2005-Apr-02 18:24 UTC
[Rd] Solaris10/amd64 + SunSutio Compile (PR#7767)
Full_Name: Teru KAMOGASHRIA Version: 2.0.1 OS: SunOS sun 5.10 Generic i86pc i386 i86pc Submission from: (NULL) (219.5.176.24) rbinom.c cannot be compiled because of the casting problem. /opt/SUNWspro/bin/cc -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -g -c rbinom.c -o rbinom.o "rbinom.c", line 60: operand must have real floating type: op "isfinite" cc: acomp failed for rbinom.c Following patch may solve this problem. *** R-2.0.1.orig/src/nmath/rbinom.c Mon Nov 15 21:33:01 2004 --- R-2.0.1/src/nmath/rbinom.c Sun Apr 3 00:19:52 2005 *************** *** 57,63 **** n = floor(nin + 0.5); if (n != nin) ML_ERR_return_NAN; ! if (!R_FINITE(n) || !R_FINITE(pp) || /* n=0, p=0, p=1 are not errors <TSL>*/ n < 0 || pp < 0. || pp > 1.) ML_ERR_return_NAN; --- 57,63 ---- n = floor(nin + 0.5); if (n != nin) ML_ERR_return_NAN; ! if (!R_FINITE((double)n) || !R_FINITE(pp) || /* n=0, p=0, p=1 are not errors <TSL>*/ n < 0 || pp < 0. || pp > 1.) ML_ERR_return_NAN;
teru@sodan.ecc.u-tokyo.ac.jp writes:> Full_Name: Teru KAMOGASHRIA > Version: 2.0.1 > OS: SunOS sun 5.10 Generic i86pc i386 i86pc > Submission from: (NULL) (219.5.176.24) > > > rbinom.c cannot be compiled because of the casting problem. > > /opt/SUNWspro/bin/cc -I. -I../../src/include -I../../src/include > -I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -g -c rbinom.c -o > rbinom.o > "rbinom.c", line 60: operand must have real floating type: op "isfinite" > cc: acomp failed for rbinom.c > > Following patch may solve this problem. > > *** R-2.0.1.orig/src/nmath/rbinom.c Mon Nov 15 21:33:01 2004 > --- R-2.0.1/src/nmath/rbinom.c Sun Apr 3 00:19:52 2005 > *************** > *** 57,63 **** > n = floor(nin + 0.5); > if (n != nin) ML_ERR_return_NAN; > > ! if (!R_FINITE(n) || !R_FINITE(pp) || > /* n=0, p=0, p=1 are not errors <TSL>*/ > n < 0 || pp < 0. || pp > 1.) ML_ERR_return_NAN; > > --- 57,63 ---- > n = floor(nin + 0.5); > if (n != nin) ML_ERR_return_NAN; > > ! if (!R_FINITE((double)n) || !R_FINITE(pp) || > /* n=0, p=0, p=1 are not errors <TSL>*/ > n < 0 || pp < 0. || pp > 1.) ML_ERR_return_NAN;Hmm... But does it at all make sense to pass an integer to R_FINITE? and why isn't there a prototype causing automatic casting anyway? -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907
ripley@stats.ox.ac.uk
2005-Apr-02 19:38 UTC
[Rd] Solaris10/amd64 + SunSutio Compile (PR#7767)
On Sat, 2 Apr 2005, Peter Dalgaard wrote:> teru@sodan.ecc.u-tokyo.ac.jp writes: > >> Full_Name: Teru KAMOGASHRIA >> Version: 2.0.1 >> OS: SunOS sun 5.10 Generic i86pc i386 i86pc >> Submission from: (NULL) (219.5.176.24) >> >> >> rbinom.c cannot be compiled because of the casting problem. >> >> /opt/SUNWspro/bin/cc -I. -I../../src/include -I../../src/include >> -I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -g -c rbinom.c -o >> rbinom.o >> "rbinom.c", line 60: operand must have real floating type: op "isfinite" >> cc: acomp failed for rbinom.c >> >> Following patch may solve this problem. >> >> *** R-2.0.1.orig/src/nmath/rbinom.c Mon Nov 15 21:33:01 2004 >> --- R-2.0.1/src/nmath/rbinom.c Sun Apr 3 00:19:52 2005 >> *************** >> *** 57,63 **** >> n = floor(nin + 0.5); >> if (n != nin) ML_ERR_return_NAN; >> >> ! if (!R_FINITE(n) || !R_FINITE(pp) || >> /* n=0, p=0, p=1 are not errors <TSL>*/ >> n < 0 || pp < 0. || pp > 1.) ML_ERR_return_NAN; >> >> --- 57,63 ---- >> n = floor(nin + 0.5); >> if (n != nin) ML_ERR_return_NAN; >> >> ! if (!R_FINITE((double)n) || !R_FINITE(pp) || >> /* n=0, p=0, p=1 are not errors <TSL>*/ >> n < 0 || pp < 0. || pp > 1.) ML_ERR_return_NAN; > > Hmm... But does it at all make sense to pass an integer to R_FINITE?Dunno. It was in the original (r574 code), with finite rather than R_FINITE. It would make sense to test nin (rather than n).> and why isn't there a prototype causing automatic casting anyway?Because isfinite is a macro. (Solaris 10 is rather new, which is probably why we have not seen this before. We received our CDs last week.) -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595