I have tried to install ncdf4
package. I have R version 3.1.1.
The problem seems to be finding the nc-config
. If I Google for this specific problem, then I find people with the same problem, who solved it by installing the Debian package libnetcdf-dev
before installing ncdf4
.
I already installed that package but I keep having the same problem,
The error is as follows:
checking for nc-config... no
-----------------------------------------------------------------------------------
Error, nc-config not found or not executable. This is a script that comes with the netcdf library, version 4.1-beta2 or later, and must be present for configuration to succeed.
I was having a similar problem and these answers didn't quite work for me (Ubuntu 16.04.4 LTS).
I had to install the developer version using:
sudo apt-get install libnetcdf-dev
On CentOS 7, using sudo yum install netcdf-devel.x86_64
in a terminal did the trick.
As @PaulHiemstra mentioned in the comments, find out where your nc-config is:
What you can do is open a fresh terminal and do
which nc-config
. This will show you where the file is actually located in your system. If this file is indeed installed, the problem is probably that Linux installs it in a given location, and R expects it somewhere else (/usr/local/bin vs /usr/bin for example). You can try to fix the issue by adding the library containing nc-config to your PATH environment variable. Or the problem could be unrelated, e.g. 32 bit vs 64 bit.\
For me, it is:
ubuntu@dark-horse:~$ which nc-config
/home/ubuntu/miniconda3/bin/nc-config
I start with installing netcdf essentials using the below command
sudo apt-get install r-cran-ncdf4
The above command should have gotten nc-config installed, if not try:
sudo apt-get install netcdf-bin
Now, download the netcdf4 source
wget http://cirrus.ucsd.edu/~pierce/ncdf/ncdf4_1.13.tar.gz
Now, try to do the install
sudo R CMD INSTALL ncdf4_1.13.tar.gz --configure-args="--with-nc-config=/home/ubuntu/miniconda3/bin/nc-config"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With