I am trying to compile R on Linux using SunStudio. Configure flags are
mostly as suggested in the R install guide.

CC=/opt/sun/sunstudio12.1/bin/suncc
CFLAGS="-g -xc99 -xlibmil -xlibmieee"
MAIN_CFLAGS=-g
SHLIB_CFLAGS=-g
CPPFLAGS="-I. -I/opt/sun/sunstudio12.1/prod/include
-I/opt/sun/sunstudio12.1/prod/include/cc"
CPPFLAGS+="-I/opt/sun/sunstudio12.1/prod/include/cc/sys
-I/usr/local/include"
F77=/opt/sun/sunstudio12.1/bin/sunf95
FFLAGS="-g -O -libmil "
SAFE_FFLAGS="-g -libmil"
CPICFLAGS=-Kpic
FPICFLAGS=-Kpic
SHLIB_LDFLAGS=-shared
LDFLAGS=-L/opt/sun/sunstudio12.1/lib/386
CXX=/opt/sun/sunstudio12.1/bin/sunCC
CXXFLAGS="-g -xlibmil -xlibmieee"
CXXPICFLAGS=-Kpic
SHLIB_CXXLDFLAGS="-G -lCstd"
FC=/opt/sun/sunstudio12.1/bin/sunf95
FCFLAGS=$FFLAGS
FCPICFLAGS=-Kpic
MAKE=dmake

R install guide also indicates that: "The OS needs to have enough support
for wide-character types: this is checked at configuration. Specifically,
the C99 functionality of headers wchar.h and wctype.h, types wctans_t and
mbstate_t and functions mbrtowc, mbstowcs, wcrtomb, wcscoll, wcstombs,
wctrans, wctype, and iswctype."
Configure stops with the following error message:

checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for iconv... in libiconv
checking whether iconv accepts "UTF-8", "latin1" and "UCS-"... yes
checking for iconvlist... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking whether mbrtowc exists and is declared... yes
checking whether wcrtomb exists and is declared... yes
checking whether wcscoll exists and is declared... yes
checking whether wcsftime exists and is declared... yes
checking whether wcstod exists and is declared... yes
checking whether mbstowcs exists and is declared... yes
checking whether wcstombs exists and is declared... yes
**checking whether wctrans exists and is declared... no
checking whether iswblank exists and is declared... no
checking whether wctype exists and is declared... no
checking whether iswctype exists and is declared... no
configure: error: Support for MBCS locales is required.*

Relevant parts of config.log are as follows:

configure:39472: checking whether iswctype exists and is declared
configure:39510: /opt/sun/sunstudio12.1/bin/suncc -o conftest -g -xc99
-xlibmil -xlibmieee -m32  -I. -I/opt/sun/sunstudio12.1/prod/include
-I/opt/sun/sunstudio12.1/prod/include/cc-I/opt/sun/sunstudio12.1/prod/include/cc/sys
-I/usr/local/include  -L/opt/sun/sunstudio12.1/lib/386 -L/usr/local/lib
conftest.c -ldl -lm  -liconv >&5
*"/usr/include/wctype.h", line 112: syntax error before or at: __wc
"/usr/include/wctype.h", line 195: syntax error before or at: towlower
"/usr/include/wctype.h", line 302: syntax error before or at: towupper_l
"/usr/include/wctype.h", line 302: syntax error before or at: __wc
"/usr/include/wctype.h", line 310: syntax error before or at: towctrans_l
"/usr/include/wctype.h", line 310: syntax error before or at: __wc
cc: acomp failed for conftest.c
configure:39516: $? = 1
configure: failed program was:
| /* confdefs.h.  */
*| #define PACKAGE_NAME "R"
........
........
*| #include <wctype.h>
*|
| #ifdef F77_DUMMY_MAIN
|
| #  ifdef __cplusplus
|      extern "C"
| #  endif
|    int F77_DUMMY_MAIN() { return 1; }
|
| #endif
*| int
| main ()
| {
| #ifndef iswctype
|   char *p = (char *) iswctype;
| #endif
|
|   ;
|   return 0;
| }
configure:39534: result: no
configure:39710: error: Support for MBCS locales is required.*

I am not sure if this is a Linux issue or if it is a SunStudio issue.  Has
anybody tried to compile R on Linux using SunStudio?

Thanks in advance,

Russ

	[[alternative HTML version deleted]]

