安装包 ncdf 由于缺少标头而失败,尽管它在那里 [英] Installation of package ncdf fails due to missing header although it's there

查看:27
本文介绍了安装包 ncdf 由于缺少标头而失败,尽管它在那里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Ubuntu 10.04 服务器上安装 r 包 ncdf:

I'm trying to install the r package ncdf on an Ubuntu 10.04 server:

install.packages("ncdf", type = "source")
Installing package into ‘/home/me/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/ncdf_1.6.6.tar.gz'
Content type 'application/x-gzip' length 79403 bytes (77 Kb)
opened URL
==================================================
downloaded 77 Kb

* installing *source* package ‘ncdf’ ...
** package ‘ncdf’ successfully unpacked and MD5 sums checked
checking for nc-config... no
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking netcdf.h usability... no
checking netcdf.h presence... no
checking for netcdf.h... no
configure: error: netcdf header netcdf.h not found
ERROR: configuration failed for package ‘ncdf’
* removing ‘/home/me/R/x86_64-pc-linux-gnu-library/3.0/ncdf’
Warning in install.packages :
  installation of package ‘ncdf’ had non-zero exit status

我也下载了源码包,尝试在shell中安装,结果一样.

I also downloaded the source package and tried to install in the shell, but got the same result.

wget http://cran.r-project.org/src/contrib/ncdf_1.6.6.tar.gz
R CMD INSTALL ncdf_1.6.6.tar.gz 

显然,安装程序没有找到正确的头文件.于是我手动搜索了一下文件,找到了:

Obviously, the installer doesn't find the correct header file. So I searched the file manually and found it:

root@fourier:/usr/include# ls -ahl netcdf.h
-rw-r--r-- 1 root root 30K 2009-12-22 04:47 netcdf.h 

netcdf-binnetcdf-dbgnetcdf-doclibnetcdf-dev>libnetcdf4 都已正确安装.apt-get 是最新的.这是我的会话信息:

Packages netcdf-bin, netcdf-dbg, netcdf-doc, libnetcdf-dev and libnetcdf4 are all properly installed. apt-get is up to date. This is my session info:

R version 3.0.1 (2013-05-16)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.0.1

如何说服 R 安装程序使用位于 /usr/include 下的头文件?

How can I persuade the R installer to use the header file located under /usr/include?

推荐答案

您需要查看 configure.in 脚本以准确了解它的测试内容.也许它期望 netcdf.h 位于子目录中,而不是直接位于 /usr/include 中.

You need to look at the configure.in script to see exactly what it tests for. Maybe it is expecting netcdf.h in a subdirectory rather than directly in /usr/include.

我想我过去已经建立了这个.我可以稍后再看看.

I think I have built this in the past. I could take another look later.

这篇关于安装包 ncdf 由于缺少标头而失败,尽管它在那里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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