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

Problem Installing on CentOS

AndresMiguelReyes opened this issue · comments

I made sure to export the include and library dirs:

export INCLUDE_DIRS=/home/areyes/deps/hdf-4.2.12/include
export LIBRARY_DIRS=/home/areyes/deps/hdf-4.2.12/lib:/home/areyes/deps/jpeg-6b/lib:/home/areyes/deps/zlib-1.2.11/lib

After Installing numpy 1.14.3 in a python 3.5 venv I tried to install with "pip install python-hdf4==0.9.1" and got the following error:

Collecting python-hdf4==0.9.1
Using cached https://files.pythonhosted.org/packages/02/07/15a5e258e48a7d252c0efee187ddc4322a8bc8969c65b400aeda1fda2843/python-hdf4-0.9.1.tar.gz
Installing collected packages: python-hdf4
Running setup.py install for python-hdf4 ... error
Complete output from command /home/areyes/venv/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-ara46m7k/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-r5ue5c78/install-record.txt --single-version-externally-managed --compile --install-headers /home/areyes/venv/include/site/python3.5/python-hdf4:
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.5
creating build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/hdfext.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/V.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/VS.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/six.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/init.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/SD.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/test_SD.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/HC.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/HDF.py -> build/lib.linux-x86_64-3.5/pyhdf
copying pyhdf/error.py -> build/lib.linux-x86_64-3.5/pyhdf
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'pyhdf._hdfext' extension
compiling C sources
C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC

creating build/temp.linux-x86_64-3.5/pyhdf
compile options: '-I/home/areyes/deps/hdf-4.2.12/include -I/home/areyes/venv/lib/python3.5/site-packages/numpy/core/include -I/home/areyes/venv/include -I/opt/python/include/python3.5m -c'
extra options: '-DNOSZIP'
gcc: pyhdf/hdfext_wrap.c
In file included from /opt/python/include/python3.5m/Python.h:53,
                 from pyhdf/hdfext_wrap.c:130:
/opt/python/include/python3.5m/pyatomic.h:12:23: warning: stdatomic.h: No such file or directory
In file included from /opt/python/include/python3.5m/Python.h:53,
                 from pyhdf/hdfext_wrap.c:130:
/opt/python/include/python3.5m/pyatomic.h:27: error: ‘memory_order_relaxed’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:28: error: ‘memory_order_acquire’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:29: error: ‘memory_order_release’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:30: error: ‘memory_order_acq_rel’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:31: error: ‘memory_order_seq_cst’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:35: error: expected specifier-qualifier-list before ‘_Atomic’
/opt/python/include/python3.5m/pyatomic.h:39: error: expected specifier-qualifier-list before ‘atomic_int’
In file included from pyhdf/hdfext_wrap.c:3544:
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:237: warning: function declaration isn’t a prototype
In file included from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816,
                 from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/oldnumeric.h:1,
                 from pyhdf/hdfext_wrap.c:3680:
/home/areyes/venv/lib/python3.5/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"
pyhdf/hdfext_wrap.c: In function ‘_SDgetcompress’:
pyhdf/hdfext_wrap.c:3947: warning: passing argument 2 of ‘SDgetcompress’ from incompatible pointer type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:185: note: expected ‘enum comp_coder_t *’ but argument is of type ‘int32 *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDcreate’:
pyhdf/hdfext_wrap.c:5849: warning: passing argument 5 of ‘SDcreate’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:103: note: expected ‘int32 *’ but argument is of type ‘const int *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDsetdimscale’:
pyhdf/hdfext_wrap.c:6393: warning: passing argument 4 of ‘SDsetdimscale’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:158: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDsetfillvalue’:
pyhdf/hdfext_wrap.c:7069: warning: passing argument 2 of ‘SDsetfillvalue’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:139: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDsetrange’:
pyhdf/hdfext_wrap.c:7105: warning: passing argument 2 of ‘SDsetrange’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:115: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c:7105: warning: passing argument 3 of ‘SDsetrange’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:115: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_VSsizeof’:
pyhdf/hdfext_wrap.c:8020: warning: passing argument 2 of ‘VSsizeof’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/hproto.h:1643: note: expected ‘char *’ but argument is of type ‘const char *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_VSfexist’:
pyhdf/hdfext_wrap.c:8468: warning: passing argument 2 of ‘VSfexist’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/hproto.h:1640: note: expected ‘char *’ but argument is of type ‘const char *’
At top level:
cc1: warning: unrecognized command line option "-Wno-unused-result"
In file included from /opt/python/include/python3.5m/Python.h:53,
                 from pyhdf/hdfext_wrap.c:130:
/opt/python/include/python3.5m/pyatomic.h:12:23: warning: stdatomic.h: No such file or directory
In file included from /opt/python/include/python3.5m/Python.h:53,
                 from pyhdf/hdfext_wrap.c:130:
/opt/python/include/python3.5m/pyatomic.h:27: error: ‘memory_order_relaxed’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:28: error: ‘memory_order_acquire’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:29: error: ‘memory_order_release’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:30: error: ‘memory_order_acq_rel’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:31: error: ‘memory_order_seq_cst’ undeclared here (not in a function)
/opt/python/include/python3.5m/pyatomic.h:35: error: expected specifier-qualifier-list before ‘_Atomic’
/opt/python/include/python3.5m/pyatomic.h:39: error: expected specifier-qualifier-list before ‘atomic_int’
In file included from pyhdf/hdfext_wrap.c:3544:
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:237: warning: function declaration isn’t a prototype
In file included from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816,
                 from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from /home/areyes/venv/lib/python3.5/site-packages/numpy/core/include/numpy/oldnumeric.h:1,
                 from pyhdf/hdfext_wrap.c:3680:
/home/areyes/venv/lib/python3.5/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"
pyhdf/hdfext_wrap.c: In function ‘_SDgetcompress’:
pyhdf/hdfext_wrap.c:3947: warning: passing argument 2 of ‘SDgetcompress’ from incompatible pointer type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:185: note: expected ‘enum comp_coder_t *’ but argument is of type ‘int32 *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDcreate’:
pyhdf/hdfext_wrap.c:5849: warning: passing argument 5 of ‘SDcreate’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:103: note: expected ‘int32 *’ but argument is of type ‘const int *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDsetdimscale’:
pyhdf/hdfext_wrap.c:6393: warning: passing argument 4 of ‘SDsetdimscale’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:158: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDsetfillvalue’:
pyhdf/hdfext_wrap.c:7069: warning: passing argument 2 of ‘SDsetfillvalue’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:139: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_SDsetrange’:
pyhdf/hdfext_wrap.c:7105: warning: passing argument 2 of ‘SDsetrange’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:115: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c:7105: warning: passing argument 3 of ‘SDsetrange’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/mfhdf.h:115: note: expected ‘void *’ but argument is of type ‘const void *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_VSsizeof’:
pyhdf/hdfext_wrap.c:8020: warning: passing argument 2 of ‘VSsizeof’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/hproto.h:1643: note: expected ‘char *’ but argument is of type ‘const char *’
pyhdf/hdfext_wrap.c: In function ‘_wrap_VSfexist’:
pyhdf/hdfext_wrap.c:8468: warning: passing argument 2 of ‘VSfexist’ discards qualifiers from pointer target type
/home/areyes/deps/hdf-4.2.12/include/hproto.h:1640: note: expected ‘char *’ but argument is of type ‘const char *’
At top level:
cc1: warning: unrecognized command line option "-Wno-unused-result"
error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/areyes/deps/hdf-4.2.12/include -I/home/areyes/venv/lib/python3.5/site-packages/numpy/core/include -I/home/areyes/venv/include -I/opt/python/include/python3.5m -c pyhdf/hdfext_wrap.c -o build/temp.linux-x86_64-3.5/pyhdf/hdfext_wrap.o -MMD -MF build/temp.linux-x86_64-3.5/pyhdf/hdfext_wrap.o.d -DNOSZIP" failed with exit status 1

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

Command "/home/areyes/venv/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-ara46m7k/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-r5ue5c78/install-record.txt --single-version-externally-managed --compile --install-headers /home/areyes/venv/include/site/python3.5/python-hdf4" failed with error code 1 in /tmp/pip-install-ara46m7k/python-hdf4/

I don't think this issue is a duplicate of #16 because I do not see any lines like

/usr/bin/ld: cannot find -lmfhdf
I've tested this on my Macbook running High Sierra and it works.

This is the error:

/opt/python/include/python3.5m/pyatomic.h:12:23: warning: stdatomic.h: No such file or directory
In file included from /opt/python/include/python3.5m/Python.h:53,
                 from pyhdf/hdfext_wrap.c:130:
/opt/python/include/python3.5m/pyatomic.h:27: error: ‘memory_order_relaxed’ undeclared here (not in a function)

I think something is messed up with your python installation. Maybe you compiled python on a system with stdatomic.h and then you're using it on another system that doesn't have stdatomic.h?

I don't think the issue is with python-hdf4.