dynamicio icon indicating copy to clipboard operation
dynamicio copied to clipboard

bug: make-dev-env fails unless hdf5 is present on machine

Open KitBurgess opened this issue 2 years ago • 1 comments

Describe the bug Similar to #10 .

The pytables installation https://github.com/PyTables/PyTables#installation requires for hdf5 to be installed (and maybe a path variable set) before pytables can be installed. https://github.com/PyTables/PyTables

To Reproduce

➜  dynamicio git:(master) make dev-env-setup
Creating DEV virtual environment...
Installing requirements...
Requirement already satisfied: pip in ./venv/lib/python3.8/site-packages (22.1.2)
Collecting awscli>=1.22.24
  Using cached awscli-1.25.15-py3-none-any.whl (3.9 MB)
Collecting boto3>=1.20.24
  Using cached boto3-1.24.15-py3-none-any.whl (132 kB)
Collecting fastparquet==0.8.0
  Using cached fastparquet-0.8.0-cp38-cp38-macosx_11_0_arm64.whl (598 kB)
Collecting fsspec==2022.3.0
  Using cached fsspec-2022.3.0-py3-none-any.whl (136 kB)
Collecting kafka-python~=2.0.2
  Using cached kafka_python-2.0.2-py2.py3-none-any.whl (246 kB)
Collecting logzero>=1.7.0
  Using cached logzero-1.7.0-py2.py3-none-any.whl (16 kB)
Collecting magic-logger>=1.0.2
  Using cached magic_logger-1.0.2.tar.gz (3.2 kB)
  Preparing metadata (setup.py) ... done
Collecting pandas>=1.2.4
  Using cached pandas-1.4.3-cp38-cp38-macosx_11_0_arm64.whl (10.3 MB)
Collecting psycopg2-binary~=2.9.3
  Using cached psycopg2-binary-2.9.3.tar.gz (380 kB)
  Preparing metadata (setup.py) ... done
Collecting pyarrow==8.0.0
  Using cached pyarrow-8.0.0-cp38-cp38-macosx_11_0_arm64.whl (16.2 MB)
Collecting python-json-logger~=2.0.1
  Using cached python_json_logger-2.0.2-py3-none-any.whl (7.4 kB)
Collecting PyYAML~=5.4.1
  Using cached PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting s3fs==0.4.2
  Using cached s3fs-0.4.2-py3-none-any.whl (19 kB)
Collecting simplejson~=3.17.2
  Using cached simplejson-3.17.6-cp38-cp38-macosx_11_0_arm64.whl (73 kB)
Collecting SQLAlchemy>=1.4.11
  Using cached SQLAlchemy-1.4.38.tar.gz (8.2 MB)
  Preparing metadata (setup.py) ... done
Collecting tables~=3.7.0
  Using cached tables-3.7.0.tar.gz (8.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      /var/folders/xm/q2trq80j1n399bdtq5yg2jk80000gn/T/H5closetommbfn_.c:2:5: error: implicit declaration of function 'H5close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          H5close();
          ^
      1 error generated.
      cpuinfo failed, assuming no CPU features: No module named 'cpuinfo'
      * Using Python 3.8.13 (default, Jun 23 2022, 20:46:48)
      * Found cython 0.29.30
      * USE_PKGCONFIG: True
      .. ERROR:: Could not find a local HDF5 installation.
         You may need to explicitly state where your local HDF5 headers and
         library can be found by setting the ``HDF5_DIR`` environment
         variable or by using the ``--hdf5`` command-line option.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
make: *** [dev-env-setup] Error 1

KitBurgess avatar Jun 23 '22 20:06 KitBurgess

Feels like a sneaky hack but this solution worked for me, as guided by this article:

find where your headers are:

➜  dynamicio git:(master) h5cc -show
clang -I/opt/homebrew/opt/libaec/include -L/opt/homebrew/Cellar/hdf5/1.12.2/lib /opt/homebrew/Cellar/hdf5/1.12.2/lib/libhdf5_hl.a /opt/homebrew/Cellar/hdf5/1.12.2/lib/libhdf5.a -L/opt/homebrew/opt/libaec/lib -lsz -lz -ldl -lm

set the headers:

➜  dynamicio git:(master) export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.2/

The above hack was inspired by this article: https://itensor.org/docs.cgi?vers=cppv3&page=install/install_with_hdf5

KitBurgess avatar Jun 23 '22 20:06 KitBurgess