From ploua at allstate.com  Fri Dec 21 00:45:56 2007
From: ploua at allstate.com (Louisell, Paul)
Date: Thu, 20 Dec 2007 15:45:56 -0800
Subject: [Rd] 64-bit R build with Studio 12 on Sparc v9
Message-ID: <633AD4C78F3E8F489614A06990F6077B025CCF0B@a0203-xpo0111-s.hodc.ad.allstate.com>

Hi,

I'm working on a server with a sparcv9 chip using SunOS 5.9 Generic May
2002. The compilers are the Sun Studio 12 compilers. I'm trying to build
a 64-bit version of R-2.6.1, and while the configure script runs, the
make does not.

Here are the options I set in config.site:
________________________________________________________________________
_

R_PAPERSIZE=letter
CC="cc -m64"
CFLAGS="-xO5 -xlibmil -xmemalign=8s"
F77="f95 -m64"
FFLAGS="-xO5 -xlibmil -xmemalign=8s"
LDFLAGS="-L/opt/SUNWspro/lib/v9 -L/usr/local/lib"
CXX="CC -m64"
CXXFLAGS="-xO5 -xlibmil -xmemalign=8s"
FC="f95 -m64"
FCFLAGS="-xO5 -xlibmil -xmemalign=8s"
________________________________________________________________________
__

Here's the command invoking configure:
________________________________________________________________________
__

./configure --with-blas --with-lapack --enable-BLAS-shlib
________________________________________________________________________
__

And here are the last several lines of the screen output from running
the configure script:
________________________________________________________________________
__

R is now configured for sparc-sun-solaris2.9

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                cc -m64  -xO5 -xlibmil -xmemalign=8s
  Fortran 77 compiler:       f95 -m64  -xO5 -xlibmil -xmemalign=8s

  C++ compiler:              CC -m64  -xO5 -xlibmil -xmemalign=8s
  Fortran 90/95 compiler:    f95 -m64 -xO5 -xlibmil -xmemalign=8s
  Obj-C compiler:            cc 

  Interfaces supported:      X11
  External libraries:        readline, BLAS(SunPerf)
  Additional capabilities:   iconv, MBCS, NLS
  Options enabled:           shared BLAS, R profiling, Java

  Recommended packages:      yes

configure: WARNING: you cannot build the object documentation system
configure: WARNING: you cannot build DVI versions of the R manuals
configure: WARNING: you cannot build info or HTML versions of the R
manuals
configure: WARNING: you cannot build PDF versions of the R manuals
________________________________________________________________________
____

I'm not concerned about not being able to build the manuals. Here are
the last several lines of the screen output from running make:
________________________________________________________________________
____

making pcre_chartables.d from pcre_chartables.c
"./pcre_internal.h", line 168: Illegal number 4294967295U
*** Error code 2
make: Fatal error: Command failed for target `pcre_chartables.d'
Current working directory
/export/home/ploua/R_HOME/R-2.6.1/src/extra/pcre
*** Error code 1
make: Fatal error: Command failed for target `R'
Current working directory
/export/home/ploua/R_HOME/R-2.6.1/src/extra/pcre
*** Error code 1
make: Fatal error: Command failed for target `R'
Current working directory /export/home/ploua/R_HOME/R-2.6.1/src/extra
*** Error code 1
make: Fatal error: Command failed for target `R'
Current working directory /export/home/ploua/R_HOME/R-2.6.1/src
*** Error code 1
make: Fatal error: Command failed for target `R'
________________________________________________________________________
____

It seems that the C compiler is having a hard time reading standard C
constants. Some further (hopefully relevant) background:  Here is an
excerpt from the Studio 12 C User's Guide:
________________________________________________________________________
____

If you do not specify -xc99, the compiler defaults to -xc99=all,no_lib.
If you specify -xc99
without any values, the option is set to-xc99=all.
Note - Though the compiler support-level defaults to the language
features of the C99 standard,
the standard headers provided by the Solaris 8 and Solaris 9 operating
systems in /usr/include
do not conform with the 1999 ISO/IEC C standard. If you encounter error
messages, try
specifying -xc99=none to obtain the 1990 ISO/IEC C standard behavior for
these headers.
The 1999 C standard library semantics of routines that appeared in both
the 1990 and 1999 C
standard are not available and therefore cannot be enabled on Solaris 8
and Solaris 9 software.
The compiler issues an error message when you specify -xc99=lib directly
or indirectly on
Solaris 8 or Solaris 9 software.
________________________________________________________________________
____

I've tried adding the option '-xc99=none' to the C flags shown from
config.site above, but I get the same error on running make. When I
specify only '-xc99', I get an error telling me the library is
unavailable on Solaris 9--the User's Guide is telling the truth above. 

I've also tried modifying 'pcre_internal.h' by commenting out the lines
where it's trying to determine the type for 32-bit unsigned integers and
instead hard-coding things with 

typedef unsigned int pcre_uint32;

When I do this, I get the same error but originating in a different
file. I'm not a C programmer so I can't be certain what I've attempted
is reasonable (although I have received some guidance from people who
are C programmers). Is my only option to go through and find all
instances of '4294967295' in source files and hard-code things as I did
above for 'pcre_internal.h'? 

In the R Installation and Admin manual on page 42, it says, "However,
our tests were none too successful: Sparc 64-bit builds crashed." Here
they were referring to Solaris 10. I noticed that Brian Ripley produced
a successful build using Studio 12, but on x86_64 Linux. The references
to Solaris 9 used the Sun Forte 7 compilers. 

My ultimate question: Does anyone know how to successfully build a
64-bit target for R-2.6.1 using Studio 12 on a system with my
architecture? If not using Studio 12, how about Studio 11?

Thanks in advance for any help,



Paul Louisell 
650-833-6254 
ploua at allstate.com 
Associate Predictive Modeler (Statistician) 
Modeling & Data Analytics 
ARPC 



[Rd] 64-bit R build with Studio 12 on Sparc v9
Louisell, Paul