fhs / pyhdf

Python wrapper around the NCSA HDF version 4 library

Home Page:https://pypi.org/project/pyhdf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyhdf/hdfext_wrap.c:3543:17: fatal error: hdf.h: No such file or directory #include "hdf.h"

upuil opened this issue · comments

This problem is same as #7 and when I build the source code is same problem.

[root@bogon python-hdf4-0.9.1]# pip install python-hdf4
Collecting python-hdf4
Using cached https://files.pythonhosted.org/packages/02/07/15a5e258e48a7d252c0efee187ddc4322a8bc8969c65b400aeda1fda2843/python-hdf4-0.9.1.tar.gz
Building wheels for collected packages: python-hdf4
Running setup.py bdist_wheel for python-hdf4 ... error
Complete output from command /opt/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-uvbe00sl/python-hdf4/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-9vsawgde --python-tag cp36:
running bdist_wheel
running build
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
build_src
building extension "pyhdf._hdfext" sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/init.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/VS.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/six.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/test_SD.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/SD.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/HC.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/hdfext.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/V.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/error.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/HDF.py -> build/lib.linux-x86_64-3.6/pyhdf
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'pyhdf._hdfext' extension
compiling C sources
C compiler: gcc -pthread -B /opt/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC

creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/pyhdf
compile options: '-I/opt/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/opt/anaconda3/include/python3.6m -c'
extra options: '-DNOSZIP'
gcc: pyhdf/hdfext_wrap.c
pyhdf/hdfext_wrap.c:3543:17: fatal error: hdf.h: No such file or directory
#include "hdf.h"
^
compilation terminated.
pyhdf/hdfext_wrap.c:3543:17: fatal error: hdf.h: No such file or directory
#include "hdf.h"
^
compilation terminated.
error: Command "gcc -pthread -B /opt/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/opt/anaconda3/include/python3.6m -c pyhdf/hdfext_wrap.c -o build/temp.linux-x86_64-3.6/pyhdf/hdfext_wrap.o -MMD -MF build/temp.linux-x86_64-3.6/pyhdf/hdfext_wrap.o.d -DNOSZIP" failed with exit status 1


Failed building wheel for python-hdf4
Running setup.py clean for python-hdf4
Failed to build python-hdf4
Installing collected packages: python-hdf4
Running setup.py install for python-hdf4 ... error
Complete output from command /opt/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-uvbe00sl/python-hdf4/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-record-tjnm5o0i/install-record.txt --single-version-externally-managed --compile:
running install
running build
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
build_src
building extension "pyhdf._hdfext" sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/init.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/VS.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/six.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/test_SD.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/SD.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/HC.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/hdfext.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/V.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/error.py -> build/lib.linux-x86_64-3.6/pyhdf
copying pyhdf/HDF.py -> build/lib.linux-x86_64-3.6/pyhdf
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'pyhdf._hdfext' extension
compiling C sources
C compiler: gcc -pthread -B /opt/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC

creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/pyhdf
compile options: '-I/opt/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/opt/anaconda3/include/python3.6m -c'
extra options: '-DNOSZIP'
gcc: pyhdf/hdfext_wrap.c
pyhdf/hdfext_wrap.c:3543:17: fatal error: hdf.h: No such file or directory
 #include "hdf.h"
                 ^
compilation terminated.
pyhdf/hdfext_wrap.c:3543:17: fatal error: hdf.h: No such file or directory
 #include "hdf.h"
                 ^
compilation terminated.
error: Command "gcc -pthread -B /opt/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/opt/anaconda3/include/python3.6m -c pyhdf/hdfext_wrap.c -o build/temp.linux-x86_64-3.6/pyhdf/hdfext_wrap.o -MMD -MF build/temp.linux-x86_64-3.6/pyhdf/hdfext_wrap.o.d -DNOSZIP" failed with exit status 1

----------------------------------------

Command "/opt/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-uvbe00sl/python-hdf4/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-record-tjnm5o0i/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-uvbe00sl/python-hdf4/

Where do you have hdf4 installed? Where are the include (.h) files and .so files? What linux distro are you using? Did you manually install hdf4 or using a distro package?

All of these installation problems could be easily solved (at least on Linux) if hdf4 was using pkg-config, but it looks like it doesn't. 😩

I get this error message:

pyhdf/hdfext_wrap.c:3681:10: fatal error: 'hdf.h' file not found