Menu

#12 ncdf_att_cl.cpp

closed
nobody
5
2009-06-08
2005-11-24
Anonymous
No

"./configure" works fine, but "make" makes problems:

[snip]

then mv -f ".deps/gdl-math_utl.Tpo"
".deps/gdl-math_utl.Po"; else rm -f
".deps/gdl-math_utl.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I..
-I/usr/include/magick -I/usr/include
-I/usr/include/hdf -I/usr/include/hdf -g -O2 -MT
gdl-ncdf_att_cl.o -MD -MP
-MF ".deps/gdl-ncdf_att_cl.Tpo" -c -o
gdl-ncdf_att_cl.o `test -f
'ncdf_att_cl.cpp' || echo './'`ncdf_att_cl.cpp; \
then mv -f ".deps/gdl-ncdf_att_cl.Tpo"
".deps/gdl-ncdf_att_cl.Po"; else rm -f
".deps/gdl-ncdf_att_cl.Tpo"; exit 1; fi
ncdf_att_cl.cpp: In function 'BaseGDL*
lib::ncdf_attname(EnvT*)':
ncdf_att_cl.cpp:84: error: 'NC_MAX_NAME' was not
declared in this scope
ncdf_att_cl.cpp:109: error: 'att_name' was not
declared in this scope
ncdf_att_cl.cpp:109: error: 'nc_inq_attname' was not
declared in this scope
ncdf_att_cl.cpp:114: error: no matching function for
call to
'Data_<SpDString>::Data_(<type error>)'
datatypes.hpp:76: note: candidates are: Data_<
<template-parameter-1-1>
>::Data_(const Data_< <template-parameter-1-1> >&)
[with Sp = SpDString]
datatypes.hpp:72: note: Data_<
<template-parameter-1-1>
>::Data_(const dimension&, const typename Sp::DataT&)
[with Sp = SpDString]
datatypes.hpp:69: note: Data_<
<template-parameter-1-1>
>::Data_(const typename Sp::Ty*, SizeT) [with Sp =
SpDString]
datatypes.hpp:66: note: Data_<
<template-parameter-1-1>
>::Data_(const dimension&) [with Sp = SpDString]
datatypes.hpp:63: note: Data_<
<template-parameter-1-1>
>::Data_(const dimension&, BaseGDL::InitType) [with
Sp = SpDString]
datatypes.hpp:60: note: Data_<
<template-parameter-1-1>
>::Data_(const typename Sp::Ty&) [with Sp =
SpDString]
datatypes.hpp:57: note: Data_<
<template-parameter-1-1>
>::Data_() [with Sp = SpDString]
ncdf_att_cl.cpp: In function 'BaseGDL*
lib::ncdf_attinq(EnvT*)':
ncdf_att_cl.cpp:159: error: 'nc_inq_att' was not
declared in this scope
ncdf_att_cl.cpp: In function 'void
lib::ncdf_attget(EnvT*)':
ncdf_att_cl.cpp:225: error: 'nc_inq_att' was not
declared in this scope
ncdf_att_cl.cpp:232: error: 'NC_INT' was not declared
in this scope
ncdf_att_cl.cpp:240: error: 'nc_get_att_int' was not
declared in this scope
ncdf_att_cl.cpp:258: error: 'nc_get_att_short' was
not declared in this scope
ncdf_att_cl.cpp:280: error: 'nc_get_att_float' was
not declared in this scope
ncdf_att_cl.cpp:302: error: 'nc_get_att_double' was
not declared in this scope
ncdf_att_cl.cpp:322: error: 'nc_get_att_text' was not
declared in this scope
ncdf_att_cl.cpp:342: error: 'nc_get_att_uchar' was
not declared in this scope
ncdf_att_cl.cpp: In function 'void
lib::ncdf_attput(EnvT*)':
ncdf_att_cl.cpp:400: error: 'NC_INT' was not declared
in this scope
ncdf_att_cl.cpp:414: error: 'NC_INT' was not declared
in this scope
ncdf_att_cl.cpp:425: error: 'nc_put_att_uchar' was
not declared in this scope
ncdf_att_cl.cpp:434: error: 'nc_put_att_text' was not
declared in this scope
ncdf_att_cl.cpp:441: error: 'nc_put_att_short' was
not declared in this scope
ncdf_att_cl.cpp:448: error: 'nc_put_att_int' was not
declared in this scope
ncdf_att_cl.cpp:455: error: 'nc_put_att_float' was
not declared in this scope
ncdf_att_cl.cpp:462: error: 'nc_put_att_double' was
not declared in this scope
ncdf_att_cl.cpp: In function 'BaseGDL*
lib::ncdf_attcopy(EnvT*)':
ncdf_att_cl.cpp:535: error: 'nc_copy_att' was not
declared in this scope
ncdf_att_cl.cpp: In function 'void
lib::ncdf_attdel(EnvT*)':
ncdf_att_cl.cpp:581: error: 'nc_del_att' was not
declared in this scope
ncdf_att_cl.cpp: In function 'void
lib::ncdf_attrename(EnvT*)':
ncdf_att_cl.cpp:631: error: 'nc_rename_att' was not
declared in this scope
make[3]: *** [gdl-ncdf_att_cl.o] error 1
make[3]: Verlasse Verzeichnis
»/home/tux/software/gdl-0.8.11/src«
make[2]: *** [all-recursive] error 1
make[2]: Verlasse Verzeichnis
»/home/tux/software/gdl-0.8.11/src«
make[1]: *** [all-recursive] error 1
make[1]: Verlasse Verzeichnis
»/home/tux/software/gdl-0.8.11«
make: *** [all] error 2

even if i try ./configure --with-netcdf=/usr
--with-python=no
it does not work. I am sure, it would work with a
"--with-netcdf=no", but I
need netcdf-support.

gcc --version is gcc (GCC) 4.0.2 (Debian 4.0.2-2)
kernel-version is: 2.6.12-1-386 (Debian Etch 1)

I'd be very glad, if someone has an idea, to fix this
problem. Or if someone had the same problem and
solved it somehow.

Thanks very much and greetings,
Juergen

Discussion

  • Ricardo Javier Cárdenes Medina

    Logged In: YES
    user_id=126549

    That's a very simple problem (I got bit by it just yesterday).

    There are a number of #include <netcdf.h> in the ncdf* files
    that should be enclosed into an 'extern "C"' environment.
    Instead of that, you can just replace:

    #include <netcdf.h>

    by:

    #include <netcdfcpp.h>

    Do it in every file that includes netcdf.h (5 files, 4
    .cpp's and 1 .hpp), and you're done.

     
  • Nobody/Anonymous

    Logged In: NO

    Thanks for your hint!

    perhaps your solution is better, I just solved it in
    another way.

    I copied the /usr/include/netcdf.h onto
    the /usr/include/hdf/netcdf.h

    That seemed to work, althoug "make" had a few warning
    messages about that, "make install" worked fine.

    Don't know, if my way causes any problems. Yet gdl seems to
    work.

    Do you think, this might be an improper way?

    Thanks for your help and also thanks to M. Schellens, who
    helped me a lot via eMail

    Regards,
    Juergen

     
  • Nobody/Anonymous

    Logged In: NO

    P.S.:

    In the GDL shell, the "HELP" or "INFO" command does not
    work, a message says: "GDL_STARTUP / IDL_STARTUP environment
    variables both not set. No startup file read."

    Where can I set these variables? Is it in .bashrc?

    Thanks very much again,
    Juergen

     
  • Marc Schellens

    Marc Schellens - 2005-11-30

    Logged In: YES
    user_id=932957

    renaming netcdf.h to netcdfcpp.h is a good idea,
    I just did this in the CVS.
    Nevertheless I assume that this does not solve
    the OP's problem as netcdfcpp.h in turn includes
    netcdf.h and this collides with the hdf version of
    netcdf.h
    So far I haven't found a real satifying solution,
    even though on all systems so far this issue could be
    solved (please refer to the README for details how).

    marc

     
  • Ricardo Javier Cárdenes Medina

    Logged In: YES
    user_id=126549

    At least in my system (Debian based) this isn't a problem,
    as netcdf.h and netcdfcpp.h are under /usr/include/, which
    comes before /usr/include/hdf/ in the include path.

    And then, HDF headers include their netcdf.h using ""
    instead of <>, so they will be included locally, instead of
    using /usr/include (I think).

    So for me, no problem. (BTW, I made a preliminar Debian
    package, with source at http://www.not.iac.es/~rcardenes/,
    if anybody wants it)

     
  • John Burton

    John Burton - 2009-01-29

    Is the netcdf-devel package installed on your system? The errors you are getting seem to stem from a it not finding the netcdf include file (netcdf.h ?).

    John

     
  • Sylwester Arabas

    This seem to be solved and a bit outdated - I'm closing the item, please post a new one if needed.

    Sylwester

    P.S.:
    - HELP should work in GDL (but not all keywords are implemented)
    - GDL_STARTUP / IDL_STARTUP are environmental variables and they can be set in .bashrc

     
  • Sylwester Arabas

    • status: open --> closed
     

Log in to post a comment.