NetCDF libraries for CMS

649 views
Skip to first unread message

Antonio Hdz

unread,
Sep 2, 2014, 2:33:01 PM9/2/14
to connectivity-mod...@googlegroups.com
Hello, I'm kind of new using Linux (I have Fedora 14 on 64 bits) and I have few experience programming.
However, I'm trying install the netCDF libraries in order to use the CMS, but I have some troubles.
Next are the steps I tried:

1) I downloaded netcdf-fortran-4.2, untar, and then ./configure:

  [root@cm06 netcdf-fortran-4.2]# ./configure
  configure: netCDF-Fortran 4.2
  ...
  configure: checking types, headers, and functions
  checking netcdf.h usability... no
  checking netcdf.h presence... no
  checking for netcdf.h... no
  configure: error: netcdf.h could not be found. Please set CPPFLAGS.

2) I downloaded netcdf-4.3.22, untar, and then ./configure:

  [root@cm06 netcdf-4.3.2]# ./configure
  checking for library containing deflate... no
  configure: error: Can't find or link to the z library. Turn off netCDF-4 and      opendap with --disable-netcdf-4 --disable-dap, or see config.log for errors.

What could I do?
I hope to be in the right place, and thanks in advanced!!
 









Message has been deleted

Antonio Hdz

unread,
Sep 3, 2014, 2:05:12 AM9/3/14
to connectivity-mod...@googlegroups.com

Fedora 14 is too old, so I will get Fedora 20, and try again!

bexeross

unread,
Sep 3, 2014, 4:17:27 AM9/3/14
to connectivity-mod...@googlegroups.com
Hi Antonio,

Good luck with this, it took me ages to get it working too (on Ubuntu 12.04) so maybe someone more familiar with the ins and outs of linux and the netcdf package will be able to give more comprehensive advice (or correct mine). But in my case I did manage to get it working when I set CPPFLAGS and the CFLAGS:

>tar -xzvf netcdf-4.3.2.tar.gz
>cd netcdf-4.3.2/
>CPPFLAGS = -I /home/me/local/include CFLAGS = -L /home/me/local/lib ./configure --enable-netcdf4 --enable-dap --prefix = /home/me/local


Note that I installed all my previous files (culr, zlib, hdf5) with the prefix set to my custom location (/home/me/local) so that I could make sure I knew where everything went - if you let it choose then you probably have to look in the /usr/local/include or /usr/include and /usr/local/lib or /usr/lib for all the correct headers and libraries. If it says it can't find something (e.g. netcdf.h or zlib as you mention above) the key is to figure out whether you actually don't have it or whether it is just that you haven't told it the right place to look.

If all that works then the make check command is super helpful at diagnosing whether everything is all right

>make
>make check
>make install

Best of luck to you,
All the best,
Bex

Antonio Hdz

unread,
Sep 4, 2014, 6:51:10 PM9/4/14
to connectivity-mod...@googlegroups.com
Thanks Bex, I appreciate your answer.
Finally I installed Fedora 20 (64 bits), I updated the system, and then I did:

(1)    Install C-compiler:
        # yum install gcc-c++

(2)    Install gfortran:
        $ su -c "yum install gcc-gfortran"

(3)    Download Fortran compiler (g95-x86-linux.tgz) from www.g95.org/ and:
        # tar -zxvf g95-x86-linux.tgz
        # ln -s $PWD/g95-install/bin/i686-pc-linux-gnu-g95 /usr/bin/g95

(4)    Instal netCDF-C libraries
    $ sudo yum install netcdf.x86_64
$ sudo yum install netcdf-devel.x86_64

(5) Downloaded netcdf-fortran-4.4.0.tar.gz from unidata web page and:
# tar -zxvf g95-x86-linux.tgz
# ./configure # make check # make install

Apparently everything went fine.
I'll continue installing the CMS...

Best regards

Yu Cheng

unread,
Sep 24, 2014, 2:51:11 PM9/24/14
to connectivity-mod...@googlegroups.com
It's netcdf configuration problem. You'd better check their UNIDATA websites. 


To configure netcdf, you also need to install some depending packages.

One good way to not worry about dependency is using Package manager, in Fedora, probably rpm or yum to install packages. 




There are more options than simply ./configure, and some options may need to specify path or libraries. It depends on what you need.

Hope this help.

Yu
Reply all
Reply to author
Forward
0 new messages