[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #XUL-308811]: please help! error "checking C++ compiler "gcc"... configure: warning: gcc failed to compile test program"



Hi Jun Li,

> I tried to install netcdf version 3.3.1 on my linux server. I got
> configure error: "checking C++ compiler "gcc"... configure: warning: gcc
> failed to compile test program..."
> 
> Your help is highly appreciated!!!

Version 3.3.1 of netCDF is from 1997 (12 years ago) and is no longer supported.

I think you would have better luck trying to build from a more recent version
of netCDF, for example 4.0.1 or 4.1-beta2 available from 

  ftp://ftp.unidata.ucar.edu/pub/netcdf/

or

  http://www.unidata.ucar.edu/downloads/netcdf/

The message from the configure script  
 checking C++ compiler "gcc"... configure: warning: gcc failed to compile
 test program
 configure: warning: Could not find working C++ compiler
is not an error message, it's merely indicating the C++ interface to 
netCDF will not be built because no C++ compiler could be found.

The error message:
 make[2]: Entering directory `/usr/local/src/netcdf/src/ncdump'
 make[2]: *** No rule to make target `../zlibsrc/libznetcdf.a', needed by
 `ncdump'.  Stop.
is the problem that caused the build to fail.  The fact that ncdump
needed the library "libznetcdf.a" indicates this netCDF source distribution
is not from Unidata.  Maybe you are trying to build the Cornell version
of netCDF that does compression.  For more help with that, you will need
to contact the developer of that software.

If you just need a version of netCDF that supports compression, the
4.0.1 and 4.1-beta versions from Unidata provide zlib compression.  The
4.1 version will be released soon, and provides even better support for zlib 
compression.

--Russ



> system: redhat linux el5
> $:  uname -a
> $: Linux hprcc7.unl.edu 2.6.18-92.1.10.el5 #1 SMP Wed Jul 23 03:55:54 EDT
> 2008 i686 i686 i386 GNU/Linux
> gcc compiler version
> $ gcc -v
> Using built-in specs.
> Target: i386-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
> --infodir=/usr/share/info --enable-shared --enable-threads=posix
> --enable-checking=release --with-system-zlib --enable-__cxa_atexit
> --disable-libunwind-exceptions --enable-libgcj-multifile
> --enable-languages=c,c++,objc,obj-c++,java,fortran,ada
> --enable-java-awt=gtk --disable-dssi --enable-plugin
> --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
> --with-cpu=generic --host=i386-redhat-linux
> Thread model: posix
> gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
> 
> The following information provided as requested:
> 1.the exact version of netCDF: 3.3.1
> 
> 2.1 the *complete* output of “./configure”
> # ./configure
> loading cache ./config.cache
> checking for m4... (cached) m4
> checking for xlc... (cached) cc
> checking C compiler... works
> checking how to make dependencies... false
> checking for CC... no
> checking for cxx... no
> checking for c++... no
> checking for g++... no
> checking for gcc... gcc
> checking C++ compiler "gcc"... configure: warning: gcc failed to compile
> test program
> configure: warning: Could not find working C++ compiler
> configure: warning: Setting CXX to the empty string
> configure: warning: The C++ interface will not be built
> checking how to run the C preprocessor... (cached) cc -E
> checking for f77... (cached) f77
> checking for FORTRAN .F compiler...
> checking if FORTRAN compiler handles *.F files... yes
> checking for C-equivalent to FORTRAN routine "SUB"... sub_
> checking for FORTRAN "byte"... yes
> checking for FORTRAN "integer*2"... yes
> checking if FORTRAN "byte" is C "signed char"... yes
> checking if FORTRAN "byte" is C "short"... no
> checking if FORTRAN "byte" is C "int"... no
> checking if FORTRAN "integer*2" is C "short"... yes
> checking if FORTRAN "integer*2" is C "int"... no
> checking if FORTRAN "integer" is C "int"... yes
> checking if FORTRAN "real" is C "float"... yes
> checking if FORTRAN "doubleprecision" is C "double"... yes
> checking for FORTRAN-equivalent to netCDF "byte"... byte
> checking for FORTRAN-equivalent to netCDF "short"... integer*2
> checking for math library
> checking for -lc... (cached) no
> checking for -lm... (cached) yes
> checking for ar... (cached) ar
> checking for ranlib... (cached) ranlib
> checking for stdlib.h... (cached) yes
> checking for sys/types.h... (cached) yes
> checking for strerror... (cached) yes
> checking for ftruncate... (cached) yes
> checking for st_blksize in struct stat... (cached) yes
> checking whether cross-compiling... (cached) no
> checking for IEEE floating point format... yes
> checking for ANSI C header files... (cached) yes
> checking for size_t... (cached) yes
> checking for off_t... (cached) yes
> checking for ssize_t... (cached) yes
> checking for ptrdiff_t... (cached) yes
> checking for uchar... (cached) no
> checking whether char is unsigned... (cached) no
> checking whether byte ordering is bigendian... (cached) no
> checking size of short... (cached) 2
> checking size of int... (cached) 4
> checking size of long... (cached) 4
> checking size of float... (cached) 4
> checking size of double... (cached) 8
> checking size of off_t... (cached) 4
> checking size of size_t... (cached) 4
> checking for manual-page index command...
> checking binary distribution directory...
> /home/ftp/pub/binary/dummy_system
> creating ./config.status
> creating macros.make
> udcreating fortran/nfconfig.inc
> fortran/nfconfig.inc is unchanged
> creating libsrc/ncconfig.h
> libsrc/ncconfig.h is unchanged
> 
> 2.2 the *complete* output of “make”
> # make
> make[1]: Entering directory `/usr/local/src/netcdf/src'
> 
> Making `all' in directory /usr/local/src/netcdf/src/libsrc
> 
> make[2]: Entering directory `/usr/local/src/netcdf/src/libsrc'
> ar cru   libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o
> putget.o string.o v1hpg.o v2i.o var.o
> ranlib libnetcdf.a
> make[2]: Leaving directory `/usr/local/src/netcdf/src/libsrc'
> 
> Returning to directory /usr/local/src/netcdf/src
> 
> make[1]: Leaving directory `/usr/local/src/netcdf/src'
> make[1]: Entering directory `/usr/local/src/netcdf/src'
> 
> Making `all' in directory /usr/local/src/netcdf/src/fortran
> 
> make[2]: Entering directory `/usr/local/src/netcdf/src/fortran'
> ar cru   ../libsrc/libnetcdf.a fort-attio.o fort-control.o fort-dim.o
> fort-genatt.o fort-geninq.o fort-genvar.o fort-lib.o fort-misc.o
> fort-v2compat.o fort-vario.o fort-var1io.o fort-varaio.o fort-varmio.o
> fort-varsio.o
> ranlib ../libsrc/libnetcdf.a
> make[2]: Leaving directory `/usr/local/src/netcdf/src/fortran'
> 
> Returning to directory /usr/local/src/netcdf/src
> 
> make[1]: Leaving directory `/usr/local/src/netcdf/src'
> make[1]: Entering directory `/usr/local/src/netcdf/src'
> 
> Making `all' in directory /usr/local/src/netcdf/src/ncdump
> 
> make[2]: Entering directory `/usr/local/src/netcdf/src/ncdump'
> make[2]: *** No rule to make target `../zlibsrc/libznetcdf.a', needed by
> `ncdump'.  Stop.
> make[2]: Leaving directory `/usr/local/src/netcdf/src/ncdump'
> make[1]: *** [subdir_target] Error 1
> make[1]: Leaving directory `/usr/local/src/netcdf/src'
> make: *** [ncdump/all] Error 2
> 
> 2.3 the *complete* output of “make check”
> ]# make check
> make[1]: Entering directory `/usr/local/src/netcdf/src'
> 
> Making `test' in directory /usr/local/src/netcdf/src/libsrc
> 
> make[2]: Entering directory `/usr/local/src/netcdf/src/libsrc'
> ar cru   libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o
> putget.o string.o v1hpg.o v2i.o var.o
> ranlib libnetcdf.a
> cc -o t_nc -O  t_nc.o -L. -lnetcdf
> t_nc.o: In function `main':
> t_nc.c:(.text+0x1cb): undefined reference to `malloc_debug'
> collect2: ld returned 1 exit status
> make[2]: *** [t_nc] Error 1
> make[2]: Leaving directory `/usr/local/src/netcdf/src/libsrc'
> make[1]: *** [subdir_target] Error 1
> make[1]: Leaving directory `/usr/local/src/netcdf/src'
> make: *** [libsrc/test] Error 2
> 
> 3. if the configure failed, the contents of config.log.
> # cat config.log
> This file contains any messages produced by compilers while
> running configure, to aid debugging if configure makes a mistake.
> 
> configure:1017: cc -c -O -DNDEBUG conftest.c 1>&5
> configure:1150: gcc -c  -DNDEBUG conftest.C 1>&5
> gcc: error trying to exec 'cc1plus': execvp: No such file or directory
> configure:1370: f77 -c -O conftest.f
> configure:1415: f77 -o conftest -O conftest.F
> configure:1456: f77 -c -O conftest.f
> configure:1491: f77 -c -O conftest.f
> configure:1514: f77 -c -O conftest.f
> configure:1548: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1550: f77 -o conftest -O  conftestf.f conftest.o
> configure:1552: ./conftest
> configure:1590: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1592: f77 -o conftest -O  conftestf.f conftest.o
> configure:1594: ./conftest
> configure:1632: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1634: f77 -o conftest -O  conftestf.f conftest.o
> configure:1636: ./conftest
> configure:1678: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1680: f77 -o conftest -O  conftestf.f conftest.o
> configure:1682: ./conftest
> configure:1720: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1722: f77 -o conftest -O  conftestf.f conftest.o
> configure:1724: ./conftest
> configure:1764: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1766: f77 -o conftest -O  conftestf.f conftest.o
> configure:1768: ./conftest
> configure:1806: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1808: f77 -o conftest -O  conftestf.f conftest.o
> configure:1810: ./conftest
> configure:1848: cc -c -DNDEBUG -O conftest.c
> conftest.c: In function 'sub_':
> conftest.c:4: warning: incompatible implicit declaration of built-in
> function 'exit'
> configure:1850: f77 -o conftest -O  conftestf.f conftest.o
> configure:1852: ./conftest
> configure:1882: f77 -c -O conftest.f
> configure:1903: f77 -c -O conftest.f
> configure:2322: cc -o conftest -O -DNDEBUG  conftest.c  1>&5
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: XUL-308811
Department: Support netCDF
Priority: Normal
Status: Closed