From ripley at stats.ox.ac.uk  Sat Mar 11 09:02:11 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 11 Mar 2006 08:02:11 +0000 (GMT)
Subject: [Rd] problem building R-patched on x86-64 with PGI 6.1
In-Reply-To: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED913@usctmx1106.merck.com>
References: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED913@usctmx1106.merck.com>
Message-ID: <Pine.LNX.4.64.0603110749470.6922@gannet.stats.ox.ac.uk>

On Fri, 10 Mar 2006, Liaw, Andy wrote:

> Dear R-devel,
>
> [I'm not sure if this is appropriate for R-devel.  If not, I'm more than
> happy to move it to R-help.]

It is certainly not appropriate to R-help: see the posting guide.

> As those of you who saw my post on R-help know, I've been trying to build
> R-patched on a dual Opteron box running Scyld Beowulf, using the PGI 6.1
> compilers.  The build went fine, but I couldn't get it to pass make
> check-all.  Jennifer Lai, who reported success with PGI 6.0 previously,
> seems to have the same problem with 6.1.  Here are the particulars:
>
> Since R requires IEEE754 conformance, the flag to use for PGI is -Kieee.
> (BTW, configure still insist on sticking in -mieee-fp, which generates a
> warning.)  With that flag, the build runs into trouble with the first
> example in ?optim.  Running it by hand gives me:

Well, configure insists on doing so because we were told it was correct.
(Will change.)  Is -Kieee always correct for PG?
Looking at

http://www.amd.com/us-en/assets/content_type/DownloadableAssets/dwamd_PGI_nov603.pdf

suggests you might want to try -pc64 -Kieee.

>> optim(c(-1.2,1), fr, control=list(trace=6))
>  Nelder-Mead direct search function minimizer
> function value for initial parameters = 24.200000
>  Scaled convergence tolerance is 3.60608e-07
> Stepsize computed as 0.120000
> BUILD              3 24.200000 7.095296
> REFLECTION         5 15.080000 4.541696
> REFLECTION         7 7.095296 4.456256
> [...]
> HI-REDUCTION     191 0.000002 0.000000
> LO-REDUCTION     193 0.000001 0.000000
>
> and the process just hangs (until ctrl-z and kill -9).

This could well be a problem with extended precision: I'll see if I can 
spot anything.

> If I build R without the -Kieee flag, make check-all fails at arith-true.R,
> in particular, the following:
>
>> pretty(pi, n = 10) - 2:5
> [1] -2.220446e-16 -4.440892e-16 -8.881784e-16 -8.881784e-16
>
> whereas the build with the -Kieee flag gives:
>
>> pretty(pi, n = 10) - 2:5
> [1] 0 0 0 0
>
> and can pass the arith-true.R test.
>
> The configuration is as follows:
>
> export PG_HOME=/usr/pgi/linux86-64/6.1
> ~/Rbuild/R-patched/configure \
>     CC=pgcc \
>     CFLAGS="-g -Kieee" \
>     CPPFLAGS="-I$PG_HOME/include -I$PG_HOME/include/CC" \
>     CPICFLAGS=-fpic \
>     F77=pgf95 \
>     FFLAGS="-g -Kieee"\
>     FPICFLAGS=-fpic \
>     CXX=pgCC \
>     CXXFLAGS="-g -Kieee" \
>     CXXPICFLAGS=-fpic \
>     SHLIB_CXXLDFLAGS=-shared \
>     SHLIB_LDFLAGS=-shared \
>     LDFLAGS="-L$PG_HOME/libso -L/usr/lib64 -L/usr/X11R6/lib64" \
>     --without-tcltk \
>     --with-blas="-L/usr/pgi/linux86-64/6.1/libso -lacml"
>
> [The pgf95 (or pgf90) is needed for linking against ACML to work.  This
> should be unrelated as optim is in C.]
>
> I'd very much appreciate any pointers.
>
> Best,
> Andy
>
>
> Andy Liaw, PhD
> Biometrics Research    PO Box 2000 RY33-300
> Merck Research Labs        Rahway, NJ 07065
> andy_liaw(a)merck.com          732-594-0820
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
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



[Rd] problem building R-patched on x86-64 with PGI 6.1
Prof Brian Ripley