xbrianh / xbgzip

Fast streams for block gzip files.
MIT License
6 stars 2 forks source link

problem installing on a Mac M2 #8

Open hendersi opened 10 months ago

hendersi commented 10 months ago

Hi - I get the following error when trying to install on a MacBook Pro M2 running Ventura 13.4 OS. Do you have any suggestions to fix? Many thanks! Ian

(base) irh25@dps304irh25m panagram % pip install bgzip
Collecting bgzip Using cached bgzip-0.4.0.tar.gz (62 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: bgzip Building wheel for bgzip (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [18 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.macosx-11.0-arm64-cpython-310 creating build/lib.macosx-11.0-arm64-cpython-310/bgzip copying bgzip/version.py -> build/lib.macosx-11.0-arm64-cpython-310/bgzip copying bgzip/init.py -> build/lib.macosx-11.0-arm64-cpython-310/bgzip running build_ext building 'bgzip.bgzip_utils' extension creating build/temp.macosx-11.0-arm64-cpython-310 creating build/temp.macosx-11.0-arm64-cpython-310/bgzip_utils clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/irh25/mambaforge/include -arch arm64 -fPIC -O2 -isystem /Users/irh25/mambaforge/include -arch arm64 -I/opt/homebrew/opt/llvm/include -I/Users/irh25/mambaforge/include/python3.10 -c bgzip_utils/bgzip_utils.c -o build/temp.macosx-11.0-arm64-cpython-310/bgzip_utils/bgzip_utils.o -O3 -Xpreprocessor -fopenmp bgzip_utils/bgzip_utils.c:615:10: fatal error: 'omp.h' file not found

include

           ^~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for bgzip Running setup.py clean for bgzip Failed to build bgzip ERROR: Could not build wheels for bgzip, which is required to install pyproject.toml-based projects (base) irh25@dps304irh25m panagram %

xbrianh commented 4 weeks ago

Hi @hendersi

Have you tried installing openmp with homebrew?:

brew install llvm

The output of the above command should contain instructions about setting compiler flags, something that looks like this:

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"