R - 3.5.0 - 无法安装包" tm"在Linux上

时间:2018-06-12 21:42:26

标签: r gcc tm

我正在尝试安装包" tm"在Linux机器上的R 3.5.0中。由于某些G ++编译器错误,安装失败。日志如下所述。

 > install.packages("tm")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rediris.es/src/contrib/tm_0.7-3.tar.gz'
Content type 'application/x-gzip' length 511317 bytes (499 KB)
==================================================
downloaded 499 KB

* installing *source* package ‘tm’ ...
** package ‘tm’ successfully unpacked and MD5 sums checked
** libs
g++ -m64 -std=gnu++0x -I"/usr/include/R" -DNDEBUG  - 
I"/usr/lib64/R/library/BH/include" -I"/usr/lib64/R/library/Rcpp/include" - 
I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 - 
fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic - 
c RcppExports.cpp -o RcppExports.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG  - 
I"/usr/lib64/R/library/BH/include" -I"/usr/lib64/R/library/Rcpp/include" - 
I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 - 
fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic - 
fpic -fPIC   -c copy.c -o copy.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG  - 
I"/usr/lib64/R/library/BH/include" -I"/usr/lib64/R/library/Rcpp/include" - 
I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 - 
fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic - 
fpic -fPIC   -c init.c -o init.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG  - 
I"/usr/lib64/R/library/BH/include" -I"/usr/lib64/R/library/Rcpp/include" - 
I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 - 
fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic - 
fpic -fPIC   -c remove.c -o remove.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG  - 
I"/usr/lib64/R/library/BH/include" -I"/usr/lib64/R/library/Rcpp/include" - 
I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 - 
fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic - 
fpic -fPIC   -c scan.c -o scan.o
g++ -m64 -std=gnu++0x -I"/usr/include/R" -DNDEBUG  - 
I"/usr/lib64/R/library/BH/include" -I"/usr/lib64/R/library/Rcpp/include" - 
I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 - 
fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic - 
c tdm.cpp -o tdm.o
tdm.cpp: In function ‘Rcpp::List tdm(Rcpp::StringVector, bool, 
std::vector<std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, std::allocator<std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > > >, 
std::vector<std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, std::allocator<std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > > >, unsigned int, unsigned 
int, unsigned int, unsigned int)’:
tdm.cpp:63: error: expected initializer before ‘:’ token
tdm.cpp:67: error: expected primary-expression before ‘return’
tdm.cpp:67: error: expected ‘;’ before ‘return’
tdm.cpp:67: error: expected primary-expression before ‘return’
tdm.cpp:67: error: expected ‘)’ before ‘return’
make: *** [tdm.o] Error 1
ERROR: compilation failed for package ‘tm’
* removing ‘/usr/lib64/R/library/tm’

The downloaded source packages are in
    ‘/tmp/RtmpCMwqqC/downloaded_packages’
 Updating HTML index of packages in '.Library'
 Making 'packages.html' ... done
 Warning message:
 In install.packages("tm") :
 installation of package ‘tm’ had non-zero exit status

我还尝试从cran网站下载并安装tm tar文件。该安装也给了我相同的错误消息。

0 个答案:

没有答案