torch-rnn icon indicating copy to clipboard operation
torch-rnn copied to clipboard

Won't build h5py in Ubuntu 17

Open wsanders opened this issue 7 years ago • 3 comments

While running "pip install -r requirements.txt". "pip install h5py" worked ok though...

   In file included from /root/git/torch-rnn/.env/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781:0,
                     from /root/git/torch-rnn/.env/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /root/git/torch-rnn/.env/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from /tmp/pip-build-2Jd8UA/h5py/h5py/api_compat.h:26,
                     from /tmp/pip-build-2Jd8UA/h5py/h5py/defs.c:279:
    /root/git/torch-rnn/.env/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^~~~~~~
    In file included from /tmp/pip-build-2Jd8UA/h5py/h5py/defs.c:279:0:
    /tmp/pip-build-2Jd8UA/h5py/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
     #include "hdf5.h"
                      ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/root/git/torch-rnn/.env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2Jd8UA/h5py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-u0hSCQ-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/git/torch-rnn/.env/include/site/python2.7/h5py" failed with error code 1 in /tmp/pip-build-2Jd8UA/h5py/

The preproessor works OK but train.lua fails, can't find hdf5.h even though is it present in /usr/include/hdf5/serial/hdf5.h:

# th train.lua --input_h5 data/tiny-shakespeare.h5  --input_json data/tiny-shakespeare.json
/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/trepl/init.lua:389: /root/torch/install/share/lua/5.1/trepl/init.lua:389: /root/torch/install/share/lua/5.1/hdf5/ffi.lua:42: Error: unable to locate HDF5 header file at hdf5.h

Root cause is "share/lua/5.1/hdf5/ffi.lua:71: Unsupported HDF5 version: 1.10.0" .....

wsanders avatar May 27 '17 00:05 wsanders

Having the same problem on OS X, no idea how to fix it yet

philipgher avatar Sep 29 '17 15:09 philipgher

Having the same problem on OSX too...

allenleexyz avatar Oct 22 '17 07:10 allenleexyz

I have created a fork (https://github.com/sharpie7/torch-rnn), and a pull request #215 which should help with this on Ubuntu 17.04. It may also work for OSX.

sharpie7 avatar Dec 03 '17 14:12 sharpie7