Grokbase Groups R r-devel March 2009
FAQ
Hi,

I am having problems installing the XML package with R-devel on
freebsd. If I simply do install.packages("XML"), it says that the
parser.h file is not found. After reading the INSTALL file, I have set

setenv XML_CONFIG /usr/local/bin/xml2-config
setenv LIBXML_LIBDIR -L/usr/local/lib
setenv LIBXML_INCDIR -I/usr/local/include/libxml2/libxml

and install.packages("XML") fails with

checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking for libxml/parser.h... (cached) no
checking for gnome-xml/parser.h... (cached) no
Located parser file -I/usr/local/include/libxml2/libxml/parser.h
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
You are trying to use a version 2.* edition of libxml
but an incompatible library. The header files and library seem to be
mismatched. If you have specified LIBXML_INCDIR, make certain to also
specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in
the default
directories.
ERROR: configuration failed for package 'XML'
* Removing '/usr/local/share/R-devel/library/XML'
Warning in install.packages("XML", clean = TRUE) :
installation of package 'XML' had non-zero exit status

Some version info on my machine:

erdos# portversion -F "libxml*"
libxml2-2.7.3 =

erdos# xml2-config --version
2.7.3

erdos# ls /usr/local/lib/libxml*
/usr/local/lib/libxml2.a /usr/local/lib/libxmlparse.so@
/usr/local/lib/libxml2.la* /usr/local/lib/libxmlparse.so.1*
/usr/local/lib/libxml2.so@ /usr/local/lib/libxmltok.a
/usr/local/lib/libxml2.so.5* /usr/local/lib/libxmltok.la*
/usr/local/lib/libxmlparse.a /usr/local/lib/libxmltok.so@
/usr/local/lib/libxmlparse.la* /usr/local/lib/libxmltok.so.1*

The header LIBXML_INCDIR/xmlversion.h does define version as 2.7.3.
Does anyone have an idea of what may be going wrong?

h.
--
+---
Hiroyuki Kawakatsu
Business School, Dublin City University
Dublin 9, Ireland. Tel +353 (0)1 700 7496

Search Discussions

  • Duncan Temple Lang at Mar 11, 2009 at 1:14 pm
    Hi Hiroyuki



    Hiroyuki Kawakatsu wrote:
    Hi,

    I am having problems installing the XML package with R-devel on
    freebsd. If I simply do install.packages("XML"), it says that the
    parser.h file is not found. After reading the INSTALL file, I have set

    setenv XML_CONFIG /usr/local/bin/xml2-config
    setenv LIBXML_LIBDIR -L/usr/local/lib
    setenv LIBXML_INCDIR -I/usr/local/include/libxml2/libxml
    That should probably be
    setenv LIBXML_INCDIR -I/usr/local/include/libxml2

    (rather than having the additional /libxml after it.)

    Did you install libxml2 version 2.7.3 yourself,
    i.e. separately from the installation of the operating system?
    Is /usr/local/lib being searched for .so files by your dynamic
    loader?

    Try

    ldd `which xmllint`

    to see what shared libraries it finds? Does it list
    libxml2.so.2 and if so, where is the file to which it points -
    /usr/lib or /usr/local/lib ? If it is /usr/lib, that is the
    problem.

    If this doesn't identify the problem, please download
    the XML_2.3-0.tar.gz file and issue the commands

    tar zxf XML_2.3-0.tar.gz
    R CMD INSTALL XML

    and send me the file XML/config.log and I can try to
    find out what is going wrong form the details in that.

    Thanks,
    D.

    and install.packages("XML") fails with

    checking for stdint.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking for libxml/parser.h... (cached) no
    checking for gnome-xml/parser.h... (cached) no
    Located parser file -I/usr/local/include/libxml2/libxml/parser.h
    checking for gzopen in -lz... yes
    checking for xmlParseFile in -lxml2... yes
    You are trying to use a version 2.* edition of libxml
    but an incompatible library. The header files and library seem to be
    mismatched. If you have specified LIBXML_INCDIR, make certain to also
    specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in
    the default
    directories.
    ERROR: configuration failed for package 'XML'
    * Removing '/usr/local/share/R-devel/library/XML'
    Warning in install.packages("XML", clean = TRUE) :
    installation of package 'XML' had non-zero exit status

    Some version info on my machine:

    erdos# portversion -F "libxml*"
    libxml2-2.7.3 =

    erdos# xml2-config --version
    2.7.3

    erdos# ls /usr/local/lib/libxml*
    /usr/local/lib/libxml2.a /usr/local/lib/libxmlparse.so@
    /usr/local/lib/libxml2.la* /usr/local/lib/libxmlparse.so.1*
    /usr/local/lib/libxml2.so@ /usr/local/lib/libxmltok.a
    /usr/local/lib/libxml2.so.5* /usr/local/lib/libxmltok.la*
    /usr/local/lib/libxmlparse.a /usr/local/lib/libxmltok.so@
    /usr/local/lib/libxmlparse.la* /usr/local/lib/libxmltok.so.1*

    The header LIBXML_INCDIR/xmlversion.h does define version as 2.7.3.
    Does anyone have an idea of what may be going wrong?

    h.
  • Hiroyuki Kawakatsu at Mar 11, 2009 at 1:57 pm
    On 3/11/09, Duncan Temple Lang wrote:
    [...]
    That should probably be
    setenv LIBXML_INCDIR -I/usr/local/include/libxml2

    (rather than having the additional /libxml after it.)
    OK, thanks. But this still fails.
    Did you install libxml2 version 2.7.3 yourself,
    i.e. separately from the installation of the operating system?
    I did not install myself. It must have been installed as dependency of
    some other package.
    Is /usr/local/lib being searched for .so files by your dynamic
    loader?

    Try

    ldd `which xmllint`

    to see what shared libraries it finds? Does it list
    libxml2.so.2 and if so, where is the file to which it points -
    /usr/lib or /usr/local/lib ? If it is /usr/lib, that is the
    problem.
    erdos# ldd `which xmllint`
    /usr/local/bin/xmllint:
    libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x80063e000)
    libz.so.4 => /lib/libz.so.4 (0x800884000)
    libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x800998000)
    libm.so.5 => /lib/libm.so.5 (0x800b91000)
    libc.so.7 => /lib/libc.so.7 (0x800cab000)

    If this doesn't identify the problem, please download
    the XML_2.3-0.tar.gz file and issue the commands

    tar zxf XML_2.3-0.tar.gz
    R CMD INSTALL XML

    and send me the file XML/config.log and I can try to
    find out what is going wrong form the details in that.
    [...]

    Aha, thanks for the hint. Once I checked the config.log file, I found
    the source of the error. XML was using a different version of gcc than
    that used from building R-devel. So the solution was simply to do

    R CMD INSTALL --configure-vars="MAKE=gmake CC=gcc44 ..." XML

    Thanks very much for your help. Is there a way to automagically use
    the configure-vars used to build R for any package installs without
    having to explicitly pass them as above?

    h.
    --
    +---
    Hiroyuki Kawakatsu
    Business School, Dublin City University
    Dublin 9, Ireland. Tel +353 (0)1 700 7496
  • Robert Hijmans at Mar 11, 2009 at 2:40 pm
    I would like to write an S4 generic for 'median', but I am not sure
    how to do this properly as the function does not have a "..." argument

    I can do this

    setGeneric("median", function(x, na.rmúLSE)
    standardGeneric("median"))

    but I want to be able to pass it a number of objects of the same
    class, so I need a ... argument; or use signature='list' which is not
    very useful.

    I can do this:

    setGeneric("median", function(x, ..., na.rmúLSE)
    standardGeneric("median"))

    and

    setMethod('median', signature(x='ANY'),
    function(x, ..., na.rmúLSE){ x <- c(x, ...)
    return(stats::median(x, na.rm=na.rm))
    # }
    #)

    setMethod("median", signature(x='Raster'),
    function(x, ..., na.rmúLSE){

    # rasters <- list(...)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupr-devel @
categoriesr
postedMar 11, '09 at 11:28a
activeMar 11, '09 at 2:40p
posts4
users3
websiter-project.org
irc#r

People

Translate

site design / logo © 2023 Grokbase