[Rd] Comments on R-1.2.1 builds (PR#851)

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Sat, 7 Apr 2001 17:18:47 +0200


>>>>> Kurt Hornik writes:

>>>>> Kurt Hornik writes:
>>>>> beebe  writes:
>>> The R-1.2.1 builds have gone fairly smoothly on most of my UNIX
>>> architectures, but there were many warnings reported by the picky SGI
>>> compiler that could be eliminated in future releases.

>>> Generally, I have found the SGI compilers very helpful in ferreting
>>> out portability problems, unused and/or obsolete variables, unexpected
>>> datatype coercions, etc., and they compile faster than any other
>>> compilers too.

>>> First, I configured like this:

>>> env CC='c89 -mips3 -O3' ./configure && make all

>>> This reports:

>>> R is now configured for mips-sgi-irix6.5

>>> Source directory:          .
>>> Installation directory:    /usr/local
>>> C compiler:                c89 -mips3 -O3  -OPT:IEEE_NaN_inf=ON -g
>>> C++ compiler:              c++  -g -O2
>>> FORTRAN compiler:          g77  -OPT:IEEE_NaN_inf=ON -g -O2

>>> X11 support:               yes
>>> Gnome support:             no
>>> Tcl/Tk support:            yes

>>> R profiling support:       yes
>>> R as a shared library:     no

>>> The build proceeds until this failure:

>>> g77 -OPT:IEEE_NaN_inf=ON  -g -O2 -c ch2inv.f -o ch2inv.o
>>> f771: Invalid option `-OPT:IEEE_NaN_inf=ON'
>>> make[3]: *** [ch2inv.o] Error 1

>>> Evidently, it was not prepared for the GNU Fortran compiler.

>> Yep, that is a bug.  I need some feedback for fixing this, though.  The
>> current logic is to run the autoconf R_C_OPTIEEE test if the platform is
>> IRIX.  The test itself tries to compile and run

>> #include <math.h>
>> #include <ieeefp.h>
>> int main () {
>> double x = 0;
>> fpsetmask(0); x = x / x; return (x != x);
>> }

>> and if that works adds -OPT:IEEE_NaN_inf=ON to both R_XTRA_CFLAGS and
>> R_XTRA_FFLAGS.

>> This obviously does not make sense for FORTRAN, and should be made more
>> defensive for C.

>> * For C, one should additionally test whether the compiler accepts this
>> flag.  I assume gcc would not, so should we do

>> if_not_using_gcc  check_arg("-OPT:IEEE_NaN_inf=ON")

>> * For FORTRAN, I am not sure whether the result of the above test has
>> any relevance.  Question is, do we have a FORTRAN test program similar
>> to the above to determine whether the flag is needed?  Again, we
>> should also check whether the compiler accepts the flag ...

>> * Or should we simply unconditionally add the flag for ``native'', i.e.,
>> non-GNU compilers?

>> (Sorry but I do not have access to SGIs ...)

> I would like to fix this for 1.2.3, so it would be great if anyone
> with access to IRIX could comment ... Personally, I'd prefer the last
> idea if this is feasible.

No reply, unfortunately.  As I do not have access to SGI systems, I have
unconditionally removed adding `-OPT:IEEE_NaN_inf=ON' to R_XTRA_FFLAGS.
No idea whether this breaks make check on SGI systems with a native
FORTRAN compiler, perhaps someone could check eventually.

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._