From leonardz at sickkids.ca  Tue Jul 17 21:28:47 2007
From: leonardz at sickkids.ca (Len Zaifman)
Date: Tue, 17 Jul 2007 15:28:47 -0400 (EDT)
Subject: [Rd] Problem building R with Sun Studio Compiler
In-Reply-To: <Pine.LNX.4.64.0707171021530.27991@auk.stats>
References: <13011.142.20.196.170.1184602626.squirrel@webmail.sickkids.ca>
	<Pine.LNX.4.64.0707161746130.8695@gannet.stats.ox.ac.uk>
	<Pine.LNX.4.64.0707171021530.27991@auk.stats>
Message-ID: <22588.142.20.196.170.1184700527.squirrel@webmail.sickkids.ca>

Thanks for all the replies:

Dr. Ripley gets it right:

I want -fast which turns on nofstore which caused the infinite loop and also pointed out non-IEEE arithmetic.

On SUSE 10.2  I used -fast -fstore -fsimple=1 which fixed both problems and still optimised:

make check passed and I get for gcc4.1 vs SunStudio 12:
186 vs 149 seconds, with all tests passed in both cases.

Prof Brian Ripley said:
> On Mon, 16 Jul 2007, Prof Brian Ripley wrote:
>
>> The R-admin manual did tell you not to do that!
>>
>>  When using the Sun compilers do @emph{not} specify @option{-fast}, as
>>  this disables @acronym{IEEE} arithmetic and @command{make check} will
>>  fail.
>>
>> That was for Solaris and SunStudio 11, but I presume these are basically the
>> same compilers.  (--fast has been a no-no for as long as I have been using R
>> on Solaris, ca 10 years.)
>
> There is another problem with -fast on x86 that is probably the cause of
> your problem.  It implies -nofstore, and we needed to force storage on
> some Fortran routines under g77/gfortran to avoid an infinite loop.
>
> However, even if you set SAFE_FFLAGS, the likely problems with IEC60559
> compliance remain.
>
>>
>> On Mon, 16 Jul 2007, Len Zaifman wrote:
>>
>>> I would like to Build R-2.5.1 on OpenSUSE 10.2 using the SunStudio 12
>>> compilers(http://developers.sun.com/sunstudio/index.jsp)
>>>
>>> R builds and passes make check fine without optimising. However, when I try
>>> to compile with optimisation turned on
>>> (-fast) the build gets stuck in an infinite loop  at the following point:
>>>
>>> Sun_Studio/sunstudio12/bin/cc -m64 -shared -Kpic   -m64 -fPIC  -o
>>> grDevices.so chull.o devNull.o devPicTeX.o devPS.o
>>> devQuartz.o init.o
>>> mkdir -p -- ../../../../library/grDevices/libs
>>> make[5]: Leaving directory
>>> `/export/home/leonardz/ccb/HPF/support/R-2.5.1/ss12/R-2.5.1/src/library/grDevices/src'
>>> make[4]: Leaving directory
>>> `/export/home/leonardz/ccb/HPF/support/R-2.5.1/ss12/R-2.5.1/src/library/grDevices/src'
>>>
>>> R is running at this point and will run for as long as I do not kill it. If
>>> I compile without -fast the next line in the make is:
>>>
>>> make[3]: Entering directory
>>> `/export/home/leonardz/ccb/HPF/support/R-2.5.1/ss12/R-2.5.1/src/library/graphics'
>>>
>>> and the entire package builds and make check verifies correctly. Any ideas
>>> on why this is happening?
>>>
>>> The build works fine for gcc as well.
>>>
>>>
>>
>>
>
> --
> Brian D. Ripley,                  ripley at 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
>


-- 
Len Zaifman
Systems Manager, Supercomputing Systems
Centre for Computational Biology
Hospital for Sick Children
Toronto, Ont. M5G 1X8
leonardz at sickkids.ca
(416)813-5513



[Rd] Problem building R with Sun Studio Compiler
Len Zaifman