How to install stringi library from archive and install the local icu52l.zip

前端 未结 5 877
我寻月下人不归
我寻月下人不归 2021-01-11 16:18

We\'re bumbling through making some R code work in a production environment and as part of that we\'re installing some R packages as follows:

# Default direc         


        
相关标签:
5条回答
  • 2021-01-11 16:25

    I had the same problem. What I did is similar to the solution proposed by gagolews. Gagolews' solution didn't exactly work for me because I couldn't find a zip copy of stringi to download. I downloaded icudt from http://static.rexamine.com/packages/icudt52l.zip to a folder, say /home/tmp/ then I installed from the net, but providing the local copy of icudt, by typing the following in R:

    install.packages("stringi", # this will install from online
    configure.vars="ICUDT_DIR=/home/tmp/") #but use the downloaded version of icudt
    

    This worked for me.

    0 讨论(0)
  • 2021-01-11 16:34

    Note: for Stringi >= 0.5-1 please check the answer by @gagolews


    From INSTALL file:

    The stringi package depends on the ICU4C >= 50 library.

    So libicu42 is far to old.

    If you check install.R file you'll find following lines:

    mirrors <- c("http://static.rexamine.com/packages/",
        "http://www.mini.pw.edu.pl/~gagolews/stringi/",
        "http://www.ibspan.waw.pl/~gagolews/stringi/")
    

    A couple of lines later you'll find something like this:

    if (!grepl("^https?://", href)) {
        # try to copy icudt from a local repo
        if (!file.exists(href)) return("no icudt in a local repo")
    

    If you add local path at the beginning of the mirrors and put downloaded libraries it seems to work as expected. Here you can a patch I've used: https://gist.github.com/zero323/338c8fb0faf46e5ac06d

    So my solution would be to:

    • clone the repostiory
    • checkout version you want
    • apply patch with a path to the local version of the ICU
    • install package from source

    There is probably a better way, but that is what I came up so far.

    0 讨论(0)
  • 2021-01-11 16:36
    1. Clone the git clone https://github.com/gagolews/stringi.git.
    2. Edit the .Rbuildignore file and get rid of the ^src/icu55/data line.
    3. Run R CMD build stringi_dir_name to build tar.gz file.
    4. Install the obtained .tar.gz file on your machine(s), e.g., via install.packages("stringi_xxx.tar.gz")
    0 讨论(0)
  • 2021-01-11 16:38

    This work with R-3.2.3 in Linux Mint 17.2. 1. Install 'libicu-dev' from Software Manager. 2. in R : install.packages('stringi')

    For further information, try to read this instruction: https://cran.r-project.org/web/packages/stringi/INSTALL

    0 讨论(0)
  • 2021-01-11 16:48

    This will be fixed in the upcoming 0.5-1 version of stringi, see this feature request.

    An appropriate environmental variable (ICUDT_DIR) is now used by the ./configure script to indicate the directory from which a local copy of icudt should be fetched. It can be provided for example via a call to:

    install.packages("stringi_0.5-1.zip", # assuming that we install from a downloaded archive
        configure.vars="ICUDT_DIR=<dir_to_copy_icudt_from>")
    
    0 讨论(0)
提交回复
热议问题