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

Can't setup 0.7.4 on Windows XP machine #2

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

Can't setup 0.7.4 on Windows XP machine #2

dopplershift opened this issue Feb 26, 2014 · 12 comments

Comments

@dopplershift
Copy link
Member

From blt...@gmail.com on June 20, 2008 07:52:09

What steps will reproduce the problem? 1. Install HDF 1.8.1
2. Install NETCDF-4.0 (stable release version)
3. Set HDF5_DIR, SZIP_DIR and NETCDF4_DIR env variables
4. Run setup.py install What is the expected output? What do you see instead? Expected to install, instead, errored:
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\netCDF4-0.7.4\setup.py", line 46, in ?
raise ValueError('did not find HDF5 headers and libraries in %s' %
HDF5_dir)

ValueError: did not find HDF5 headers and libraries in C:\hdf5\hdf5lib\release What version of the product are you using? On what operating system? NETCDF4-0.7.4, Windows XP SP2 Please provide any additional information below. I checked the setup.py file and it seems to fail on the finding the version
number in the header file (include/H5pubconf.h). I checked the header file
located in the dir as specified above and did not find this line of code:

define H5_VERSION as needed by setup.

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

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on June 23, 2008 04:08:45

Did you actually build and install hdf5 1.8.1 and the netcdf-4.0 C libraries? (By
this I mean, did you run ./configure;make;make install?). If so, where did you
install them?

If you set HDF5_DIR to C:\hdf5\hdf5lib\release, the libs must be in
C:\hdf5\hdf5lib\release\lib and the headers in C:\hdf5\hdf5lib\release\include. Is
that correct?

Are you using a posix-like environment for windows like Cygwin or mingw32?

@dopplershift
Copy link
Member Author

From blt...@gmail.com on June 23, 2008 07:57:27

HDF5 installed and built using the directions specified for windows and built using
Microsoft Visual Studio 2005. Tested using the included routines with no failed
marks. So I think that HDF5 installed properly. Installed to c:\HDF5.

The libs and headers are in the folders as you specified above, including the file
H5pubconf.h as I mentioned that the setup file seems to be looking for. There is one
other version of this file in the HDF5 under C:\hdf5\vms\src which does have the
version number that setup.py is looking for, but is a very different file.

As to NetCDF 4.0, I installed this using the prebuilt binaries for windows following
the directions given. I think this might be another weak link here for me. I'm
realizing that the binaries are for 3.6.1? and not 4.0. Although I haven't yet even
gotten to failing on the NetCDF routines yet. I tried building NetCDF 4.0 for windows
and was not successful using VS 2005 and so I went with using the prebuilt binaries,
which I see now probably won't work anyway with your package.

I'm not that sophisticated of a programmer, I just wanted to be able to use the
NetCDF libraries with Python so I can do some ArcGIS programming and be able to read
from NetCDF files. If you have a simpler solution to getting there, I would
appreciate it. I've spent days (literally) trying to get NetCDF and HDF to be
useable on my machine. I think HDF is there, although not where it needs to be for
your program.

I am not using a posix-like environment, although I think that mingw32 is included
with Python? These are for compiling?

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on June 23, 2008 10:16:08

If you don't need the netCDF 4 features, you can use setup-nc3.py to install the
netCDF3 module, which should work with just the version of netcdf (3.6.1) that you
installed. Just set the NETCDF3_DIR env var to point to where you installed the
headers and lib, then run "python setup-nc3.py install".

Don't know why setup.py is failing to recognize your HDF5 installation. It's looking
at H5_VERSION in H5pubconf.h, see for example http://www.sfr-fresh.com/linux/misc/hdf5-1.8.1-linux-16API.tar.gz:a/5-1.8.1-linux-16API/include/H5pubconf.h I must admit that I haven't tested this with visual studio, only with gcc/mingw32
( http://www.mingw.org ).

@dopplershift
Copy link
Member Author

From blt...@gmail.com on June 27, 2008 09:10:18

After several days of playing around with this install, I installed MingW32, Msys to
installed HDF5 and NetCDF4. Set the environment variables properly and the install
now fails using MingW32 a:

File "setup.py", line 67, in ?
raise ValueError('did not find netCDF version 4 headers and libs in %s' %
netCDF4_dir)
ValueError: did not find netCDF version 4 headers and libs in c:/NetCDF/netcdf-4.0

This is not an error about finding the headers, you have it error if it does not find
the directory and if it does not find 'nc_inq_compound'. The error occurs for the
latter issue. There is no such code in the netcdf.h file after install of NetCDF4.
If I trick the setup file and tell it that it is a NetCDF4 directory, it will begin
to install, but fail with erorrs (see below). I also tried the nc3 version, but got
a different sent of errors (not included). Any suggestions about getting through
this would be appreciated.

running install
running build
running scons
customize Mingw32CCompiler
Found executable c:\MinGW\bin\gcc.exe
Ignoring "Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py." (one should
fix me in fcompiler/compaq.py)
customize GnuFCompiler
Found executable c:\MinGW\bin\g77.exe
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
Found executable c:\MinGW\bin\g77.exe
customize GnuFCompiler
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
customize Mingw32CCompiler
customize Mingw32CCompiler using scons
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
building py_modules sources
building extension "netCDF4" sources
running build_py
running build_ext
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
building 'netCDF4' extension
compiling C sources
C compiler: gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes

compile options: '-Ic:/NetCDF/netcdf-4.0\include -Ic:/HDF/hdf5-1.8.1\include
-Ic:\python24\lib\site-packages\numpy\core\include -Ic:\python24\include
-Ic:\python24\PC -c'
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ic:/NetCDF/netcdf-4.0\include
-Ic:/HDF/hdf5-1.8.1\include -Ic:\python24\lib\site-packages\numpy\core\include
-Ic:\python24\include -Ic:\python24\PC -c netCDF4.c -o
build\temp.win32-2.4\Release\netcdf4.o
netCDF4.c: In function __pyx_f_7netCDF4__get_att': netCDF4.c:567: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:628: error:NC_STRING' undeclared (first use in this function)
netCDF4.c:628: error: (Each undeclared identifier is reported only once
netCDF4.c:628: error: for each function it appears in.)
netCDF4.c: In function __pyx_pf_7netCDF4__set_default_format': netCDF4.c:1049: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In functionpyx_f_7netCDF4__set_att':
netCDF4.c:1473: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:1527: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:1527: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:1527: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:1527: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function __pyx_f_7netCDF4__get_dims': netCDF4.c:1894: warning: implicit declaration of functionnc_inq_dimids'
netCDF4.c: In function __pyx_f_7netCDF4__get_grps': netCDF4.c:2100: warning: implicit declaration of functionnc_inq_grps'
netCDF4.c:2221: warning: implicit declaration of function nc_inq_grpname' netCDF4.c: In function__pyx_f_7netCDF4__get_vars':
netCDF4.c:2473: warning: implicit declaration of function nc_inq_varids' netCDF4.c:2841: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:2843: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:2942: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:2944: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In function__pyx_pf_7netCDF4_7Dataset___init
':
netCDF4.c:3086: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function __pyx_pf_7netCDF4_7Dataset_createVariable': netCDF4.c:4042: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:4044: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:4045: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:4046: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In functionpyx_pf_7netCDF4_7Dataset___delattr':
netCDF4.c:4590: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function __pyx_pf_7netCDF4_7Dataset___setattr__': netCDF4.c:4744: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In functionpyx_pf_7netCDF4_7Dataset___getattr':
netCDF4.c:4940: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function __pyx_pf_7netCDF4_5Group___init__': netCDF4.c:5122: warning: implicit declaration of functionnc_def_grp'
netCDF4.c: In function __pyx_pf_7netCDF4_9Dimension_isunlimited': netCDF4.c:5717: warning: implicit declaration of functionnc_inq_unlimdims'
netCDF4.c:5766: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5767: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5875: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5876: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5889: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5890: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5926: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5927: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5940: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:5941: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function `pyx_pf_7netCDF4_8Variable___init':
netCDF4.c:6034: warning: dereferencing type-punned pointer will break strict-aliasing
...

@dopplershift
Copy link
Member Author

From blt...@gmail.com on June 27, 2008 09:10:18

...
rules
netCDF4.c:6036: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6037: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6038: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6110: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6115: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6174: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6611: warning: implicit declaration of function nc_def_var_deflate' netCDF4.c:6698: warning: implicit declaration of functionnc_def_var_fletcher32'
netCDF4.c:6946: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6946: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6946: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6946: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:6964: warning: implicit declaration of function nc_def_var_chunking' netCDF4.c:7051: warning: implicit declaration of functionnc_def_var_endian'
netCDF4.c:7051: error: NC_ENDIAN_LITTLE' undeclared (first use in this function) netCDF4.c:7074: error:NC_ENDIAN_BIG' undeclared (first use in this function)
netCDF4.c:7197: warning: implicit declaration of function nc_def_var_fill' netCDF4.c:7465: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:7467: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In functionpyx_pf_7netCDF4_8Variable_filters':
netCDF4.c:8019: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:8020: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:8022: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:8057: warning: implicit declaration of function nc_inq_var_deflate' netCDF4.c:8096: warning: implicit declaration of functionnc_inq_var_fletcher32'
netCDF4.c:8145: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:8178: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:8200: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function __pyx_pf_7netCDF4_8Variable_endian': netCDF4.c:8278: warning: implicit declaration of functionnc_inq_var_endian'
netCDF4.c:8317: error: NC_ENDIAN_LITTLE' undeclared (first use in this function) netCDF4.c:8340: error:NC_ENDIAN_BIG' undeclared (first use in this function)
netCDF4.c: In function __pyx_pf_7netCDF4_8Variable_chunking': netCDF4.c:8449: warning: implicit declaration of functionnc_inq_var_chunking'
netCDF4.c: In function __pyx_pf_7netCDF4_8Variable___delattr**': netCDF4.c:8736: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In function pyx_pf_7netCDF4_8Variable___setattr':
netCDF4.c:8933: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function**pyx_pf_7netCDF4_8Variable___getattr**': netCDF4.c:9125: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In function pyx_pf_7netCDF4_8Variable___getitem':
netCDF4.c:9426: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:9426: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:9426: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:9426: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:9491: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:9491: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:9491: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c:9491: warning: dereferencing type-punned pointer will break strict-aliasing
rules
netCDF4.c: In function**pyx_pf_7netCDF4_8Variable___setitem**': netCDF4.c:10051: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In function __pyx_pf_7netCDF4_8Variable_set_auto_maskandscale':
netCDF4.c:10310: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:10312: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:10324: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:10326: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c: In function**pyx_pf_7netCDF4_8Variable__put': netCDF4.c:10610: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:10659: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:10851: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:10851: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:10851: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:10851: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In function __pyx_pf_7netCDF4_8Variable__get':
netCDF4.c:10979: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11005: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11007: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11065: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11067: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11256: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11305: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11356: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11356: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11356: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:11356: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c: In function__pyx_pf_7netCDF4_stringtochar': netCDF4.c:11611: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In function __pyx_pf_7netCDF4_getlibversion':
netCDF4.c:12056: warning: assignment discards qualifiers from pointer target type
netCDF4.c: In function`__pyx_pf_7netCDF4_9MFDataset___init
':
netCDF4.c:12172: warning: dereferencing typ...

@dopplershift
Copy link
Member Author

From blt...@gmail.com on June 27, 2008 09:10:18

...e-punned pointer will break
strict-aliasing rules
netCDF4.c:12227: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:12599: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:12599: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:12599: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:12599: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c: In function __pyx_pf_7netCDF4_10_Dimension_isunlimited': netCDF4.c:14193: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:14194: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c: In functionpyx_pf_7netCDF4_9_Variable___getitem':
netCDF4.c:15102: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:15128: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:15201: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:15352: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:15378: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c: In function initnetCDF4': netCDF4.c:16583: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:16587: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:16590: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:16593: warning: dereferencing type-punned pointer will break strict-aliasing rules netCDF4.c:16809: error:NC_UBYTE' undeclared (first use in this function)
netCDF4.c:16831: error: NC_USHORT' undeclared (first use in this function) netCDF4.c:16853: error:NC_UINT' undeclared (first use in this function)
netCDF4.c:16864: error: NC_INT64' undeclared (first use in this function) netCDF4.c:16875: error:NC_UINT64' undeclared (first use in this function)
netCDF4.c:16939: error: NC_FILL_UBYTE' undeclared (first use in this function) netCDF4.c:16961: error:NC_FILL_USHORT' undeclared (first use in this function)
netCDF4.c:16983: error: NC_FILL_UINT' undeclared (first use in this function) netCDF4.c:16994: error:NC_FILL_INT64' undeclared (first use in this function)
netCDF4.c:17005: error: NC_FILL_UINT64' undeclared (first use in this function) netCDF4.c: In function__Pyx_PyObject_IsTrue':
netCDF4.c:17885: warning: dereferencing type-punned pointer will break
strict-aliasing rules
netCDF4.c:17886: warning: dereferencing type-punned pointer will break
strict-aliasing rules

@dopplershift
Copy link
Member Author

From abw...@gmail.com on June 27, 2008 10:23:25

Did you build netcdf with '--enable-netcdf-4' ? This is the error you would get if only the netcdf version 3
library were built (which is what happens by default if you run configure without --enable-netcdf-4).

-Jeff

@dopplershift
Copy link
Member Author

From blt...@gmail.com on June 30, 2008 10:17:48

I specified --enable-netcdf-4 as above and specified ZLIB and HDF directory locations
and now get the following error:

"Can't find the hdf5 high-level library" when configuring NetCDF4. I have not found
any help on this error online. Have you experienced this error? It gets far through
configure before I get this error. Any suggestions.

Thanks, Andrew

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on June 30, 2008 10:35:21

Andrew: You'll have to specify exactly how you built and installed HDF5 and netCDF.
Note that in the netcdf4-python docs it says that you need to build HDF5 1.8.1 with -
-enable-hl, and when building netcdf4 you have to use --enable-netcdf-4 and --with-
hdf5=.

-Jeff

@dopplershift
Copy link
Member Author

From blt...@gmail.com on July 01, 2008 06:27:30

Jeff,
If I include the statement --enable-netcdf-4 in the ./configure statement for NetCDF4
install, I get the message I mention above, when I do not include this, it manages to
get through this cleanly.

Installed HDF5 NETCDF4 using msys, mingw32

HDF5
$ ./configure --with-zlib=/c/HDF/zlib-1.2.3/include,/c/HDF/zlib-1.2.3/lib
--prefix=/c/HDF/hdf5-1.8.1 --enable-shared --enable-hl

make check
make install

NetCDF5
$ ./configure --enable-docs-install --disable-f77 --with-zlib=/c/HDF/zlib-1.2.3
--with-hdf5=/c/HDF/hdf5-1.8.1 --prefix=/c/NETCDF/netcdf-4.0 --enable-shared

make check
make install

Thanks for your help

Cheers, Andrew

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on July 01, 2008 20:19:45

Andrew; Well, it sure looks right. I don't know why netcdf-4 doesn't detect your HDF5 installation. I think this
is a question for the netcdf folks (netcdfgroup@unidata.ucar.edu). Sorry I can't be of more help.

-Jeff

@dopplershift
Copy link
Member Author

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

Status: Done

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