I am creating a new R package where I would like to call an external c library(libcouchbase).
My problem is how to get the package build system to find the libraries during linking. I am using a linux/ubuntu like system.
This is what I had so far do :
create an configure.ac
AC_INIT(rcouchbase, version-0.1)
AC_CHECK_LIB([couchbase], [lcb_create], [],
[AC_MSG_ERROR(Failed to locate libcouchbase >= 2.0.0)])
COUCHBASE_LIBS="$LIBS"
AC_SUBST(COUCHBASE_LIBS)
AC_OUTPUT(src/Makevars)
generate a configure using autoconf
system("autoconf configure.ac > configure | chmod +x configure")
create a makevars.in
# set by configure
COUCHBASE_LIBS = #COUCHBASE_LIBS#
PKG_LIBS = $(COUCHBASE_LIBS)
build my package:
When I build my package, the configure file sucess to find the
==> R CMD INSTALL --no-multiarch --with-keep.source rcouchbase
Here the some significant output:
==> R CMD INSTALL --no-multiarch --with-keep.source rcouchbase
* installing to library ‘/home/agstudy/R/packages’
* installing *source* package ‘rcouchbase’ ...
checking for gcc... gcc
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 accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for lcb_create in -lcouchbase... yes
configure: creating ./config.status
config.status: creating src/Makevars
make: Nothing to be done for `all'.
** libs
installing to /home/agstudy/R/packages/rcouchbase/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/agstudy/R/packages/rcouchbase/libs/rcouchbase.so':
/home/agstudy/R/packages/rcouchbase/libs/rcouchbase.so: undefined symbol: lcb_destroy
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/agstudy/R/packages/rcouchbase’
Exited with status 1.
So does anyone know what I should add to my makevars/config file to solve the linkng problem?
EDIT add shared library dependencies:
ldd libcouchbase.so
linux-vdso.so.1 => (0x00007fff0a7fe000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fea0a26e000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fea0a06a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fea09ca1000)
/lib64/ld-linux-x86-64.so.2 (0x00007fea0a7c5000)
When you say COUCHBASE_LIBS="$LIBS", who is filling in $LIBS for you?
At a first step, try to decompose the issue. You should us pieces: src/Makevars.in, but
not the generated src/Makevars. Does it have the correct library listed?
Also, look at / show us R CMD INSTALL ... output. Is there a link step with the library?
What you posted suggests not as the lcb_destroy symbol is missing.
In case you want to learn about Autotools / Automake, I have gone back to this (older) tutorial a few times; you may find it useful.
Edit: You are still confused. We don't want to see ldd libcouchbase; we presume that one is fine. Your package does not load so we need its linking step and its ldd output.
I.e. my RQuantLib package ends its R CMD INSTALL on
g++ -shared -o RQuantLib.so [many .o files removed] \
-L/usr/lib -lQuantLib -L/usr/lib/R/lib -lR
which clearly shows that it does link with the (required) QuantLib library.
Related
I am having an issue when deploying a shiny app that requires the package RQuantLib. When I'm running my application, everything works fine, even the part where the RQuantLib package is needed. However, when deploying the application, the process is stopped when building the package RQuantLib.
When I put into comments the line "library(RQuantLib)" the application can be deployed but I am obviously missing my parts based on the use of this package.
Here's the error :
[2018-11-17T22:26:33.546919933+0000] Building R package: RQuantLib (0.4.5)
/mnt/packages/build /mnt
* installing to library ‘/opt/R/3.5.0/lib/R/library’
* installing *source* package ‘RQuantLib’ ...
** package ‘RQuantLib’ successfully unpacked and MD5 sums checked
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 g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for R... yes
checking for quantlib-config... yes
configure: WARNING: RQuantLib requires QuantLib (>= 1.8.0).
configure: error: Please upgrade to a current version.
ERROR: configuration failed for package ‘RQuantLib’
* removing
‘/opt/R/3.5.0/lib/R/library/RQuantLib’################################# End
Task Log #################################
Erreur : Unhandled Exception: Child Task 565972976 failed: Error building
image: Error building RQuantLib (0.4.5). Build exited with non-zero status:
1
De plus : Warning message:
Error detecting locale: Error in read.table(file = file, header = header,
sep = sep, quote = quote, : incomplete final line found by readTableHeader
on 'raw'
(Using default: en_US)
Thank you in advance !
RQuantLib author here. I actually try to make this as plain as I can:
configure: WARNING: RQuantLib requires QuantLib (>= 1.8.0).
configure: error: Please upgrade to a current version.
ERROR: configuration failed for package ‘RQuantLib’
Also not sure what system you are on (as you didn't say) but both Debian and Ubuntu
have RQuantLib natively: sudo apt install r-cran-rquantlib is all it takes.
Otherwise it may be worth re-stating the somewhat obvious: to build RQuantLib from source you need both R and QuantLib on the system you are building (== installing) on if you install from source. Hence the attractiveness of installing binaries -- which I provide as Debian maintainer.
I am trying to build and check a package with some Fortran code in it under Windows 10
with R 3.4.0 updating some code previously in R 2.8.
I am doing this in three steps in the command window:
>R CMD build src
[...]
* checking DESCRIPTION meta-information ... OK
So I assume everything is ok with the DESCRIPTION file
then:
>R CMD check --no-examples --no-tests src
I get among other stuff:
* checking for file 'src/DESCRIPTION' ... OK
A bit further it gets wrong at
* checking whether package 'pckgname' can be installed
Looking at the log inside the file /src.Rcheck/00install.out, I read:
Error in .get_package_metadata(dir, FALSE) :
Files 'DESCRIPTION' and 'DESCRIPTION.in' are missing.
ERROR: installing Rd objects failed for package 'samara'
I have copied and pasted the DESCRIPTION file pretty much everywhere it made sense, including the top level directory and the \src directory or in those directory alone in some other trials, with always the same result.
This is strange because sometimes the DESCRIPTION file is recognized, sometimes it is not
There is only one similar post treating this subject:
R package building error
the author seems to have solved his problem but he doesn't know how.
Does anybody know what happened?
Following some requests, here is the content of the files 00check.log and 00install.out:
00check.log
C:\Users\username\Documents\PCKGNAME\SRC_5.0.2E\pckgname>R CMD check --no- examples --no-tests src
* using log directory 'C:/Users/username/Documents/PCKGNAME/SRC_5.0.2E/pckgname/src.Rcheck'
* using R version 3.4.0 (2017-04-21)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using options '--no-examples --no-tests'
* checking for file 'src/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'pckgname' version '5.0.2.5'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... NOTE
Found the following apparent object files/libraries:
src-x64/FortPrg1.o src-x64/FortPrg2.o src-x64/FortPrg3.o
Object files/libraries should not be included in a source package.
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
R/.Rhistory
These were most likely included in error. See section 'Package
structure' in the 'Writing R Extensions' manual.
* checking for portable file names ... OK
* checking whether package 'pckgname' can be installed ... ERROR
Installation failed.
See 'C:/Users/username/Documents/PCKGNAME/SRC_5.0.2E/pckgname/src.Rcheck/00install.out' for details.
* DONE
Status: 1 ERROR, 2 NOTEs
In Prompt, there is this information in addition to what appeared before:
* checking whether package 'pckgname' can be installed ...
Warning: l'exécution de la commande '"C:/PROGRA~1/R/R-34~1.0/bin/x64/Rcmd.exe"
INSTALL -l "C:/Users/username/Documents/PCKGNAME/SRC_5.0.2E/pckgname/src.Rcheck" --no-html
"C:\Users\username\DOCUME~1\PCKGNAME\SRC_30~1.7E\pckgname\src"' renvoie un statut 1
Now in the file 00install.out:
* installing *source* package 'pckgname' ...
** libs
*** arch - i386
c:/Rtools/mingw_32/bin/gfortran -O3 -mtune=core2 -c FortPrg1.f90 -o FortPrg1.o
c:/Rtools/mingw_32/bin/gfortran -O3 -mtune=core2 -c FortPrg2.f90 -o FortPrg2.o
c:/Rtools/mingw_32/bin/gfortran -O3 -mtune=core2 -c FortPrg3.f90 -o FortPrg3.o
c:/Rtools/mingw_32/bin/gfortran -shared -s -static-libgcc -o pckgname.dll tmp.def FortPrg1.o FortPrg2.o FortPrg3.o -Ld:/Compiler/gcc-4.9.3/local330/lib/i386 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-34~1.0/bin/i386 -lR
installing to C:/Users/username/Documents/PCKGNAME/SRC_5.0.2E/pckgname/src.Rcheck/pckgname/libs/i386
*** arch - x64
c:/Rtools/mingw_64/bin/gfortran -O2 -mtune=core2 -c FortPrg1.f90 -o FortPrg1.o
c:/Rtools/mingw_64/bin/gfortran -O2 -mtune=core2 -c FortPrg2.f90 -o FortPrg2.o
c:/Rtools/mingw_64/bin/gfortran -O2 -mtune=core2 -c FortPrg3.f90 -o FortPrg3.o
c:/Rtools/mingw_64/bin/gfortran -shared -s -static-libgcc -o pckgname.dll tmp.def FortPrg1.o FortPrg2.o FortPrg3.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-34~1.0/bin/x64 -lR
installing to C:/Users/username/Documents/PCKGNAME/SRC_5.0.2E/pckgname/src.Rcheck/pckgname/libs/x64
** R
** demo
** preparing package for lazy loading
Warning: package 'survival' was built under R version 3.4.4
Warning: package 'boot' was built under R version 3.4.4
Warning: package 'xlsx' was built under R version 3.4.4
Warning: package 'ggplot2' was built under R version 3.4.4
Warning: package 'GGally' was built under R version 3.4.4
[1] "Chargement de gdata ..."
[1] "Chargement de survival ..."
[1] "Chargement de boot ..."
[1] "Chargement de tcltk ..."
[1] "Chargement de xlsx ..."
---------------------------------------------
Package PCKGNAME genere le ven. sept. 28 17:14:21 2018
---------------------------------------------
Librairie Pckgname V5.0.2E Chargee
** help
No man pages found in package 'pckgname'
Error in .get_package_metadata(dir, FALSE) :
Files 'DESCRIPTION' and 'DESCRIPTION.in' are missing.
ERROR: installing Rd objects failed for package 'pckgname'
* removing 'C:/Users/username/Documents/PCKGNAME/SRC_5.0.2E/pckgname/src.Rcheck/pckgname'
Usually you would store a package named samara in a directory of the same name. You appear to have it in src. That should work, but I wouldn't be surprised if something in the check code implicitly assumes you were following the usual convention.
The other thing that is usually done is that you create a source tarball of the package and check that. That is, you run R CMD check on the output of R CMD build, not on the input. Again, what you are doing should mostly work (though not perfectly in this case; tarball contents typically are not identical to source directories), but perhaps these two nonstandard ways of working are causing your problems.
With the help of user2554330, I solved the problem.
I did the following things:
-I reorganized into pckgname/R and pckgname/src
(instead of pckgname/src/R and pckgname/src/src previously )
-I used R Studio. First I created a new project (create a new package) with RStudio and devtools: File>Create new project>R Package using devtools. And I put my files there
-I built and checked exclusively with the Rstudio interface
I was trying to use a R package called "XML",
but had trouble to use it after installation:
# in R environment
> library("XML")
> XML::parseURI("")
Error in XML::parseURI("") : cannot parse URI
the issue turned out to be that R could not find the current version of "libxml2" installed in my directory:
echo $LD_LIBRARY_PATH /somewhere/Jun/Programme/libxml2-devel-2.9.1-2.1/usr/lib/:
retrieve information about the version of the libxml2 library "XML" linking to
> path = unclass(getLoadedDLLs()[["XML"]])$path
> path
[1] "/misc/home/Jun/Programme/R-3.3.1/lib64/R/library/XML/libs/XML.so"
> system2("ldd",args=path)
linux-vdso.so.1 => (0x00007fff2a9e8000)
libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00002aefc088a000) # XML is using a common "libxml2.so.2" not the one I installed.
libz.so.1 => //home/Jun/Programme/zlib-1.2.11/lib/libz.so.1 (0x00002aefc0bc8000)
libm.so.6 => /lib64/libm.so.6 (0x00002aefc0de5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002aefc1068000)
...
Any suggestion to do that?
in order to make "XML" link to the libxml2 installed in my directory,
I made such efforts:
setting PATH for libxml2:
echo $LD_LIBRARY_PATH
/somewhere/Jun/Programme/pcre-8.40/lib/:/somewhere/Jun/Programme/xz-5.2.3/lib/:/somewhere/Jun/Programme/zlib-1.2.11/include/:/somewhere/Jun/Programme/zlib-1.2.11/lib/:/somewhere/Jun/Programme/bzip2-1.0.6/lib/:/somewhere/Jun/Programme/bzip2-1.0.6/include/:/somewhere/Jun/Programme/gcc-6.1.0/lib/:/somewhere/Jun/Programme/gcc-6.1.0/lib64/:/somewhere/Jun/Programme/libxml2-devel-2.9.1-2.1/usr/lib/:/somewhere/Jun/Programme/curl-7.52.1/lib/:/somewhere/Jun/Programme/libtool_CentOS6_64/usr/lib64/:/home/appl/openmpi-1.3.1/lib:/opt22/lsf83_exp/8.3/linux2.6-glibc2.3-x86_64/lib:/opt/ups/lib
recompile R with configuration specifying lib using "--enable" argument
./configure --prefix=$HOME/Programme/R-3.3.1 --enable-R-shlib LDFLAGS="-L/$HOME/Programme/zlib-1.2.11/lib -L/$HOME/Programme/bzip2-1.0.6/lib -L/$HOME/Programme/xz-5.2.3/lib -L/$HOME/Programme/pcre-8.40/lib -L/$HOME/Programme/curl-7.52.1/lib " CPPFLAGS="-I/$HOME/Programme/zlib-1.2.11/include -I/$HOME/Programme/bzip2-1.0.6/include -I/$HOME/Programme/xz-5.2.3/include -I/$HOME/Programme/pcre-8.40/include -I/$HOME/Programme/curl-7.52.1/include"
install "XML" with configure arguments:
biocLite("XML",configure.args='--with-xml- config="/somewhere/Jun/Programme/libxml2-devel-2.9.1-2.1/usr/bin/xml2-config"')
BioC_mirror: http://bioconductor.org
Using Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.1 (2016-06-21).
Installing package(s) ‘XML’
trying URL 'http://cran.rstudio.com/src/contrib/XML_3.98-1.5.tar.gz'
Content type 'application/x-gzip' length 1599213 bytes (1.5 MB)
downloaded 1.5 MB
...
but none of them seemed to work:
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
User defined xml-config: /somewhere/Jun/Programme/libxml2-devel-2.9.1-2.1/usr/bin/xml2-config, XML Version: 2, XML2: yes
USE_XML2 = yes
SED_EXTENDED_ARG: -r
Minor 9, Patch 1 for 2.9.1
Located parser file -I/usr/include/libxml2/parser.h
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
checking for xmlHashSize in -lxml2... yes
Using built-in xmlHashSize
Checking DTD parsing (presence of externalSubset)...
checking for xmlHashSize in -lxml2... yes
Found xmlHashSize
checking for xmlOutputBufferCreateBuffer in -lxml2... yes
have xmlOutputBufferCreateBuffer()
checking for xmlDocDumpFormatMemoryEnc in -lxml2... yes
checking libxml/xmlversion.h usability... yes
checking libxml/xmlversion.h presence... yes
checking for libxml/xmlversion.h... yes
Expat: FALSE
Checking for return type of xmlHashScan element routine.
No return value for xmlHashScan
xmlNs has a context field
Checking for cetype_t enumeration
Using recent version of R with cetype_t enumeration type for encoding
checking for xmlsec1-config... /usr/bin/xmlsec1-config
nodegc default
xml-debug default
No XML_WITH_ZLIB enumeration value.
Version has xmlHasFeature()
****************************************
Configuration information:
Libxml settings
libxml include directory: -I/usr/include/libxml2
libxml library directory: -lxml2 -lz -lm -ldl -lz -lxml2
libxml 2: -DLIBXML2=1
I think I have found the solution. Instead of using rpm to install "libxml2"
(I apologize that I did not mention it in my post; I didn't realize that it could be the cause of my trouble), I ought to have compiled "libxml2" from source.
For people that have a similar issue:
Download the current version of libxml2 http://www.linuxfromscratch.org/blfs/view/svn/general/libxml2.html,
following the instructions of the link above.
Two points for installation:
1.
./configure --prefix=$HOME/Programme --disable-static --with-history --with-zlib=/somewhere/Jun/Programme/zlib-1.2.11 && make
you have to specify zlib (--with); this also means that you have to have zlib installed. I had to add "--with" to make configure work.
The instructions state that you have to call "make install" as root user, but no, you don't have to do this.
Set the PATH for your installed "libxml2".
Reinstall your R package "XML".
I was trying to install the R gsl wrapper in our university's HPC cluster, with R version 3.1.1 and OS x86_64-redhat-linux-gnu (64-bit). But something weird happened:
R CMD INSTALL '/d1/pyangac/gsl_1.9-10.1.tar.gz'
* installing to library /d1/pyangac/R_libs/ installing *source* package gsl...
** package gsl successfully unpacked and MD5 sums checked
checking for gsl-config... /usr/local/gsl-1.16/bin/gsl-config
checking if GSL version >= 1.12... checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: configuration failed for package gsl
* removing /d1/pyangac/R_libs/gsl
Here are some specifics I have made before I run the installation command. There are two gsl libraries already installed in the cluster, one is gsl, and the other is gsl-1.16 (version 1.16). As the R gsl wrapper requires external gsl library version >= 1.12, before installation, I have set the environments LDFLAGS="-L/usr/local/gsl-1.16/lib -lgsl -lgslcblas -lm"; export LDFLAGS and CPPFALGS="-I/usr/local/gsl-1.16/include"; export CPPFLAGS, so that R will install the wrapper based on version 1.16. I also added the following two paths to make sure R will find the gsl-config file export PATH=$PATH:/usr/local/gsl-1.16, and export PATH=$PATH:/usr/local/gsl-1.16/bin.
Then I run the previous installation command and the error suggests that the C compiler cannot work. After some searches I think it may be caused by the fact that the gsl library is not in the gcc include directory. After typing the following commands, I think the problem would be solved:
export CPATH=/usr/local/gsl-1.16/include
Unfortunately, when I reinstall the gsl wrapper, the same 'cannot run C compiled programs' error appears again. Sorry that I can't provide any further information, as I cannot find the config.log file.
Does anyone has any hint why this is happening, or how to find the config.log file?
Thanks.
checking whether the C compiler works... configure: error: cannot run
C compiled programs
# yum install gcc-c++
I.e. the install of gcc-c++ will also install the dependencies that make gcc work. ( The gcc missing parts are { glibc-devel, glibc-headers, linux-headers } → /usr/lib64/[files], /usr/include/[files].h )
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 directories and mirrors
WORKING_DIR <- "/srv/foo/bar/baz"
LIB_DIR <- paste( WORKING_DIR, "libs", sep="/" )
setwd(WORKING_DIR)
stringi.loc <- paste( WORKING_DIR, "stringi_0.4-1.tar.gz", sep="/" )
This might not be the most elegant way of installing R packages but it seems to work okay for us (any other tips on R package management would be welcome but a bit late at this stage :).
However, the stringi package seems to depend on the icu52l package, which it installs the over the network:
checking for R... /usr/lib64/R/bin/R
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 whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for cat... /bin/cat
checking for pkg-config... /usr/bin/pkg-config
checking with pkg-config for ICU4C installed... no
*** The pkg-config script did not detect ICU4C-devel libraries installed
*** We will build ICU4C from sources
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
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/icu52_found.txt
g++ -I/usr/share/R/include -DNDEBUG -I. -Iicu52 -Iicu52/unicode -Iicu52/common -Iicu52/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DNDEBUG -DU_HAVE_ELF_H -fpic -g -c stri_brkiter.cpp -o stri_brkiter.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -Iicu52 -Iicu52/unicode -Iicu52/common -Iicu52/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DNDEBUG -DU_HAVE_ELF_H -fpic -g -c icu52/i18n/utmscale.c -o icu52/i18n/utmscale.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -Iicu52 -Iicu52/unicode -Iicu52/common -Iicu52/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DNDEBUG -DU_HAVE_ELF_H -fpic -g -c icu52/stubdata/stubdata.c -o icu52/stubdata/stubdata.o
g++ -shared -o stringi.so stri_brkiter.o stri_collator.o stri_common.o stri_compare.o stri_container_base.o stri_container_bytesearch.o stri_container_listint.o stri_container_listraw.o stri_container_listutf8.o stri_container_regex.o stri_container_usearch.o stri_container_utf16.o stri_container_utf8.o stri_container_utf8_indexable.o stri_encoding_conversion.o stri_encoding_detection.o stri_encoding_management.o stri_escape.o stri_exception.o stri_ICU_settings.o stri_join.o stri_length.o stri_pad.o stri_prepare_arg.o stri_random.o stri_reverse.o stri_search_class_count.o stri_search_class_detect.o stri_search_class_extract.o stri_search_class_locate.o stri_search_class_replace.o stri_search_class_split.o stri_search_class_startsendswith.o stri_search_class_subset.o stri_search_class_trim.o stri_search_common.o stri_search_coll_count.o stri_search_coll_detect.o stri_search_coll_extract.o stri_search_coll_locate.o stri_search_coll_replace.o stri_search_coll_split.o stri_search_coll_startsendswith.o stri_search_coll_subset.o stri_search_boundaries_count.o stri_search_boundaries_locate.o stri_search_boundaries_split.o stri_search_fixed_count.o stri_search_fixed_detect.o stri_search_fixed_extract.o stri_search_fixed_locate.o stri_search_fixed_replace.o stri_search_fixed_split.o stri_search_fixed_subset.o stri_search_fixed_startsendswith.o stri_search_in.o stri_search_other_replace.o stri_search_other_split.o stri_search_regex_count.o stri_search_regex_detect.o stri_search_regex_extract.o stri_search_regex_locate.o stri_search_regex_match.o stri_search_regex_replace.o stri_search_regex_split.o stri_search_regex_subset.o stri_stats.o stri_stringi.o stri_sub.o stri_test.o stri_trans_casemap.o stri_trans_normalization.o stri_trans_transliterate.o stri_ucnv.o stri_uloc.o stri_utils.o stri_wrap.o icu52/common/appendable.o icu52/common/bmpset.o icu52/common/brkeng.o icu52/common/brkiter.o icu52/common/bytestream.o icu52/common/bytestrie.o icu52/common/bytestriebuilder.o icu52/common/bytestrieiterator.o icu52/common/caniter.o icu52/common/chariter.o icu52/common/charstr.o icu52/common/dictbe.o icu52/common/dictionarydata.o icu52/common/dtintrv.o icu52/common/errorcode.o icu52/common/filterednormalizer2.o icu52/common/listformatter.o icu52/common/locavailable.o icu52/common/locbased.o icu52/common/locdispnames.o icu52/common/locid.o icu52/common/loclikely.o icu52/common/locresdata.o icu52/common/locutil.o icu52/common/messagepattern.o icu52/common/normalizer2.o icu52/common/normalizer2impl.o icu52/common/normlzr.o icu52/common/parsepos.o icu52/common/patternprops.o icu52/common/propname.o icu52/common/punycode.o icu52/common/putil.o icu52/common/rbbi.o icu52/common/rbbidata.o icu52/common/rbbinode.o icu52/common/rbbirb.o icu52/common/rbbiscan.o icu52/common/rbbisetb.o icu52/common/rbbistbl.o icu52/common/rbbitblb.o icu52/common/resbund_cnv.o icu52/common/resbund.o icu52/common/ruleiter.o icu52/common/schriter.o icu52/common/serv.o icu52/common/servlk.o icu52/common/servlkf.o icu52/common/servls.o icu52/common/servnotf.o icu52/common/servrbf.o icu52/common/servslkf.o icu52/common/stringpiece.o icu52/common/stringtriebuilder.o icu52/common/ubrk.o icu52/common/ucase.o icu52/common/ucasemap_titlecase_brkiter.o icu52/common/ucasemap.o icu52/common/ucharstrie.o icu52/common/ucharstriebuilder.o icu52/common/ucharstrieiterator.o icu52/common/uchriter.o icu52/common/ucnv_bld.o icu52/common/ucnv_ext.o icu52/common/ucnv_io.o icu52/common/ucnv2022.o icu52/common/ucnvbocu.o icu52/common/ucnvsel.o icu52/common/ucol_swp.o icu52/common/udata.o icu52/common/uhash_us.o icu52/common/uidna.o icu52/common/uinit.o icu52/common/uiter.o icu52/common/uloc.o icu52/common/umutex.o icu52/common/unames.o icu52/common/unifilt.o icu52/common/unifunct.o icu52/common/uniset_closure.o icu52/common/uniset_props.o icu52/common/uniset.o icu52/common/unisetspan.o icu52/common/unistr_case_locale.o icu52/common/unistr_case.o icu52/common/unistr_cnv.o icu52/common/unistr_props.o icu52/common/unistr_titlecase_brkiter.o icu52/common/unistr.o icu52/common/unorm.o icu52/common/unormcmp.o icu52/common/uobject.o icu52/common/uprops.o icu52/common/uresbund.o icu52/common/uscript_props.o icu52/common/uset_props.o icu52/common/uset.o icu52/common/usetiter.o icu52/common/ushape.o icu52/common/usprep.o icu52/common/ustack.o icu52/common/ustr_titlecase_brkiter.o icu52/common/ustr_wcs.o icu52/common/ustrcase_locale.o icu52/common/ustrcase.o icu52/common/ustrenum.o icu52/common/ustring.o icu52/common/ustrtrns.o icu52/common/utext.o icu52/common/util_props.o icu52/common/util.o icu52/common/utrie.o icu52/common/utrie2_builder.o icu52/common/utrie2.o icu52/common/uts46.o icu52/common/uvector.o icu52/common/uvectr32.o icu52/common/uvectr64.o icu52/common/cmemory.o icu52/common/cstring.o icu52/common/cwchar.o icu52/common/icudataver.o icu52/common/icuplug.o icu52/common/locmap.o icu52/common/propsvec.o icu52/common/uarrsort.o icu52/common/ubidi_props.o icu52/common/ubidi.o icu52/common/ubidiln.o icu52/common/ubidiwrt.o icu52/common/ucat.o icu52/common/uchar.o icu52/common/ucln_cmn.o icu52/common/ucmndata.o icu52/common/ucnv_cb.o icu52/common/ucnv_cnv.o icu52/common/ucnv_ct.o icu52/common/ucnv_err.o icu52/common/ucnv_lmb.o icu52/common/ucnv_set.o icu52/common/ucnv_u16.o icu52/common/ucnv_u32.o icu52/common/ucnv_u7.o icu52/common/ucnv_u8.o icu52/common/ucnv.o icu52/common/ucnvdisp.o icu52/common/ucnvhz.o icu52/common/ucnvisci.o icu52/common/ucnvlat1.o icu52/common/ucnvmbcs.o icu52/common/ucnvscsu.o icu52/common/udatamem.o icu52/common/udataswp.o icu52/common/uenum.o icu52/common/uhash.o icu52/common/uinvchar.o icu52/common/ulist.o icu52/common/uloc_tag.o icu52/common/umapfile.o icu52/common/umath.o icu52/common/unorm_it.o icu52/common/ures_cnv.o icu52/common/uresdata.o icu52/common/usc_impl.o icu52/common/uscript.o icu52/common/ustr_cnv.o icu52/common/ustrfmt.o icu52/common/utf_impl.o icu52/common/utrace.o icu52/common/utypes.o icu52/common/wintz.o icu52/i18n/alphaindex.o icu52/i18n/anytrans.o icu52/i18n/astro.o icu52/i18n/basictz.o icu52/i18n/bocsu.o icu52/i18n/brktrans.o icu52/i18n/buddhcal.o icu52/i18n/calendar.o icu52/i18n/casetrn.o icu52/i18n/cecal.o icu52/i18n/chnsecal.o icu52/i18n/choicfmt.o icu52/i18n/coleitr.o icu52/i18n/coll.o icu52/i18n/compactdecimalformat.o icu52/i18n/coptccal.o icu52/i18n/cpdtrans.o icu52/i18n/csdetect.o icu52/i18n/csmatch.o icu52/i18n/csr2022.o icu52/i18n/csrecog.o icu52/i18n/csrmbcs.o icu52/i18n/csrsbcs.o icu52/i18n/csrucode.o icu52/i18n/csrutf8.o icu52/i18n/curramt.o icu52/i18n/currfmt.o icu52/i18n/currpinf.o icu52/i18n/currunit.o icu52/i18n/dangical.o icu52/i18n/datefmt.o icu52/i18n/dcfmtsym.o icu52/i18n/decfmtst.o icu52/i18n/decimfmt.o icu52/i18n/digitlst.o icu52/i18n/dtfmtsym.o icu52/i18n/dtitvfmt.o icu52/i18n/dtitvinf.o icu52/i18n/dtptngen.o icu52/i18n/dtrule.o icu52/i18n/esctrn.o icu52/i18n/ethpccal.o icu52/i18n/fmtable_cnv.o icu52/i18n/fmtable.o icu52/i18n/format.o icu52/i18n/fphdlimp.o icu52/i18n/fpositer.o icu52/i18n/funcrepl.o icu52/i18n/gender.o icu52/i18n/gregocal.o icu52/i18n/gregoimp.o icu52/i18n/hebrwcal.o icu52/i18n/identifier_info.o icu52/i18n/indiancal.o icu52/i18n/inputext.o icu52/i18n/islamcal.o icu52/i18n/japancal.o icu52/i18n/locdspnm.o icu52/i18n/measfmt.o icu52/i18n/measure.o icu52/i18n/msgfmt.o icu52/i18n/name2uni.o icu52/i18n/nfrs.o icu52/i18n/nfrule.o icu52/i18n/nfsubs.o icu52/i18n/nortrans.o icu52/i18n/nultrans.o icu52/i18n/numfmt.o icu52/i18n/numsys.o icu52/i18n/olsontz.o icu52/i18n/persncal.o icu52/i18n/plurfmt.o icu52/i18n/plurrule.o icu52/i18n/quant.o icu52/i18n/rbnf.o icu52/i18n/rbt_data.o icu52/i18n/rbt_pars.o icu52/i18n/rbt_rule.o icu52/i18n/rbt_set.o icu52/i18n/rbt.o icu52/i18n/rbtz.o icu52/i18n/regexcmp.o icu52/i18n/regeximp.o icu52/i18n/regexst.o icu52/i18n/regextxt.o icu52/i18n/region.o icu52/i18n/reldtfmt.o icu52/i18n/rematch.o icu52/i18n/remtrans.o icu52/i18n/repattrn.o icu52/i18n/scriptset.o icu52/i18n/search.o icu52/i18n/selfmt.o icu52/i18n/simpletz.o icu52/i18n/smpdtfmt.o icu52/i18n/smpdtfst.o icu52/i18n/sortkey.o icu52/i18n/strmatch.o icu52/i18n/strrepl.o icu52/i18n/stsearch.o icu52/i18n/taiwncal.o icu52/i18n/tblcoll.o icu52/i18n/timezone.o icu52/i18n/titletrn.o icu52/i18n/tmunit.o icu52/i18n/tmutamt.o icu52/i18n/tmutfmt.o icu52/i18n/tolowtrn.o icu52/i18n/toupptrn.o icu52/i18n/translit.o icu52/i18n/transreg.o icu52/i18n/tridpars.o icu52/i18n/tzfmt.o icu52/i18n/tzgnames.o icu52/i18n/tznames_impl.o icu52/i18n/tznames.o icu52/i18n/tzrule.o icu52/i18n/tztrans.o icu52/i18n/ucal.o icu52/i18n/ucol_bld.o icu52/i18n/ucol_cnt.o icu52/i18n/ucol_elm.o icu52/i18n/ucol_res.o icu52/i18n/ucol_sit.o icu52/i18n/ucol_tok.o icu52/i18n/ucol_wgt.o icu52/i18n/ucol.o icu52/i18n/ucoleitr.o icu52/i18n/ucsdet.o icu52/i18n/ucurr.o icu52/i18n/udat.o icu52/i18n/udateintervalformat.o icu52/i18n/udatpg.o icu52/i18n/umsg.o icu52/i18n/unesctrn.o icu52/i18n/uni2name.o icu52/i18n/unum.o icu52/i18n/unumsys.o icu52/i18n/upluralrules.o icu52/i18n/uregex.o icu52/i18n/uregexc.o icu52/i18n/uregion.o icu52/i18n/usearch.o icu52/i18n/uspoof_build.o icu52/i18n/uspoof_conf.o icu52/i18n/uspoof_impl.o icu52/i18n/uspoof_wsconf.o icu52/i18n/uspoof.o icu52/i18n/utrans.o icu52/i18n/vtzone.o icu52/i18n/vzone.o icu52/i18n/windtfmt.o icu52/i18n/winnmfmt.o icu52/i18n/wintzimpl.o icu52/i18n/zonemeta.o icu52/i18n/zrule.o icu52/i18n/ztrans.o icu52/i18n/decContext.o icu52/i18n/decNumber.o icu52/i18n/ucln_in.o icu52/i18n/ulocdata.o icu52/i18n/utmscale.o icu52/stubdata/stubdata.o -L/usr/lib64/R/lib -lR'
DBG: Stderr is '* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** libs
icu52/i18n/ucol_sit.cpp: In function ‘int32_t ucol_getUnsafeSet_52(const UCollator*, USet*, UErrorCode*)’:
icu52/i18n/ucol_sit.cpp:933: warning: ‘int32_t ucol_getContractions_52(const UCollator*, USet*, UErrorCode*)’ is deprecated (declared at icu52/i18n/ucol_sit.cpp:849)
icu52/i18n/ucol_sit.cpp:933: warning: ‘int32_t ucol_getContractions_52(const UCollator*, USet*, UErrorCode*)’ is deprecated (declared at icu52/i18n/ucol_sit.cpp:849)
installing via 'install.libs.R' to /srv/adzuna/value-my-cv/career_explorer/libs/stringi
downloading ICU data library (icudt)
the files will be extracted to: /srv/adzuna/value-my-cv/career_explorer/libs/stringi/libs
no icudt in a local repo
trying URL 'http://static.rexamine.com/packages/icudt52l.zip'
Content type 'application/zip' length 10154575 bytes (9.7 Mb)
opened URL
==================================================
downloaded 9.7 Mb
icudt fetch OK
decompressing downloaded archive
icudt has been installed successfully
restart R to apply changes
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*
How can we tell it to look for the local copy? The output handily includes the remote location (http://static.rexamine.com/packages/icudt52l.zip) so we can just put it somewhere ourselves but are unsure where.
Maybe we're going about this completely the wrong way but any help or pointers would be welcome.
We're on ubuntu machines and have also tried install libicu42 and libicu-dev but neither of those seemed to help.
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>")
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.
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.
Clone the git clone https://github.com/gagolews/stringi.git.
Edit the .Rbuildignore file and get rid of the ^src/icu55/data line.
Run R CMD build stringi_dir_name to build tar.gz file.
Install the obtained .tar.gz file on your machine(s), e.g.,
via install.packages("stringi_xxx.tar.gz")
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
The suggestion from #gagolews almost worked for me. Here's what actually did the trick with RStudio.
Download the master.zip file that will save as stringi-master.zip.
Unzip the file onto your desktop. The unzipped folder should be stringi-master.
Edit the .Rbuildignore file by removing ^src/icu55/data and ^src/icu61/data or similar lines.
Move the folder from your desktop to the home directory of your server.
Create a New Project in RStudio with ~/stringi-master as the Existing Directory
From RStudio's menu, select Build and Build Source Package. (You may need to first select Configure Build Tools. For Project build tools choose Package then select OK.)
It should create a tar.gz file, in the following format: stringi_x.x.(x+1).tar.gz. For example, if the current version of stringi is 1.5.3, it will create version 1.5.4. (I received a few warnings that didn't seem to affect the outcome.)
Move the newly created package to your local repository. Update the repository index. And install the package.