我想在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存储库中的软件包libnetcdf6netcdf-bin。我还需要做其他事情吗?

最佳答案

您需要安装这些软件包的-dev以获取编译该软件包所需的标头。在这种情况下,您需要libnetcdf-devudunits-binlibudunits2-dev

08-20 01:27