Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 4.2.1.1.

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 at 5:50

1 Answer 1

up vote 0 down vote accepted

Open your terminal and run these commands:

wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.2.1.1.tar.gz
tar -xvf netcdf-4.2.1.1.tar.gz
cd netcdf-4.2.1.1
./configure
make
sudo make install

For more information, in the netcdf-4.2.1.1 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 http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.2.tar.gz –  iluvatar Oct 4 '12 at 14:24

Your Answer

 
discard

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.