[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #FCB-421026]: Biulding netcdf librairies.....problems...advices needed...



Hi Gilles,

Sorry to have taken so long to respond to your question ...
> I am trying to build NetCDF library to run the WRF model. I use linux
> OS Ubuntu 12.04.  I know a little bit about scripting but I am kind of
> rusty to say the least.  I easily get lost...
> 
> After creating a netcdf directory, I downloaded there the
> netcdf-4.2.1.1.tar.gz file, I used gunzip to extract and realized the
> building without hdf5 (hoping I don't need it for WRF) as described on
> unidata web site.
> 
> I then used the  "make check install" to check if everything is fine. It
> looks ok, but it mentionned after many ok lines in the terminal window
> it said:
> 
> "test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include"
> /usr/bin/install -c -m 644 netcdf.h '/usr/local/include'
> /usr/bin/install: cannot create regular file `/usr/local/include/netcdf.h': 
> Permission denied
> make[2]: *** [install-includeHEADERS] Error 1
> make[2]: Leaving directory `/home/gilles/netcdf/netcdf-4.2.1.1/include'
> make[1]: *** [install-am] Error 2
> make[1]: Leaving directory `/home/gilles/netcdf/netcdf-4.2.1.1/include'
> make: *** [install-recursive] Error 1"
> 
> So it seems something is wrong, perhaps the path, or the location of
> the directory where I downloaded the tar.gz file and started building
> the library in the first time.
> 
> Any suggestion?

Yes, I think you are trying to run "make install" as an ordinary user, who 
doesn't
have the necessary permissions for installing in a system directory, such as
/usr/local/lib or /usr/local/include.  If you have "sudo" permissions, try 
running

  sudo make install

which will ask for your password.  If you aren't set up as a "sudo" user, 
you'll either
have to login as "root" to run the make install command, or install netCDF in a
directory where you have the necessary permissions, such as your home 
directory.  To
specify an alternate installation location, instead of the default 
"/usr/local", 
use the --prefix= option to the configure script after running "make clean" but
before running "make check" and "make install".

> Then in the same netcdf directory I downloaded the
> netcdf-fortran-4.2.tar.gz and used gunzip command, then went in the
> netcdf-fortran-4.2 directroty and did the ./configure, but it complained
> the following:
> 
> configure: error netcdf.h could not be found. Please set CPPFLAGS.
> 
> Seems another path problem but I am not even sure that if I download the
> first netcdf-4.2.1.1.tar.gz file and install it correctly I really need
> the netcdf-fortran-4.2.tar.gz and realize the set up to run the WRF...
> 
> So should I build that library too or just the first one is enough?

You need to have built and installed the netCDF 4.2.1.1 C library before
trying to build and install the netCDF-4.2 Fortran library, as described
here:

  http://www.unidata.ucar.edu/netcdf/docs/netcdf-fortran-install.html

> Also a friend just emailed me few minutes ago to told me not to use the
> netcdf 4.*** version for running the WRF but 3.***
> 
> So should I uninstall netcdf 4.2.1 and install a 3.*** version?

No, that's not necessary or advisable.  You can use netCDF 4.2.1.1 with any
program that worked with netCDF-3, as it's backward compatible.  And you
built without the HDF5 library (or maybe with the --disable-netcdf-4
configure option), so what you have is essentially netCDF-3 with some bug
fixes included since the old netcdf-3.6.3 release.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: FCB-421026
Department: Support netCDF
Priority: High
Status: Closed