nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.12k stars 609 forks source link

Resolve wheel build failure on x86_64 architecture due to -march=native flag #451

Closed XiChenn closed 1 year ago

XiChenn commented 1 year ago

The hnswlib wheel build failed on my MacOS (x86_64 architecture) when I run pip install hnswlib.

      clang: error: the clang compiler does not support '-march=native'
      error: command '/usr/bin/gcc' 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 hnswlib
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects

Similar to the solution of the previous merged PR, by removing the building flag resolves the issue.

pip install .
Looking in indexes: https://pypi.python.org/simple/
...
Successfully built hnswlib
Installing collected packages: hnswlib
Successfully installed hnswlib-0.7.0