Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Cannot Find NetCDF Header...

Help
2010-07-19
2013-10-28
  • Huang Dazhen
    Huang Dazhen
    2010-07-19

    Dear all,
    I tried to install NCO on my HP PC, but it told me that "cannot find netCDF header".
    Here is the configuration file, followed by the error message when starting the compilation…
    Any help will be greatly appreciated. Thanks in advance !
        Leo

    ###########################
    # USR_TKN='-UNC_INQ_FORMAT' ./configure -prefix='/usr/local/nco' -disable-shared CFLAGS='-fPIC'  -enable-dap-netcdf
    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking target system type… i686-pc-linux-gnu
    checking for grep that handles long lines and -e… /bin/grep
    checking for egrep… /bin/grep -E
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for a thread-safe mkdir -p… /bin/mkdir -p
    checking for gawk… gawk
    checking whether make sets $(MAKE)… yes
    checking for gcc… gcc
    checking whether the C compiler works… yes
    checking for C compiler default output file name… a.out
    checking for suffix of executables…
    checking whether we are cross compiling… no
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ISO C89… none needed
    checking for style of include used by make… GNU
    checking dependency style of gcc… gcc3
    checking for g++… g++
    checking whether we are using the GNU C++ compiler… yes
    checking whether g++ accepts -g… yes
    checking dependency style of g++… gcc3
    checking how to run the C preprocessor… gcc -E
    checking how to run the C++ preprocessor… g++ -E
    checking for gcc option to accept ISO C99… -std=gnu99
    checking for gcc -std=gnu99 option to accept ISO Standard C… (cached) -std=gnu99
    checking for flex… flex
    checking lex output file root… lex.yy
    checking lex library… -lfl
    checking whether yytext is a pointer… yes
    checking for bison… bison -y
    checking whether ln -s works… yes
    checking for a sed that does not truncate output… /bin/sed
    checking for fgrep… /bin/grep -F
    checking for ld used by gcc -std=gnu99… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface… BSD nm
    checking the maximum length of command line arguments… 98304
    checking whether the shell understands some XSI constructs… yes
    checking whether the shell understands "+="… yes
    checking for /usr/bin/ld option to reload object files… -r
    checking for objdump… objdump
    checking how to recognize dependent libraries… pass_all
    checking for ar… ar
    checking for strip… strip
    checking for ranlib… ranlib
    checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object… ok
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking for dlfcn.h… yes
    checking whether we are using the GNU C++ compiler… (cached) yes
    checking whether g++ accepts -g… (cached) yes
    checking dependency style of g++… (cached) gcc3
    checking how to run the C++ preprocessor… g++ -E
    checking for objdir… .libs
    checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions… no
    checking for gcc -std=gnu99 option to produce PIC… -fPIC -DPIC
    checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works… yes
    checking if gcc -std=gnu99 static flag -static works… yes
    checking if gcc -std=gnu99 supports -c -o file.o… yes
    checking if gcc -std=gnu99 supports -c -o file.o… (cached) yes
    checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries… yes
    checking dynamic linker characteristics… GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking whether stripping libraries is possible… yes
    checking if libtool supports shared libraries… yes
    checking whether to build shared libraries… no
    checking whether to build static libraries… yes
    checking for ld used by g++… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking for g++ option to produce PIC… -fPIC -DPIC
    checking if g++ PIC flag -fPIC -DPIC works… yes
    checking if g++ static flag -static works… yes
    checking if g++ supports -c -o file.o… yes
    checking if g++ supports -c -o file.o… (cached) yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking dynamic linker characteristics… GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking whether to enable maintainer-specific portions of Makefiles… no
    checking for working memcmp… yes
    checking whether lstat correctly handles trailing slash… yes
    checking whether stat accepts an empty string… no
    checking for working strtod… yes
    checking for canonicalize_file_name… yes
    checking for floor… no
    checking for gethostname… yes
    checking for getpagesize… yes
    checking for getrusage… yes
    checking for memchr… yes
    checking for memmove… yes
    checking for memset… yes
    checking for mkstemp… yes
    checking for pow… no
    checking for readlink… yes
    checking for realpath… yes
    checking for regcomp… yes
    checking for setlocale… yes
    checking for sqrt… no
    checking for strchr… yes
    checking for strerror… yes
    checking for strpbrk… yes
    checking for strrchr… yes
    checking for strstr… yes
    checking for strtol… yes
    checking for ANSI C header files… (cached) yes
    checking getopt.h usability… yes
    checking getopt.h presence… yes
    checking for getopt.h… yes
    checking libintl.h usability… yes
    checking libintl.h presence… yes
    checking for libintl.h… yes
    checking limits.h usability… yes
    checking limits.h presence… yes
    checking for limits.h… yes
    checking locale.h usability… yes
    checking locale.h presence… yes
    checking for locale.h… yes
    checking netinet/in.h usability… yes
    checking netinet/in.h presence… yes
    checking for netinet/in.h… yes
    checking for stdlib.h… (cached) yes
    checking for string.h… (cached) yes
    checking for unistd.h… (cached) yes
    checking cstdlib usability… yes
    checking cstdlib presence… yes
    checking for cstdlib… yes
    checking for an ANSI C-conforming const… yes
    checking for inline… inline
    checking for pid_t… yes
    checking for size_t… yes
    checking whether struct tm is in sys/time.h or time.h… time.h
    checking for uid_t in sys/types.h… yes
    checking for ptrdiff_t… yes
    checking size of int*… 4
    checking whether C++ compiler implements namespaces… yes
    checking whether C++ compiler has working valarray<T>… yes
    checking for special C compiler options needed for large files… no
    checking for _FILE_OFFSET_BITS value needed for large files… 64
    Beginning generic tests for DAP support
    DEBUG: enable_dap_netcdf = yes and enable_dap_opendap = yes
    WARNING: Requested both DAP-netCDF and DAP-OPeNDAP support--overriding OPeNDAP
    Will attempt to build NCO with DAP support from netCDF4, not from OPeNDAP
    Testing for DAP-netCDF support (is DAP in libnetcdf.a?)…
    checking for nc__opendap in -lnetcdf… no
    configure: WARNING: DAP-netCDF support through libnetCDF disabled (missing DAP library)
    checking netcdf.h usability… no
    checking netcdf.h presence… no
    checking for netcdf.h… no
    configure: error: in `/home/jean/NCO/nco-4.0.2':
    configure: error: cannot find netCDF header
    See `config.log' for more details.

     
    • Hassan
      Hassan
      2013-10-27

      Dear Huang
      I have the same "netCDF header error " during the configuration of NCO.
      Can you please assist me in this regard??
      Waiting for your reply.

       
      Last edit: Hassan 2013-10-27
      • Charlie Zender
        Charlie Zender
        2013-10-28

        This is an old question. Please start a new thread.
        But first read the homepage and search for 'bonobo'.
        cz

         
        • Charlie Zender
          Charlie Zender
          2013-10-28

          by which i mean post an entirely new question on this forum
          if you cannot answer the question yourself after searching
          the homepage for bonobo.

           
  • Huang Dazhen
    Huang Dazhen
    2010-07-19

    The problem in configure has been solved but another one followed:
    after 
    # CPPFLAGS='-DNEED_NC_INQ_FORMAT=0' ./configure -prefix='/usr/local/nco'  \
                           -disable-shared CFLAGS='-fPIC'   \
                           NETCDF_INC=/usr/local/netcdf/include  \
                           NETCDF_LIB=/usr/local/netcdf/lib
    it tell me that :
    *******************************************************************
    Configuration complete. You are now ready to run 'make'.
    Ensure 'make' points to GNU Make (AT&T Make chokes on GNU syntax).
    If the build fails, please examine the file 'configure.eg'
    in the top-level NCO directory.  It contains examples known to
    build NCO for various platforms and compilers.
    *******************************************************************
    so :
    # make
    make  all-recursive
    make: Entering directory `/home/jean/NCO/nco-4.0.2'
    Making all in data
    make: Entering directory `/home/jean/NCO/nco-4.0.2/data'
    make: Nothing to be done for `all'.
    make: Leaving directory `/home/jean/NCO/nco-4.0.2/data'
    Making all in src
    make: Entering directory `/home/jean/NCO/nco-4.0.2/src'
    Making all in nco
    make: Entering directory `/home/jean/NCO/nco-4.0.2/src/nco'
    /bin/sh ../../libtool -tag=CXX -tag=CC   -mode=link gcc -std=gnu99  -fPIC -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE  -L/usr/local/netcdf/lib   -o ncap ncap_utl.o ncap.o ncap_yacc.o ncap_lex.o libnco.la -lgsl -lgsl -lgslcblas -lm -lm -lnetcdf
    libtool: link: gcc -std=gnu99 -fPIC -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE -o ncap ncap_utl.o ncap.o ncap_yacc.o ncap_lex.o  -L/usr/local/netcdf/lib ./.libs/libnco.a -lgsl -lgslcblas -lm /usr/local/netcdf/lib/libnetcdf.a
    /usr/local/netcdf/lib/libnetcdf.a(nc.o): In function `nc_inq_format':
    /home/mm5/netcdf-3.6.2/libsrc/nc.c:1613: multiple definition of `nc_inq_format'
    ./.libs/libnco.a(nco_netcdf.o):nco_netcdf.c:(.text+0xafb): first defined here
    /usr/bin/ld: Warning: size of symbol `nc_inq_format' changed from 19 in ./.libs/libnco.a(nco_netcdf.o) to 58 in /usr/local/netcdf/lib/libnetcdf.a(nc.o)
    collect2: ld returned 1 exit status
    make: ***  错误 1
    make: Leaving directory `/home/jean/NCO/nco-4.0.2/src/nco'
    make: ***  错误 1
    make: Leaving directory `/home/jean/NCO/nco-4.0.2/src'
    make: ***  错误 1
    make: Leaving directory `/home/jean/NCO/nco-4.0.2'
    make: ***  错误 2

    How to solve this monster?

     
  • Charlie Zender
    Charlie Zender
    2010-07-26

    sorry for the build difficulties. please try this and report on results:

    CPPFLAGS='-UNEED_NC_INQ_FORMAT' ./configure -prefix='/usr/local/nco'  \
                           -disable-shared CFLAGS='-fPIC'   \
                           NETCDF_INC=/usr/local/netcdf/include  \
                           NETCDF_LIB=/usr/local/netcdf/lib