Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4717 closed defect (invalid)

netcdf4 is not built into gdal on RHEL 5

Reported by: capooti Owned by: etourigny
Priority: normal Milestone: 1.9.2
Component: ConfigBuild Version: 1.9.0
Severity: normal Keywords:
Cc:

Description (last modified by etourigny)

I have installed netcdf4 on my system, using the --enable-netcdf-4 option:

$ nc-config --all

This netCDF 4.1.3 has been built with the following features: 

  --cc        -> gcc
  --cflags    ->  -I/usr/local/include 
  --libs      -> -L/usr/local/lib -lnetcdf

  --cxx       -> g++
  --has-c++   -> yes

  --fc        -> gfortran
  --fflags    -> -g -O2 -I/usr/local/include
  --flibs     -> -L/usr/local/lib -lnetcdff -lnetcdf
  --has-f77   -> yes
  --has-f90   -> yes

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> no
  --has-pnetcdf-> no
  --has-szlib -> 

  --prefix    -> /usr/local
  --includedir-> /usr/local/include
  --version   -> netCDF 4.1.3

I have configured GDAL (full log attached), but after compiling NetCDF4 support seems missing:

$ gdalinfo --format netcdf
Format Details:
  Short Name: netCDF
  Long Name: Network Common Data Format
  Extension: nc
  Help Topic: frmt_netcdf.html
  Supports: Create() - Create writeable dataset.
  Supports: CreateCopy() - Create dataset by copying another.

<CreationOptionList>
  <Option name="FORMAT" type="string-select" default="NC">
    <Value>NC</Value>
    <Value>NC2</Value>
  </Option>
  <Option name="WRITE_BOTTOMUP" type="boolean" default="YES" />
  <Option name="WRITE_GDAL_TAGS" type="boolean" default="YES" />
  <Option name="WRITE_LONLAT" type="string-select">
    <Value>YES</Value>
    <Value>NO</Value>
    <Value>IF_NEEDED</Value>
  </Option>
  <Option name="TYPE_LONLAT" type="string-select">
    <Value>float</Value>
    <Value>double</Value>
  </Option>
  <Option name="PIXELTYPE" type="string-select" description="only used in Create()">
    <Value>DEFAULT</Value>
    <Value>SIGNEDBYTE</Value>
  </Option>
</CreationOptionList>

Attachments (1)

conf.log (14.9 KB ) - added by capooti 12 years ago.
configuration log file

Download all attachments as: .zip

Change History (9)

comment:1 by etourigny, 12 years ago

Description: modified (diff)
Status: newassigned

comment:2 by etourigny, 12 years ago

The output of "configure" is missing, as well as the file config.log.

by capooti, 12 years ago

Attachment: conf.log added

configuration log file

comment:3 by capooti, 12 years ago

Summary: netcdf4 is not built into gdal on REL 5netcdf4 is not built into gdal on RHEL 5
Version: 1.9.11.9.0

comment:4 by etourigny, 12 years ago

you have netcdf-3 installed in the system:

checking for nc_open in -lnetcdf... yes
using pre-installed libnetcdf from /usr
checking libnetcdf version with /usr/bin/ncdump... got 3.6.2
ncdump and/or nc-config not found, skipping netcdf-4 tests

so either upgrade the system install of netcdf to netcdf-4.1.x, or use the --with-netcdf=<install_dir> option to notify gdal that you are using a custom build of netcdf

comment:5 by capooti, 12 years ago

You are right. But, if I use the --with-netcdf option, while configure's output changes according:

checking for nc_open in -lnetcdf... yes using libnetcdf from /usr/local/lib ncdump and/or nc-config not found, skipping netcdf-4 tests

I still get same output from nc-config from gdalinfo --format netcdf.

comment:6 by etourigny, 12 years ago

Do you have nc-config in /usr/local/bin ? If not then that's the problem.

What exact option did you use in configure? In your case it should be --with-netcdf=/usr/local

You have to use the netcdf prefix installation (or tree prefix), not the libs dir.

Ref. the configure docs

  --with-netcdf=ARG     Include netCDF support (ARG=no or netCDF tree prefix)

in reply to:  6 comment:7 by capooti, 12 years ago

Resolution: invalid
Status: assignedclosed

Replying to etourigny:

Do you have nc-config in /usr/local/bin ? If not then that's the problem.

What exact option did you use in configure? In your case it should be --with-netcdf=/usr/local

You have to use the netcdf prefix installation (or tree prefix), not the libs dir.

Ref. the configure docs

  --with-netcdf=ARG     Include netCDF support (ARG=no or netCDF tree prefix)

Perfect, now it is working as expected, thanks a lot ;)

I am marking this ticket as invalid: I guess it should not exist, as it was generated by my misunderstanding in GDAL configuration, but even then I guess it is useful to be here if other people get in same shoes.

comment:8 by etourigny, 12 years ago

I was going to close it as invalid, just waiting for confirmation.

I have updated the wiki page (wiki:NetCDF) for more clarity

Note: See TracTickets for help on using tickets.