Ticket #4717 (closed defect: invalid)

Opened 12 months ago

Last modified 12 months ago

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) (diff)

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

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

Change History

  Changed 12 months ago by etourigny

  • status changed from new to assigned
  • description modified (diff)

  Changed 12 months ago by etourigny

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

Changed 12 months ago by capooti

configuration log file

  Changed 12 months ago by capooti

  • version changed from 1.9.1 to 1.9.0
  • summary changed from netcdf4 is not built into gdal on REL 5 to netcdf4 is not built into gdal on RHEL 5

  Changed 12 months ago by etourigny

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

  Changed 12 months ago by capooti

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.

follow-up: ↓ 7   Changed 12 months ago by 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)

in reply to: ↑ 6   Changed 12 months ago by capooti

  • status changed from assigned to closed
  • resolution set to invalid

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.

  Changed 12 months ago by etourigny

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.