我正试图在R中安装名为拓扑模型的软件包,但我没有成功。这是我尝试过的..。
操作:使用install.packages("topicmodels")安装包
结果:
package ‘topicmodels’ is available as a source package but not as a binary
Warning in install.packages :
package ‘topicmodels’ is not available (for R version 3.1.0)所以我说好的,让我们从源头安装
行动:install.packages("/Users/my_name/Downloads/topicmodels_0.2-1.tar.gz",repos=NULL,type="source")
结果:
* installing *source* package ‘topicmodels’ ...
** package ‘topicmodels’ successfully unpacked and MD5 sums checked
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c cokus.c -o cokus.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c common.c -o common.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c ctm.c -o ctm.o
ctm.c:29:10: fatal error: 'gsl/gsl_rng.h' file not found
include gsl/gsl_rng.h
1 error generated.
make: *** [ctm.o] Error 1
ERROR: compilation failed for package ‘topicmodels’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/topicmodels’
Warning in install.packages :
installation of package ‘/Users/me/Downloads/topicmodels_0.2-1.tar.gz’ had non-zero exit status于是我研究了gsl这件事,发现了此链接。现在,我认为我所有的问题都解决了,当我最终遵循这些指示的时候。我得到以下错误(在终端).
Warning in untar2(tarfile, files, list, exdir, restore_times) :
using pax extended headers
ERROR: cannot extract package from ‘topicmodels.tar.gz’发布于 2014-06-16 13:49:24
首先,您必须安装gsl。一旦您安装了,您可以尝试安装R包。您可以从这里下载gsl (在那里您可以选择最新版本的gsl-latest.tar.gz)。下载之后,执行以下操作来安装它:
gsl-1.16)fatal error: 'gsl/gsl_rng.h' file not found错误,所以您可以重试安装。我也有同样的问题,在这样做后,我得到了正确的R包安装,我希望它也能在你的情况下工作。
发布于 2015-09-13 14:40:24
如果你已经用了自制的。与从源手动安装gsl相比,使用变量修复更好、更快。
brew install gsl安装gsl~/.R/Makevars并添加。
PKG_LIBS=-L/usr/local/opt/gettext/lib
CFLAGS=-I/usr/local/opt/gsl/include
LDFLAGS=-L/usr/local/opt/gsl/lib -lgsl -lgslcblashttps://stackoverflow.com/questions/24172188
复制相似问题