我想在Ubuntu中使用R包RNetCDF和ncdf。
当我尝试install.packages('RNetCDF')
或install.packages('ncdf')
时,出现类似错误:
...
ncdf.c:3:20: fatal error: netcdf.h: No such file or directory
compilation terminated.
make: *** [ncdf.o] Error 1
ERROR: compilation failed for package ‘ncdf’
...
Warning message:
In install.packages("ncdf") :
installation of package ‘ncdf’ had non-zero exit status
已安装Ubuntu存储库中的软件包
libnetcdf6
和netcdf-bin
。我还需要做其他事情吗? 最佳答案
您需要安装这些软件包的-dev
以获取编译该软件包所需的标头。在这种情况下,您需要libnetcdf-dev
,udunits-bin
和libudunits2-dev