gagolews / stringi

Fast and portable character string processing in R (with the Unicode ICU)
https://stringi.gagolewski.com/
Other
304 stars 44 forks source link

Error installing stringi from packrat bundle on RedHat server #323

Closed austingrosel closed 5 years ago

austingrosel commented 6 years ago

I'm trying to install a basic list of packages from packrat that also holds stringi. I'm using shiny server on RedHat The command I ran is below. I'm very new to working with shiny server so it's possible that it's a stupid mistake on my end. It looks like it could be something with ICU4C?

packrat::unbundle("~acgrose/TestPackratApp-2018-07-30.tar.gz", "/opt/app/shinyapps")

Output:

- Untarring 'TestPackratApp-2018-07-30.tar.gz' in directory '/opt/app/shinyapps'...
- Restoring project library...
Installing BH (1.66.0-1) ... 
    OK (built source)
Installing R6 (2.2.2) ... 
    OK (built source)
Installing RColorBrewer (1.1-2) ... 
    OK (built source)
Installing Rcpp (0.12.17) ... 
    OK (built source)
Installing assertthat (0.2.0) ... 
    OK (built source)
Installing base64enc (0.1-3) ... 
    OK (built source)
Installing colorspace (1.3-2) ... 
    OK (built source)
Installing crayon (1.3.4) ... 
    OK (built source)
Installing dichromat (2.0-0) ... 
    OK (built source)
Installing digest (0.6.15) ... 
    OK (built source)
Installing fansi (0.2.3) ... 
    OK (built source)
Installing glue (1.3.0) ... 
    OK (built source)
Installing gtable (0.2.0) ... 
    OK (built source)
Installing jsonlite (1.5) ... 
    OK (built source)
Installing labeling (0.3) ... 
    OK (built source)
Installing lazyeval (0.2.1) ... 
    OK (built source)
Installing magrittr (1.5) ... 
    OK (built source)
Installing mime (0.5) ... 
    OK (built source)
Installing packrat (0.4.9-3) ... 
    OK (built source)
Installing rlang (0.2.0) ... 
    OK (built source)
Installing sourcetools (0.1.7) ... 
    OK (built source)
Installing stringi (1.2.4) ... 
[1] "Command failed (1)\n\nFailed to run system command:\n\n\t'/opt/app/R/lib64/R/bin/R' --vanilla CMD INSTALL '/tmp/Rtmp4zzasY/stringi' --library='/opt/app/shinyapps/TestPackratApp/packrat/lib/x86_64-pc-linux-gnu/3.5.1' --install-tests --no-docs --no-multiarch --no-demo \n\nThe command failed with output:\n* installing *source* package 'stringi' ...\n** package 'stringi' successfully unpacked and MD5 sums checked
checking for R_HOME... /opt/app/R/lib64/R
checking for R... /opt/app/R/lib64/R/bin/R
checking for endianness... little
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for local ICUDT_DIR... icu61/data
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking elf.h usability... yes
checking elf.h presence... yes
checking for elf.h... yes
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++11 accepts -g... yes
checking whether the C++ compiler supports the long long type... yes
checking whether the compiler implements namespaces... yes
checking whether the compiler supports Standard Template Library... yes
checking whether std::map is available... yes
checking for pkg-config... /bin/pkg-config
checking with pkg-config for the system ICU4C... no
pkg-config did not detect ICU4C-devel libraries installed
Trying with \"standard\" fallback flags
checking whether we may build an ICU4C-based project... no

The available ICU4C cannot be used
checking whether we may compile src/icu61/common/putil.cpp... yes
checking whether we can fetch icudt... icudt already downloaded

I'm not really sure what to make of this. Is this a packrat problem or a stringi problem?

gagolews commented 6 years ago

this is not the full configure output, I need more data

cderv commented 6 years ago

Are you in an online or offline environment ? I had issues with packrat in an offline environment to indicate the ICU source to compile with.

mbrbus commented 6 years ago

The build process requires an external artifact (icudt...zip) which should be handled by the R dependency process. Downloading it during the build is not clean. In off-line environment this WON'T work. Please rework the stringi Makefile.

cderv commented 6 years ago

In an offline environment, you can download the source (icudt...zip) and configure an environment variable to indicate to the installation process where the downloaded bundle is and not try to download it. https://github.com/gagolews/stringi/blob/d8ab12f53c10cd13736a0fca88d6fceda1760357/INSTALL#L100 This can also be done directly in R with install.packages("stringi", configure.vars="ICUDT_DIR=<icudt_dir>") if necessary.

It is not perfect but this can be done offline.

Not sure the issue this here 🤔

icudt already downloaded

gagolews commented 5 years ago

possibly related to #296

gagolews commented 5 years ago

Should be working now.

By the way, if you have no internet access on local machines, you can build a distributable source package that includes all the required ICU data files (for off-line use) by omitting some relevant lines in the .Rbuildignore file. The following command sequence should do the trick:

wget https://github.com/gagolews/stringi/archive/master.zip -O stringi.zip
unzip stringi.zip
sed -i '/\/icu..\/data/d' stringi-master/.Rbuildignore
R CMD build stringi-master

Assuming the most recent development version is 1.3.1, a file named stringi_1.3.1.tar.gz is created in the current working directory. The package can now be installed (the source bundle may be propagated via scp etc.) by executing:

R CMD INSTALL stringi_1.3.1.tar.gz

or by calling install.packages("stringi_1.3.1.tar.gz", repos=NULL), from within an R session.