[Rd] Unable to build with working iconv support on Solaris9/x86

Professor Brian Ripley ripley at stats.ox.ac.uk
Tue Jul 17 08:04:17 CEST 2007

Note that as the R-admin says, you need to use a better iconv than
that supplied with most commercial Unices, including Solaris.

You can use GNU libiconv in either of two ways:

- as a preload plugin
- by installing it with the libiconv prefix, and ensuring its iconv.h
is first in your path.

If you have two libraries with the same entry point (iconv here)
which one gets resolved to is pretty arcane.  Hence the need for
a prefix.

I have used both routes on Solaris 10 and 8: the CSW libs use the
second, for example.  The preload route is pretty and can be applied
to an existing executable.

Lucas Barbuto wrote:
> Hi all,
> Have had a frustrating time trying to get R 2.5.1 running happily on  
> Solaris9/x86, the problems seem to stem mainly from libiconv  
> support.  After a couple of hours of experimenting, I came across the  
> following combination, note that iconv (the program, but not the  
> library) exists in the Solaris base system, I've manually installed  
> the full GNU distribution in /usr/local/apps/libiconv-1.11 but not  
> in /usr/local yet.
> CFLAGS="-I/usr/local/apps/libiconv-1.11/include -I/usr/local/include"  
> LDFLAGS="-L/usr/local/apps/libiconv-1.11/lib -R/usr/local/apps/ 
> libiconv-1.11/lib -L/usr/local/lib -R/usr/local/lib" ./configure -- 
> prefix=/usr/local/apps/r-2.5.1 --with-libiconv-prefix=/usr/local/apps/ 
> libiconv-1.11
> Note that the option --with-libiconv-prefix=/usr/local/apps/ 
> libiconv-1.11 won't get me past the configure phase by itself (fails  
> the iconv test), in fact as far as I can tell --with-libiconv-prefix  
> has no effect at all but I've been leaving it in just in case.

Right, and you fail the same test below.

> Anyway, with the environment variables CFLAGS and LDFLAGS set as  
> above, the process gets through configure and make successfully, but  
> fails 'make check' trying to do a conversion to "latin1"
>  > ## x is intended to be in latin1
>  > x <- "fa\xE7ile"
>  > Encoding(x)
> [1] "unknown"
>  > Encoding(x) <- "latin1"
>  > x
> [1]Error: unsupported conversion
> Execution halted
> ldd -s bin/exec/R confirms that R gets it's iconv from /usr/local/ 
> apps/libiconv-1.11/lib/libiconv.so.2 as expected

All that confirms is that you are linking to that DSO.

> ldd -s bin/exec/R
> [snip]
>     find object=libiconv.so.2; required by bin/exec/R
>      search path=/usr/local/apps/libiconv-1.11/lib:/usr/local/lib:/ 
> usr/local/apps/gcc-3.4.5/lib/gcc/i386-pc-solaris2.9/3.4.5  (RPATH  
> from file bin/exec/R)
>      trying path=/usr/local/apps/libiconv-1.11/lib/libiconv.so.2
>          libiconv.so.2 =>         /usr/local/apps/libiconv-1.11/lib/ 
> libiconv.so.2
> [snip]
> I don't know what else to try.  Anyone?
> Regards,
> --
> Lucas Barbuto                          E: lucasjb at csse.unimelb.edu.au
> System Administrator                                T: +613 8344 1270
> Department of CSSE
> The University of Melbourne           http://www.csse.unimelb.edu.au/
> ______________________________________________
> 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

More information about the R-devel mailing list