[Rd] problems with iconv
RogerP
rpickeri at mail.nih.gov
Tue Dec 13 23:10:12 CET 2011
Sorry, but IMHO saying "read the manual" does not constitute actual help.
But here it is from the manual:
A suitably comprehensive iconv function is essential. The R usage requires
iconv to be able to translate between "latin1" and "UTF-8", to recognize ""
(as the current encoding) and "ASCII", and to translate to and from the
Unicode wide-character formats "UCS-[24][BL]E" — this is true for glibc but
not of most commercial Unixes. However, you can make use of GNU libiconv
(possibly as a plug-in replacement: see
http://www.gnu.org/software/libiconv/).
Well, that's just what I did. I downloaded libiconv and compiled and linked
it. Oh, so where to put it. Hmmmm, don't see it anywhere here. Do you?
Also from the manual:
/You will need GNU libiconv and readline: the Solaris version of iconv is
not sufficiently powerful.
For the Solaris Studio compilers a little juggling of paths was needed to
ensure GNU libiconv (in /usr/local) was used rather than the Solaris iconv:
CC="cc -xc99"
CFLAGS="-O -xlibmieee"
F77=f95
FFLAGS=-O4
CXX="CC -library=stlport4"
CXXFLAGS=-O
FC=f95
FCFLAGS=$FFLAGS
FCLIBS="-lfai -lfsu"
R_LD_LIBRARY_PATH="/usr/local/lib:/opt/csw/gcc4/lib:/opt/csw/lib"
For a 64-bit target add -m64 to the compiler macros and use something like
LDFLAGS=-L/usr/local/lib/sparcv9 or LDFLAGS=-L/usr/local/lib/amd64 as
appropriate. /
Well, I did that. Here are some of my options from the config.site:
CC="cc"
## Debugging and optimization options for the C compiler.
## Use this to specify CFLAGS for the version of the C compiler
## specified above.
## If unspecified, defaults to '-g -O2' for gcc,
## and '-g' in all other cases except icc (for which see R-admin.html).
#CFLAGS="-xlibmieee"
CFLAGS="-xO5 -xc99 -xlibmieee -xlibmil -nofstore -xtarget=native -m64"
FFLAGS="-xO5 -libmil -m64"
## Options for safe compilation under the FORTRAN 77 compiler.
## Use this to specify FFLAGS for the version of the compiler specified
## above, using as accurate a result as possible, e.g. no optimization
## or using -ffloat-store.
SAFE_FFLAGS="-xO5 -libmil"
CXX="CC -library=stlport4"
## Options for the C++ compiler.
CXXFLAGS="-xO5 -xlibmil -nofstore -features=tmplrefstatic"
## Any special flags which must be used when compiling C++ code to be
## turned into a shared object. If this variable is left unspecified
## an attempt is made to automatically detect the correct value.
CXXPICFLAGS=-Kpic
LDFLAGS=-L/opt/sunstudio12.1/lib/amd64
SHLIB_LDFLAGS=-shared
SHLIB_CXXLDFLAGS=-G
SHLIB_FCLDFLAGS=-G
## The command to be used to load shared objects which contain object
## files from the C++ compiler. This is usually the C++ compiler/linker,
## but the automatic choice can be overridden by means of this
## variable.
## SHLIB_CXXLD=
## Any special flags which are required when creating shared objects
## containing object files from a C++ compiler. This is usually
## automatically detected by configure, and anything set here will be in
## addition unless SHLIB_CXXLD is given.
## SHLIB_CXXLDFLAGS=
## FORTRAN 95 compiler: optional for use in packages.
## Analogous to the F77 and CXX settings.
FC=f95
FCFLAGS=$FFLAGS
FCPICFLAGS=-Kpic
SHLIB_FCLD=${FC}
## Unlike SHLIB_CXXLDFLAGS, SHLIB_FCLDFLAGS is never additional
SHLIB_FCLDFLAGS=${SHLIB_LDFLAGS}
## Additional libraries needed to link a shared object, e.g. on x86 Solaris
FCLIBS="-lfai -lfai2 -lfsu"
## Tcl/Tk settings.
## Use TCLTK_LIBS for all '-L' and '-l' options needed for linking
## against the Tcl and Tk library.
## TCLTK_LIBS=
## Use TCLTK_CPPFLAGS for all '-I' options needed for finding the tcl.h
## and tk.h headers.
## TCLTK_CPPFLAGS=
## Browser default
## Default setting for the R_BROWSER env variable
## If unset configure searches in turn for (currently)
## firefox mozilla galeon opera xdg-open kfmclient gnome-moz-remote open
## and uses the full path.
## R_BROWSER=
## BLAS and LAPACK settings
## Use BLAS_LIBS for all '-L' and '-l' options needed for linking
## against an external BLAS implementation.
## BLAS_LIBS=
## Use LAPACK_LIBS for all '-L' and '-l' options needed for linking
## against an external LAPACK implementation.
## Note that (see R-admin) that our main intention is to allow a
## LAPACK-containing BLAS to be used, so this is rarely needed, and
## it is not used if the BLAS already contains LAPACK.
LAPACK_LIBS=/opt/solstudio12.2/lib
## Make name.
## Set this if you want to use a make by another name.
## For example, if your GNU make is called 'gmake', use 'MAKE=gmake'.
## MAKE=
## Tar name
## Set this to prefer a tar which has the capability to automagically
## read compressed archives. The default is to choose 'gtar' or
## 'gnutar'(normally GNU tar) then 'tar'.
## Note that 'bsdtar' (from the libarchive project) is known to create
## archives in a non-POSIX format that untar() cannot read,
## so should be avoided.
## TAR=
## Library path
## This is be default created from libraries added to LIBS.
## Allow user to override.
R_LD_LIBRARY_PATH="/usr/local/lib:/opt/csw/gcc4/lib:/opt/csw/lib"
READLINE_LIBS = /usr/local/lib
USE_NLS = no
AR_FLAGS=-crS
lt_AR_FLAGS=-crS
LIBICONV=/usr/local/lib
So, here it is - all the revelent documentation on iconv. If I've missed
anything please let me know. If you see where in the documentation I missed
some cryptic clue on how to get iconv to work or where to put it or it's
headers, also please let me know.
One things for sure - you can't say I've not read the documentation!
Roger
--
View this message in context: http://r.789695.n4.nabble.com/problems-with-iconv-tp4191177p4192313.html
Sent from the R devel mailing list archive at Nabble.com.
More information about the R-devel
mailing list