Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a code which employs the modern netCDF c++ interface (netcdf namespace, include file is called just netcdf without .h or similar, ncFile class, etc) and have just switched to 12.04.1.

I installed netCDF and libnetcdf6 with apt-get, but I still get the "old" headers in /usr/local/include (netcdf.h, netcdfcpp.h, etc).

In Ubuntu, the library version for netCDF is 4.1.1, while at my own computer with Mac Os X (where I have the right netCDF include file) the version is

I cannot modify the source code I am using. I would like to know if there is a way to upgrade the netCDF library on Ubuntu to support the modern c++ interface, or, if I have to manually compile it, if you think that using src2pkg is a good idea. This is my first experience with Ubuntu.

share|improve this question
And later of the installation of netcdf, what should I do in order to check if my installation has been successful? – Luke Solo Apr 19 '14 at 5:50
up vote 0 down vote accepted

Open your terminal and run these commands:

tar -xvf netcdf-
cd netcdf-
sudo make install

For more information, in the netcdf- directory you will have a README file.

share|improve this answer
Thanks for the reply. I will do that. I though there was a more "ubuntu-like" way to do that rather than compiling from sources. It will bring me memories from when I was using Slackware and compiling from source. – iluvatar Oct 4 '12 at 4:31
I just want to add that to get the modern c++ interface I am looking for, I need to install the tarball from – iluvatar Oct 4 '12 at 14:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.