Opened 15 years ago

Closed 15 years ago

#20342 closed defect (fixed)

nco-3.9.8 Conflicting types - build error

Reported by: uthyr@… Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: netcdf Cc:
Port: nco

Description (last modified by mf2k (Frank Schima))

I've tried building nco with netcdf configured for each fortran variant (netcdf +g95, netcdf +gfortran). in both cases, I get these identical conflicting type definitions.

Errors are:

Making all in nco
/bin/sh ../../libtool --tag=CXX --tag=CC   --mode=compile /usr/bin/gcc-4.0 -std=gnu99 -DHAVE_CONFIG_H -I. -I../..   -I/opt/local/include -I/usr/include/malloc -I/opt/local/include  -fno-common -O2 -std=c99 -D_BSD_SOURCE  -c -o nco_att_utl.lo nco_att_utl.c
libtool: compile:  /usr/bin/gcc-4.0 -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I/usr/include/malloc -I/opt/local/include -fno-common -O2 -std=c99 -D_BSD_SOURCE -c nco_att_utl.c -o nco_att_utl.o
In file included from nco_netcdf.h:27,
                 from nco_att_utl.h:26,
                 from nco_att_utl.c:9:
nco_typ.h:76:1: warning: "NC_FILL_INT64" redefined
In file included from nco_att_utl.h:25,
                 from nco_att_utl.c:9:
/opt/local/include/netcdf.h:92:1: warning: this is the location of the previous definition
In file included from nco_netcdf.h:27,
                 from nco_att_utl.h:26,
                 from nco_att_utl.c:9:
nco_typ.h:77:1: warning: "NC_FILL_UINT64" redefined
In file included from nco_att_utl.h:25,
                 from nco_att_utl.c:9:
/opt/local/include/netcdf.h:93:1: warning: this is the location of the previous definition
In file included from nco_att_utl.h:26,
                 from nco_att_utl.c:9:
nco_netcdf.h:165: error: conflicting types for 'nc_def_var_chunking'
/opt/local/include/netcdf.h:688: error: previous declaration of 'nc_def_var_chunking' was here
nco_netcdf.h:171: error: conflicting types for 'nc_get_var1_ushort'
/opt/local/include/netcdf.h:1032: error: previous declaration of 'nc_get_var1_ushort' was here
nco_netcdf.h:183: error: conflicting types for 'nc_put_var1_string'
/opt/local/include/netcdf.h:1060: error: previous declaration of 'nc_put_var1_string' was here
nco_netcdf.h:187: error: conflicting types for 'nc_get_vara_ushort'
/opt/local/include/netcdf.h:1147: error: previous declaration of 'nc_get_vara_ushort' was here
nco_netcdf.h:199: error: conflicting types for 'nc_put_vara_string'
/opt/local/include/netcdf.h:1175: error: previous declaration of 'nc_put_vara_string' was here
nco_netcdf.h:203: error: conflicting types for 'nc_get_vars_ushort'
/opt/local/include/netcdf.h:1282: error: previous declaration of 'nc_get_vars_ushort' was here
nco_netcdf.h:215: error: conflicting types for 'nc_put_vars_string'
/opt/local/include/netcdf.h:1317: error: previous declaration of 'nc_put_vars_string' was here
nco_netcdf.h:219: error: conflicting types for 'nc_get_varm_ushort'
/opt/local/include/netcdf.h:1425: error: previous declaration of 'nc_get_varm_ushort' was here
nco_netcdf.h:231: error: conflicting types for 'nc_put_varm_string'
/opt/local/include/netcdf.h:1460: error: previous declaration of 'nc_put_varm_string' was here
nco_netcdf.h:240: error: conflicting types for 'nc_put_att_string'
/opt/local/include/netcdf.h:916: error: previous declaration of 'nc_put_att_string' was here
nco_netcdf.h:245: error: conflicting types for 'nc_get_att_ushort'
/opt/local/include/netcdf.h:890: error: previous declaration of 'nc_get_att_ushort' was here
In file included from nco_att_utl.h:29,
                 from nco_att_utl.c:9:
nco.h:183:1: warning: "NC_NETCDF4" redefined
In file included from nco_att_utl.h:25,
                 from nco_att_utl.c:9:
/opt/local/include/netcdf.h:151:1: warning: this is the location of the previous definition
make[3]: *** [nco_att_utl.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_nco/work/nco-3.9.8" && make all " returned error 2
Command output: nco_netcdf.h:171: error: conflicting types for 'nc_get_var1_ushort'
/opt/local/include/netcdf.h:1032: error: previous declaration of 'nc_get_var1_ushort' was here
nco_netcdf.h:183: error: conflicting types for 'nc_put_var1_string'
/opt/local/include/netcdf.h:1060: error: previous declaration of 'nc_put_var1_string' was here
nco_netcdf.h:187: error: conflicting types for 'nc_get_vara_ushort'
/opt/local/include/netcdf.h:1147: error: previous declaration of 'nc_get_vara_ushort' was here
nco_netcdf.h:199: error: conflicting types for 'nc_put_vara_string'
/opt/local/include/netcdf.h:1175: error: previous declaration of 'nc_put_vara_string' was here
nco_netcdf.h:203: error: conflicting types for 'nc_get_vars_ushort'
/opt/local/include/netcdf.h:1282: error: previous declaration of 'nc_get_vars_ushort' was here
nco_netcdf.h:215: error: conflicting types for 'nc_put_vars_string'
/opt/local/include/netcdf.h:1317: error: previous declaration of 'nc_put_vars_string' was here
nco_netcdf.h:219: error: conflicting types for 'nc_get_varm_ushort'
/opt/local/include/netcdf.h:1425: error: previous declaration of 'nc_get_varm_ushort' was here
nco_netcdf.h:231: error: conflicting types for 'nc_put_varm_string'
/opt/local/include/netcdf.h:1460: error: previous declaration of 'nc_put_varm_string' was here
nco_netcdf.h:240: error: conflicting types for 'nc_put_att_string'
/opt/local/include/netcdf.h:916: error: previous declaration of 'nc_put_att_string' was here
nco_netcdf.h:245: error: conflicting types for 'nc_get_att_ushort'
/opt/local/include/netcdf.h:890: error: previous declaration of 'nc_get_att_ushort' was here
In file included from nco_att_utl.h:29,
                 from nco_att_utl.c:9:
nco.h:183:1: warning: "NC_NETCDF4" redefined
In file included from nco_att_utl.h:25,
                 from nco_att_utl.c:9:
/opt/local/include/netcdf.h:151:1: warning: this is the location of the previous definition
make[3]: *** [nco_att_utl.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Warning: the following items did not execute (for nco): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.
salome stow> 

Change History (3)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Description: modified (diff)
Keywords: nco removed
Owner: changed from macports-tickets@… to takeshi@…

comment:2 Changed 15 years ago by tenomoto (Takeshi Enomoto)

I recently modified nco Portfile to be compatible with netcdf. I enabled netcdf 4 in nco. If you have netcdf 3.6.2, it should be upgraded to netcdf 4. I have these:

netcdf @4.0.1_3+dap+netcdf4+universal (active) nco @3.9.8_0+universal (active)

comment:3 Changed 15 years ago by tenomoto (Takeshi Enomoto)

Resolution: fixed
Status: newclosed

I was able to reproduce similar errors. Somehow HAVE_NETCDF4_H is not written in config.h. I added it in configure.cppflags-append as a workaround. I upgraded it to nco-2.9.9. I also added udunits2 package. Currently it is a variant (+udunit2). I committed the changes in r53994 (I wanted commit nco and udunits2 separately but I did it so by chance...)

Note: See TracTickets for help on using tickets.