noahsark1117
在Linux平台下通过rstudio server安装text2vec包报错如下:
> install.packages("text2vec")
Installing package into ‘/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
试开URL’https://cran.rstudio.com/src/contrib/text2vec_0.4.0.tar.gz'
Content type 'application/x-gzip' length 3433916 bytes (3.3 MB)
==================================================
downloaded 3.3 MB
* installing *source* package ‘text2vec’ ...
** 成功将‘text2vec’程序包解包并MD5和检查
** libs
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3/Rcpp/include" -I"/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3/RcppParallel/include" -I"/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3/digest/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c GloveFitter.cpp -o GloveFitter.o
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3/Rcpp/include" -I"/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3/RcppParallel/include" -I"/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3/digest/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c HashCorpus.cpp -o HashCorpus.o
In file included from Corpus.h:17,
from HashCorpus.h:17,
from HashCorpus.cpp:17:
SparseTripletMatrix.h: In member function ‘SEXPREC* SparseTripletMatrix<T>::get_sparse_triplet_matrix(Rcpp::CharacterVector&, Rcpp::CharacterVector&)’:
SparseTripletMatrix.h:102: 错误:expected initializer before ‘:’ token
SparseTripletMatrix.h:111: 错误:expected ‘)’ before ‘;’ token
In file included from HashCorpus.cpp:17:
HashCorpus.h: In member function ‘void HashCorpus::insert_terms(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> > > >&, int)’:
HashCorpus.h:120: 错误:expected initializer before ‘:’ token
HashCorpus.cpp:33: 错误:expected primary-expression at end of input
HashCorpus.cpp:33: 错误:expected ‘;’ at end of input
HashCorpus.cpp:33: 错误:expected primary-expression at end of input
HashCorpus.cpp:33: 错误:expected ‘)’ at end of input
HashCorpus.cpp:33: 错误:expected statement at end of input
HashCorpus.h:114: 警告:未使用的变量‘term_index’
HashCorpus.h:114: 警告:未使用的变量‘context_term_index’
HashCorpus.h:116: 警告:未使用的变量‘K��
HashCorpus.h:117: 警告:未使用的变量‘i’
HashCorpus.h:118: 警告:未使用的变量‘increment’
HashCorpus.cpp:33: 错误:expected ‘}’ at end of input
In file included from Corpus.h:17,
from HashCorpus.h:17,
from HashCorpus.cpp:17:
SparseTripletMatrix.h: In member function ‘SEXPREC* SparseTripletMatrix<T>::get_sparse_triplet_matrix(Rcpp::CharacterVector&, Rcpp::CharacterVector&) [with T = float]’:
HashCorpus.h:76: instantiated from here
SparseTripletMatrix.h:101: 警告:未使用的变量‘n’
SparseTripletMatrix.h: In member function ‘SEXPREC* SparseTripletMatrix<T>::get_sparse_triplet_matrix(Rcpp::CharacterVector&, Rcpp::CharacterVector&) [with T = int]’:
HashCorpus.h:81: instantiated from here
SparseTripletMatrix.h:101: 警告:未使用的变量‘n’
make: *** [HashCorpus.o] 错误 1
ERROR: compilation failed for package ‘text2vec’
* removing ‘/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.3/text2vec’
Warning in install.packages :
installation of package ‘text2vec’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp4ugotI/downloaded_packages’
请问有朋友遇到类似的问题么?望指点。