繁体   English   中英

无法在3.3.3中安装“ tm” R软件包

[英]Unable to install 'tm' R package in 3.3.3

嗨,我正在尝试在Red Hat 6的R 3.3.3中安装tm软件包,但是由于Rpoppler依赖性和Rpoppler而失败,并显示以下错误。 我已经引用了各种链接,但是都没有解决该问题。

Warning messages:
1: In install.packages("tm", dependencies = TRUE, repos = "http://cran.us.r-project.org/") :
  installation of package ‘Rpoppler’ had non-zero exit status
2: In install.packages("tm", dependencies = TRUE, repos = "http://cran.us.r-project.org/") :
  installation of package ‘tm’ had non-zero exit status
> install.packages("Rpoppler", dependencies = TRUE, repos = "http://cran.us.r-project.org/")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/Rpoppler_0.1-0.tar.gz'
Content type 'application/x-gzip' length 38275 bytes (37 KB)
==================================================
downloaded 37 KB

* installing *source* package ‘Rpoppler’ ...
** package ‘Rpoppler’ successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about poppler-glib >= 0.18.0... no
configure: error: cannot determine poppler-glib compile/link flags
ERROR: configuration failed for package ‘Rpoppler’
* removing ‘/usr/lib64/R/library/Rpoppler’

The downloaded source packages are in
        ‘/tmp/RtmpEljcC7/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Rpoppler", dependencies = TRUE, repos = "http://cran.us.r-project.org/") :
  installation of package ‘Rpoppler’ had non-zero exit status

我已经在/ usr / lib64 / pkgconfig中修改了poppler的版本,可以绕过该错误,但是由于新错误而卡住了。 不知道在pkgconfig中更改元数据是否是一个好主意。

install.packages("Rpoppler",  repos = "http://cran.us.r-project.org/")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/Rpoppler_0.1-0.tar.gz'
Content type 'application/x-gzip' length 38275 bytes (37 KB)
==================================================
downloaded 37 KB

* installing *source* package ‘Rpoppler’ ...
** package ‘Rpoppler’ successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about poppler-glib >= 0.18.0... yes
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++ -m64 accepts -g... yes
checking whether we can use setErrorFunction... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include   -pthread -I/usr/include/poppler/glib -I/usr/include/poppler -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC   -c Rpoppler.c -o Rpoppler.o
Rpoppler.c: In function ‘Rpoppler_PDF_info’:
Rpoppler.c:108: warning: implicit declaration of function ‘poppler_document_get_title’
Rpoppler.c:108: warning: assignment makes pointer from integer without a cast
Rpoppler.c:113: warning: implicit declaration of function ‘poppler_document_get_subject’
Rpoppler.c:113: warning: assignment makes pointer from integer without a cast
Rpoppler.c:118: warning: implicit declaration of function ‘poppler_document_get_keywords’
Rpoppler.c:118: warning: assignment makes pointer from integer without a cast
Rpoppler.c:123: warning: implicit declaration of function ‘poppler_document_get_author’
Rpoppler.c:123: warning: assignment makes pointer from integer without a cast
Rpoppler.c:128: warning: implicit declaration of function ‘poppler_document_get_creator’
Rpoppler.c:128: warning: assignment makes pointer from integer without a cast
Rpoppler.c:133: warning: implicit declaration of function ‘poppler_document_get_producer’
Rpoppler.c:133: warning: assignment makes pointer from integer without a cast
Rpoppler.c:140: warning: implicit declaration of function ‘poppler_document_get_creation_date’
Rpoppler.c:145: warning: implicit declaration of function ‘poppler_document_get_modification_date’
Rpoppler.c:175: warning: implicit declaration of function ‘poppler_document_is_linearized’
Rpoppler.c:179: warning: implicit declaration of function ‘poppler_document_get_pdf_version_string’
Rpoppler.c:179: warning: assignment makes pointer from integer without a cast
Rpoppler.c:184: warning: implicit declaration of function ‘poppler_document_get_metadata’
Rpoppler.c:184: warning: assignment makes pointer from integer without a cast
Rpoppler.c:91: warning: unused variable ‘err’
Rpoppler.c: In function ‘Rpoppler_PDF_fonts’:
Rpoppler.c:207: warning: unused variable ‘i’
Rpoppler.c: In function ‘Rpoppler_PDF_text’:
Rpoppler.c:285: error: too few arguments to function ‘poppler_page_get_text’
make: *** [Rpoppler.o] Error 1
**ERROR: compilation failed for package ‘Rpoppler’
* removing ‘/usr/lib64/R/library/Rpoppler’**

The downloaded source packages are in
        ‘/tmp/Rtmp6HYusM/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Rpoppler", repos = "http://cran.us.r-project.org/") :
  installation of package ‘Rpoppler’ had non-zero exit status

经过进一步调试,我发现Rpoppler_0.1-0.tar.gz中的配置文件经过硬编码以检查0.18.0版本。 我确实将值更改为0.12.4,但结果也相同

错误消息告诉您poppler-glib丢失。 您应该能够通过以下方式从存储库中安装它:

sudo yum install poppler-glib-devel

编辑:但是,似乎RHEL 6仅包括poppler-glib-develop版本0.12.4,而Rpoppler至少需要版本0.18.0。 快速搜索未发现任何反向移植。 您可以编译自己的反向端口或升级操作系统。 RHEL 7应该足够了。

经过所有研究,tm 0.7.3存在一些编译问题。 安装0.7.1可以达到目的。 其中也安装了Rpoppler。

对于在OSX上发现此问题的任何人,这是我发现的工作流程。 根据https://github.com/cran/Rpoppler/blob/819bc04dd113f3ec12d8f7d8eecfab79569478d6/configure#L1830 ,我们可以看到

安装Poppler

brew install poppler

获取配置

尝试运行此。
pkg-config --libs poppler-glib pkg-config --cflags poppler-glib如果您得到类似Package 'poppler-glib' requires 'glib-2.0 >= 2.41' but version of glib-2.0 is 2.36.0 ,则您可能需要更改PKG_CONFIG_PATH的顺序: echo $PKG_CONFIG_PATH

安装新的glib

brew install glib

获取更新后的安装位置的信息: brew info glib

找到glib的位置:(例如) /usr/local/Cellar/glib/2.58.1 (435 files, 18.4MB) ,确保数量足够大(例如2.58)。 然后添加lib/pkgconfig 我们可以使它自动化:

glib_path=`brew info glib | grep Cellar | awk '{print $1 }' | tail -n 1` glib_path="${glib_path}/lib/pkgconfig" PKG_CONFIG_PATH="${glib_path}":"${PKG_CONFIG_PATH}" pkg-config --libs poppler-glib glib_path=`brew info glib | grep Cellar | awk '{print $1 }' | tail -n 1` glib_path="${glib_path}/lib/pkgconfig" PKG_CONFIG_PATH="${glib_path}":"${PKG_CONFIG_PATH}" pkg-config --libs poppler-glib如果可以,请在R尝试: install.packages("Rpoppler")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM