Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetCDF4 interface compile error #1

Closed
dopplershift opened this issue Feb 26, 2014 · 11 comments
Closed

NetCDF4 interface compile error #1

dopplershift opened this issue Feb 26, 2014 · 11 comments

Comments

@dopplershift
Copy link
Member

From steven.k...@gmail.com on February 02, 2008 10:44:30

What steps will reproduce the problem? 1. Installing netcdf-4.0-2008013102 on 32- and -64-bit Linux platforms with
the recommended gfortran 4.1.2 flags and libraries, e.g. the following HDF
library.

configure --prefix=/opt/gfortran/netcdf-4.0-2008013102 --enable-netcdf-4
--with-hdf5=/opt/gfortran/hdf5-1.8.0-rc2 --with-zlib=/usr

  1. Installing hdf5-1.8.0-rc2 on 32- and 64-bit Linux platforms with the
    recommended gfortran 4.1.2 flags.

configure --prefix=/opt/gfortran/hdf5-1.8.0-rc2 --enable-fortran
--enable-cxx --with-zlib=/usr

  1. Attempting to build netCDF4-0.7.3.1 What is the expected output? What do you see instead? The error message, consistent across 4 platforms thus far:

compile options: '-I/opt/gfortran/netcdf-4.0-2008013102/include
-I/opt/gfortran/hdf5-1.8.0-rc2/include
-I/usr/lib/python2.5/site-packages/numpy/core/include
-I/usr/include/python2.5 -c'
gcc: netCDF4.c
netCDF4.c: In function ‘pyx_pf_7netCDF4_8Variable___init’:
netCDF4.c:7882: error: ‘NC_CHUNK_SUB’ undeclared (first use in this function)
netCDF4.c:7882: error: (Each undeclared identifier is reported only once
netCDF4.c:7882: error: for each function it appears in.)
netCDF4.c:7905: error: ‘NC_CHUNK_SEQ’ undeclared (first use in this function)
netCDF4.c:8088: warning: passing argument 3 of ‘nc_def_var_chunking’ makes
integer from pointer without a cast
netCDF4.c:8088: error: too many arguments to function ‘nc_def_var_chunking’
netCDF4.c: In function ‘pyx_pf_7netCDF4_8Variable_chunking’:
netCDF4.c:9836: error: too many arguments to function ‘nc_inq_var_chunking’
netCDF4.c:9963: error: ‘NC_CHUNK_SEQ’ undeclared (first use in this function)
netCDF4.c:9986: error: ‘NC_CHUNK_SUB’ undeclared (first use in this function)
netCDF4.c:10009: error: ‘NC_CHUNK_SIZES’ undeclared (first use in this
function)
netCDF4.c: In function ‘__pyx_pf_7netCDF4_getlibversion’:
netCDF4.c:14529: warning: assignment discards qualifiers from pointer
target type
netCDF4.c: In function ‘initnetCDF4’:
netCDF4.c:20679: warning: integer constant is too large for ‘long’ type
netCDF4.c:20690:62: warning: integer constant is so large that it is unsigned
netCDF4.c:20690: warning: this decimal constant is unsigned only in ISO C90
netCDF4.c:20690: warning: integer constant is too large for ‘long’ type
netCDF4.c: In function ‘__pyx_pf_7netCDF4_8Variable___init
’:
netCDF4.c:7882: error: ‘NC_CHUNK_SUB’ undeclared (first use in this function)
netCDF4.c:7882: error: (Each undeclared identifier is reported only once
netCDF4.c:7882: error: for each function it appears in.)
netCDF4.c:7905: error: ‘NC_CHUNK_SEQ’ undeclared (first use in this function)
netCDF4.c:8088: warning: passing argument 3 of ‘nc_def_var_chunking’ makes
integer from pointer without a cast
netCDF4.c:8088: error: too many arguments to function ‘nc_def_var_chunking’
netCDF4.c: In function ‘__pyx_pf_7netCDF4_8Variable_chunking’:
netCDF4.c:9836: error: too many arguments to function ‘nc_inq_var_chunking’
netCDF4.c:9963: error: ‘NC_CHUNK_SEQ’ undeclared (first use in this function)
netCDF4.c:9986: error: ‘NC_CHUNK_SUB’ undeclared (first use in this function)
netCDF4.c:10009: error: ‘NC_CHUNK_SIZES’ undeclared (first use in this
function)
netCDF4.c: In function ‘__pyx_pf_7netCDF4_getlibversion’:
netCDF4.c:14529: warning: assignment discards qualifiers from pointer
target type
netCDF4.c: In function ‘initnetCDF4’:
netCDF4.c:20679: warning: integer constant is too large for ‘long’ type
netCDF4.c:20690:62: warning: integer constant is so large that it is unsigned
netCDF4.c:20690: warning: this decimal constant is unsigned only in ISO C90
netCDF4.c:20690: warning: integer constant is too large for ‘long’ type
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC
-I/opt/gfortran/netcdf-4.0-2008013102/include
-I/opt/gfortran/hdf5-1.8.0-rc2/include
-I/usr/lib/python2.5/site-packages/numpy/core/include
-I/usr/include/python2.5 -c netCDF4.c -o
build/temp.linux-i686-2.5/netCDF4.o" failed with exit status 1 What version of the product are you using? On what operating system? Please provide any additional information below. This version of NetCDF4 will not compile successfully with the
--enable-netcdf-4 flag against versions of HDF5 older than this one. Russ
Rew tells me that's due to the final change in the HDF5 API before the
release of HDF5 1.8.0.

On the other hand, the NetCDF3 version works fine with NetCDF 3.6.2.

Original issue: http://code.google.com/p/netcdf4-python/issues/detail?id=1

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on February 29, 2008 15:20:18

I think you forgot to include --enable-hl when compiling HDF5

@dopplershift
Copy link
Member Author

From Edwards....@gmail.com on April 23, 2008 17:57:38

Hi.

I have a very similar error message also on a 64-bit linux machine. I compiled hdf5 with the --enable-hl
option (I believe I've done this correctly) but that seems to not have changed the error. Thanks if you have any
other suggestions.

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on April 23, 2008 18:32:51

I think you must be using a recent netCDF4 snapshot. The released version of the module won't work with the
new snapshots, you'll need to use the SVN version of netcdf4-python instead.

@dopplershift
Copy link
Member Author

From Edwards....@gmail.com on April 23, 2008 20:41:01

Hi. Yes, I was running today's netCDF4 snapshot. Thanks for the suggestion. With the svn version of netcdf4-
python, everything seems to install properly, or at least without error messages, but when I try and run tests, on
import netCDF4 I get an error:
ImportError: /home/cae/local/python/lib64/python2.4/site-packages/netCDF4.so: undefined symbol:
inflateEnd

Again, any suggestions are appreciated.

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on April 24, 2008 09:58:48

inflateEnd looks like a symbol from the zlib library. I'm pretty sure setup.py links
libz, so I don't know why this would be happening. If you are on linux, could you
send the result of

ldd /home/cae/local/python/lib64/python2.4/site-packages/netCDF4.so

or macos x

otool -L /home/cae/local/python/lib64/python2.4/site-packages/netCDF4.so

@dopplershift
Copy link
Member Author

From Edwards....@gmail.com on April 24, 2008 10:22:38

[cae@bluewater ~]$ ldd /home/cae/local/python/lib64/python2.4/site-packages/netCDF4.so
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaab030000)
libc.so.6 => /lib64/libc.so.6 (0x00002aaaab24a000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on April 24, 2008 10:28:34

I don't see the hdf5, netcdf or zlib libs in there. Did you set the HDF5_DIR and
NETCDF4_DIR env vars? Please capture the output of build and mail it to me directly
(jeffrey.s.whitaker@noaa.gov).

@dopplershift
Copy link
Member Author

From Edwards....@gmail.com on April 25, 2008 09:33:20

Yes, the environment variables were set properly, but the hdf and netcdf libraries were not built as shared. Now
that they are, it works. Thanks for your help.

@dopplershift
Copy link
Member Author

From steven.k...@gmail.com on June 04, 2008 08:25:23

The addition of --enable-hl worked when using the latest versions as of June 4, i.e.

hdf5-1.8.0-snap5
netcdf-4.0-snapshot2008060210

as well as using yesterday's version of netcdf4-python from checkout.

Thanks.

@dopplershift
Copy link
Member Author

From steven.k...@gmail.com on June 04, 2008 08:33:39

I guess I should also mention that if you're compiling on a 64-bit machine with
gfortran, you either have to use the --enable-shared option when compiling NetCDF or
add the -fPIC compiler flag if you're not using --enable-shared.

I have directories continaing both shared and not shared versions of NetCDF since
ROMS doesn't seem to like the shared version, at least not when using gfortran.

I'm not going to get into how many different versions I compile when using ifort or
other commercial compilers, as I prefer to get all misty-eyed and nostalgic about the
days of one compiler on one platform, i.e. the DEC VAX days of yore.

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on May 25, 2009 06:02:29

Status: Done

jswhit pushed a commit that referenced this issue Nov 16, 2014
Turn netcdftime.datetime into a Cython extension type
jswhit pushed a commit that referenced this issue Jul 3, 2017
fixes #686 Encode filename with sys.getfilesystemencoding()
jswhit added a commit that referenced this issue Jul 3, 2017
fixes #686 Encode filename with sys.getfilesystemencoding()      master (#1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant