nmslib / hnswlib

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

amazon linux x86_64 clang: /usr/bin/ld: cannot find -lomp #506

Closed tekumara closed 1 year ago

tekumara commented 1 year ago

On Amazon Linux 2:

$ pip install hnswlib
....
      clang++ -pthread -shared -L/tools/deps/lib -Wl,--exclude-libs,ALL -L/tools/deps/libedit/lib build/temp.linux-x86_64-cpython-310/./python_bindings/bindings.o -L/install/lib -o build/lib.linux-x86_64-cpython-310/hnswlib.cpython-310-x86_64-linux-gnu.so -fopenmp -pthread
      /usr/bin/ld: cannot find -lomp
      clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
      error: command '/usr/bin/clang++' failed with exit code 1
tekumara commented 1 year ago

I can't find libomp for clang/llvm in the Amazon Linux 2 repositories, but it does have libgomp for gcc, so I've switched to using gcc, eg:

sudo yum install -y gcc-c++
export CC=gcc
export CXX=c++