Building 2.1.0 on Windows.

644 views
Skip to first unread message

Chris Billington

unread,
May 16, 2012, 9:41:53 PM5/16/12
to h5py
Hi guys,

Issue 240 has our lab's software crashing more often than I'd like, and so I'm trying to upgrade to h5py 2.1.0 where the issue is fixed. I can verify that under linux the issue is no more, but unfortunately I'm stuck with Windows in the lab.

Where I'm at is that I've got h5py compiling and installing, but it just can't link to hdf5 dlls at run time.

So far I've installed visual studio 2008, and installed the precompiled (with  visual studio 2008) hdf5 shared libraries from the hdf5 website (HDF5189-win32-vs9-shared.zip).

These hdf5 libraries have the .lib and .dll files in separate bin and lib folders, and there isn't a dll folder, so I modified h5py's setup.py (near line 62):

COMPILER_SETTINGS['library_dirs'] += [op.join(HDF5, 'bin')]
COMPILER_SETTINGS['library_dirs'] += [op.join(HDF5, 'lib')]

Then I *renamed* hdf5dll.dll in the bin folder to hdf518dll.dll.

I then built h5py with:

python setup.py build --hdf5="C:\Program Files\HDF Group\HDF1.8.9" --compiler=msvc

and installed with:

python setup.py install

The build appeared to be successful, but when I tried to import h5py I get:

>>> import h5py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\h5py\__init__.py", line 1, in <module>
    from h5py import _errors
ImportError: DLL load failed: The specified module could not be found.

Any idea what I'm doing wrong? Where do I have to put the dlls for them to be found by h5py? I've tried putting them in python's site-packages, but it doesn't seem to help. I don't care about compression at all, and haven't tried to include zlib.

Alternately, an eta on the release of 2.1.0 would help me decide whether this is worth pursuing, because I can possibly live with my program crashing until then!

Cheers,

-Chris

Andrew Collette

unread,
May 18, 2012, 12:13:45 AM5/18/12
to h5...@googlegroups.com
Hi Chris,

> Issue 240 has our lab's software crashing more often than I'd like, and
> so I'm trying to upgrade to h5py 2.1.0 where the issue is fixed. I can
> verify that under linux the issue is no more, but unfortunately I'm stuck
> with Windows in the lab.

Ouch. Sorry about this; 2.1.0 is way behind schedule and building
h5py on Windows is seriously frustrating.

> python setup.py build --hdf5="C:\Program Files\HDF Group\HDF1.8.9"
> --compiler=msvc

This looks right (although you shouldn't have to force the compiler option).

> Any idea what I'm doing wrong? Where do I have to put the dlls for them to
> be found by h5py? I've tried putting them in python's site-packages, but it
> doesn't seem to help. I don't care about compression at all, and haven't
> tried to include zlib.

All the dlls should go in the "h5py" directory (where all the .pyx
files are); Windows finds them when h5py is imported. However, if
you're using the HDF Group builds I think you'll also have to provide
both zlib and szip libraries or the import will fail.

> Alternately, an eta on the release of 2.1.0 would help me decide whether
> this is worth pursuing, because I can possibly live with my program crashing
> until then!

The best I can say at the moment is 2.1.0-beta will be coming out
"soon" (meaning a few weeks). We made some changes in 2.1.0 that got
away from me and led to lots of regressions, and I haven't had the
time recently to get them all nailed down. There are lots of bugfixes
in 2.1.0 that people are waiting on (as you discovered). :/

Andrew

Chris Billington

unread,
May 18, 2012, 12:45:32 AM5/18/12
to h5...@googlegroups.com
Excellent, it works!

Thanks for that :)

Turns out the hdf5 dlls (from the HDF group's build) included slib and zlib, so I put them in there too and all is well.

If I didn't force the compiler option it was using gcc, which I guess is installed through cygwin.

Thanks again and good luck with the 2.1.0 release!

-Chris


Andrew

--
You received this message because you are subscribed to the Google Groups "h5py" group.
To post to this group, send email to h5...@googlegroups.com.
To unsubscribe from this group, send email to h5py+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h5py?hl=en.


Pedro Camargo

unread,
Mar 30, 2015, 2:14:04 PM3/30/15
to h5...@googlegroups.com
I am having similar issues when building the latest version (2.4) on windows 64 bits (The Cython for Windows 64 bits is a non-issue for me).

When building just with the source code downloaded from the website (the tar.gz file) I get the error `'hdf5.h': No such file or directory

If I copy all the files from my hdf5 installation to the h5py folder, I get LNK1181: cannot open input file 'h5py_hdf5.lib'


Does anybody have any idea of what is going on?

Thanks,

Pedro


PS - Compilation reporting (including both tries)


Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0
.
Targeting Windows 7 x64 RELEASE


D:\HDF5>cd D:\HDF5\h5py-2.4.0

D:\HDF5\h5py-2.4.0>c:\Python27\python setup.py build_ext --inplace
running build_ext
Autodetection skipped [[Error 126] The specified module could not be found]
********************************************************************************

                       Summary of the h5py configuration

    Path to HDF5: None
    HDF5 Version: '1.8.4'
     MPI Enabled: False
Rebuild Required: False

********************************************************************************

Executing api_gen rebuild of defs
Compiling D:\HDF5\h5py-2.4.0\h5py\defs.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\_errors.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\_objects.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\_proxy.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5fd.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5z.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5i.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5r.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\utils.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\_conv.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5t.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5s.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5p.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5d.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5a.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5f.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5g.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5l.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5o.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5ds.pyx because it changed.
Compiling D:\HDF5\h5py-2.4.0\h5py\h5ac.pyx because it changed.
Cythonizing D:\HDF5\h5py-2.4.0\h5py\_conv.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\_errors.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\_objects.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\_proxy.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\defs.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5a.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5ac.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5d.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5ds.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5f.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5fd.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5g.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5i.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5l.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5o.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5p.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5r.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5s.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5t.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\h5z.pyx
Cythonizing D:\HDF5\h5py-2.4.0\h5py\utils.pyx
building 'h5py.defs' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\HDF5
creating build\temp.win-amd64-2.7\Release\HDF5\h5py-2.4.0
creating build\temp.win-amd64-2.7\Release\HDF5\h5py-2.4.0\h5py
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64\cl.exe /c /nolog
o /Ox /MD /W3 /GS- /DNDEBUG -DH5_USE_16_API -D_HDF5USEDLL_ -ID:\HDF5\h5py-2.4.0\
lzf -ID:\HDF5\h5py-2.4.0\windows -Ic:\Python27\lib\site-packages\numpy\core\incl
ude -Ic:\Python27\include -Ic:\Python27\PC /TcD:\HDF5\h5py-2.4.0\h5py\defs.c /Fo
build\temp.win-amd64-2.7\Release\HDF5\h5py-2.4.0\h5py\defs.obj
defs.c
c:\python27\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(
12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DE
PRECATED_API NPY_1_7_API_VERSION
d:\hdf5\h5py-2.4.0\h5py\api_compat.h(27) : fatal error C1083: Cannot open includ
e file: 'hdf5.h': No such file or directory
error: command 'cl.exe' failed with exit status 2

D:\HDF5\h5py-2.4.0>c:\Python27\python setup.py build_ext --inplace
running build_ext
Autodetection skipped [[Error 126] The specified module could not be found]
********************************************************************************

                       Summary of the h5py configuration

    Path to HDF5: None
    HDF5 Version: '1.8.4'
     MPI Enabled: False
Rebuild Required: False

********************************************************************************

building 'h5py.defs' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64\cl.exe /c /nolog
o /Ox /MD /W3 /GS- /DNDEBUG -DH5_USE_16_API -D_HDF5USEDLL_ -ID:\HDF5\h5py-2.4.0\
lzf -ID:\HDF5\h5py-2.4.0\windows -Ic:\Python27\lib\site-packages\numpy\core\incl
ude -Ic:\Python27\include -Ic:\Python27\PC /TcD:\HDF5\h5py-2.4.0\h5py\defs.c /Fo
build\temp.win-amd64-2.7\Release\HDF5\h5py-2.4.0\h5py\defs.obj
defs.c
c:\python27\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(
12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DE
PRECATED_API NPY_1_7_API_VERSION
d:\hdf5\h5py-2.4.0\h5py\H5api_adpt.h(30) : warning C4005: '_HDF5USEDLL_' : macro
 redefinition
        command-line arguments :  see previous definition of '_HDF5USEDLL_'
D:\HDF5\h5py-2.4.0\h5py\defs.c(6503) : warning C4244: '=' : conversion from 'ssi
ze_t' to 'int', possible loss of data
D:\HDF5\h5py-2.4.0\h5py\defs.c(6594) : warning C4244: '=' : conversion from 'ssi
ze_t' to 'int', possible loss of data
D:\HDF5\h5py-2.4.0\h5py\defs.c(7973) : warning C4244: '=' : conversion from 'ssi
ze_t' to 'int', possible loss of data
D:\HDF5\h5py-2.4.0\h5py\defs.c(15418) : warning C4133: 'function' : incompatible
 types - from 'int *' to 'size_t *'
D:\HDF5\h5py-2.4.0\h5py\defs.c(23413) : warning C4047: 'function' : 'const hsize
_t *' differs in levels of indirection from 'hsize_t **'
D:\HDF5\h5py-2.4.0\h5py\defs.c(23413) : warning C4024: 'H5Sselect_elements' : di
fferent types for formal and actual parameter 4
D:\HDF5\h5py-2.4.0\h5py\defs.c(28462) : warning C4267: '=' : conversion from 'si
ze_t' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64\link.exe /DLL /n
ologo /INCREMENTAL:NO /LIBPATH:c:\Python27\libs /LIBPATH:c:\Python27\PCbuild\amd
64 h5py_hdf5.lib h5py_hdf5_hl.lib /EXPORT:initdefs build\temp.win-amd64-2.7\Rele
ase\HDF5\h5py-2.4.0\h5py\defs.obj /OUT:D:\HDF5\h5py-2.4.0\h5py\defs.pyd /IMPLIB:
build\temp.win-amd64-2.7\Release\HDF5\h5py-2.4.0\h5py\defs.lib /MANIFESTFILE:bui
ld\temp.win-amd64-2.7\Release\HDF5\h5py-2.4.0\h5py\defs.pyd.manifest
LINK : fatal error LNK1181: cannot open input file 'h5py_hdf5.lib'
error: command 'link.exe' failed with exit status 1181

D:\HDF5\h5py-2.4.0>

郑博

unread,
Aug 7, 2015, 10:45:02 AM8/7/15
to h5py
 I have the same problem that linker cannot open input file 'h5py_hdf5.lib'. It's strange because I cannot find the file 'h5py_hdf5.lib' at any place on my pc.

在 2015年3月31日星期二 UTC+8上午2:14:04,Pedro Camargo写道:
Reply all
Reply to author
Forward
0 new messages