安装 R 包.包含目录为空.开发标题 [英] Installing R packages. Include directory is empty. Development headers

查看:28
本文介绍了安装 R 包.包含目录为空.开发标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试运行一些最初在 2.11.0 下运行的 R 代码.我使用的 R 版本 2.14.1 不运行代码.我不熟悉 R 以及它是如何向后兼容的.(据我所知,我的问题可能与版本无关;我很高兴得知这是我做错的事情.)其余的代码无关紧要;即使我自己运行,我的安装也失败了.

I am currently trying to run some R code that originally ran under 2.11.0 . The version of R that I am using 2.14.1 does not run the code. I am unfamiliar with R and how backwards compatible it is. (My issue could have nothing to do versions for all I know; I will be happy to learn that it is something that I am doing wrong.) The rest of the code is irrelevant; my installs are failing even when I run by themselves.

#these fail
install.packages("gtools",repos="http://cran.r-project.org")
install.packages("minet", repos="http://cran.r-project.org")
#these work
install.packages("psych", repos="http://cran.r-project.org")
install.packages("qvalue",repos="http://cran.r-project.org")
install.packages("R2HTML",repos="http://cran.r-project.org")

除了上面列出的安装方法之外,我还尝试了其他安装方法.我尝试安装和编译早期版本的 gtools 和 minet.我曾尝试从其他存储库(biocLite)获取当前版本的包.但是,所有安装尝试都会产生相同的失败.对于更多背景知识,我不是我试图运行此代码的机器上的超级用户.我可以向作为超级用户的人请求一些小帮助(不影响机器其他用户的那些).我已经能够很好地安装其他软件包;尽管正如我早先所说,如果我有一个简单的问题,我会很高兴.这里有一些失败.

I have tried other installation methods in addition to the one I listed above. I have tried installing and compiling earlier versions of gtools and minet. I have tried getting current versions of the package from other repos (biocLite). However all installation attempts produce identical failures. For a little more background, I am not a superuser on the machine that I am trying to run this code on. I can ask the person who is the superuser for small favors (ones that do not affect other users of the machine). I have been able to install other packages just fine; though as I said early if I have a simple problem I will be pleased. Here are some failures.

* installing *source* package ‘gtools’ ...
** libs
Warning: R include directory is empty -- perhaps need to install R-devel.rpm or similar
gcc -m64 -std=gnu99 -I/usr/include/R  -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 setTCPNoDelay.c -o setTCPNoDelay.o
setTCPNoDelay.c:1:15: error: R.h: No such file or directory
setTCPNoDelay.c:2:24: error: Rinternals.h: No such file or directory
setTCPNoDelay.c: In function ‘checkStatus’:
setTCPNoDelay.c:66: warning: implicit declaration of function ‘strncpy’
setTCPNoDelay.c:66: warning: incompatible implicit declaration of built-in function ‘strncpy’
setTCPNoDelay.c:72: warning: implicit declaration of function ‘strerror’
setTCPNoDelay.c:72: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast
make: *** [setTCPNoDelay.o] Error 1
ERROR: compilation failed for package ‘gtools’

推荐答案

出现这个错误是因为我登录的特定机器没有开发标题.我的系统管理员指示我登录到另一台这样做的机器.比较奇怪的是,R 允许我安装一些没有头文件的包.如果您在尝试安装 R 包时间歇性地收到此投诉,这可能与 Joshua Ulrich 在评论中提到的开发标头有关.

This error arose because the particular machine that i was logged into did not have the development headers. My system admin directed me to login into a different machine that did. What was rather odd about this is that R would allow me to install some packages without the headers. If you intermittently get this complaint when attempting to install R packages, it may have to do with the development headers as Joshua Ulrich mention in the comments.

这篇关于安装 R 包.包含目录为空.开发标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆