在Linux中安装R软件包 [英] R package installation in Linux
问题描述
我正在尝试使用以下命令在Ubuntu中安装R软件包:
I am trying to install a R package in Ubuntu using the following commands:
R CMD INSTALL rpart_4.1-5.tar.gz
install.packages("/home/rpart_4.1-5.tar.gz", repos = NULL, type="source")
* installing to library '/R/library'
* installing *source* package 'rpart' ...
** package 'rpart' successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package 'rpart'
* removing '/R/library/rpart'
我已经安装了GCC 4.8.2,并且命令gcc -v
提供以下输出:
I have GCC 4.8.2 installed and the command gcc -v
provides the following output:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/tools/stow/gcc-4_8_2-2.x86-64.linux.centos.5/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8.2/configure --prefix=/mnt/gcc/buildir/gcc-4.8.2
Thread model: posix
gcc version 4.8.2 (GCC)
上次我遇到相同的问题,安装GCC(相同版本)解决了该问题(在Stackoverflow上对此主题发布了类似的查询).但是,这一次它不起作用.有人可以让我知道造成此问题的原因.
Last time I face the same issue, installing GCC (same version) solved it (posted a similar query on Stackoverflow on this topic). However, this time it is not working. Could someone please let me know what is causing this issue.
更新:我们正在尝试手动安装依赖项,以查看其是否有效.我们已经安装了Make和GCC 4.8.2:
UPDATE: We are trying to manually install the dependencies to see if it works. We have installed Make and GCC 4.8.2:
但是,我仍然遇到以下错误:
However, I still get the following error:
* installing to library '/opt/vertica/R/library'
* installing *source* package 'rpart' ...
** package 'rpart' successfully unpacked and MD5 sums checked
** libs
cc -std=gnu99 -I/opt/vertica/R/include -DNDEBUG -I/usr/local/include -fpic -c anova.c -o anova.o
make: cc: Command not found
make: *** [anova.o] Error 127
ERROR: compilation failed for package 'rpart'
* removing '/opt/vertica/R/library/rpart'
除了Make和GCC之外,还有其他需要安装的依赖项吗?
Are there any other dependencies that we need to install apart from Make and GCC?
推荐答案
您的系统没有用于编译的make实用程序.
Your system doesn't have make utility for compilation.
请执行以下命令以在您的系统中安装make.
Please execute following command to install make in your system.
sudo apt-get install build-essential
这篇关于在Linux中安装R软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!