Fix build CI failure on MacOS#1685
Conversation
9cd8cc7 to
fe91a0f
Compare
|
Currently k-NN native libraries can completely make build in |
.github/workflows/CI.yml
Outdated
| sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp | ||
| sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc | ||
| sed -i -e 's/-march=native/-mcpu=apple-m1/g' external/nmslib/similarity_search/CMakeLists.txt | ||
| sed -i -e 's/-mcpu=apple-a14/-mcpu=apple-m1/g' external/nmslib/python_bindings/setup.py |
There was a problem hiding this comment.
we dont use python bindings so this should be unnecessary.
.github/workflows/CI.yml
Outdated
| sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc | ||
| sed -i -e 's/-march=native/-mcpu=apple-m1/g' external/nmslib/similarity_search/CMakeLists.txt | ||
| sed -i -e 's/-mcpu=apple-a14/-mcpu=apple-m1/g' external/nmslib/python_bindings/setup.py | ||
| if sysctl -n machdep.cpu.features | grep -i AVX2; |
There was a problem hiding this comment.
We dont need this if runner is arm
.github/workflows/CI.yml
Outdated
| export CC=/opt/homebrew/opt/llvm/bin/clang | ||
| export CXX=/opt/homebrew/opt/llvm/bin/clang++ | ||
| cd jni | ||
| sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake |
There was a problem hiding this comment.
Can we just add this check in cmake?
.github/workflows/CI.yml
Outdated
| export CXX=/opt/homebrew/opt/llvm/bin/clang++ | ||
| cd jni | ||
| sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake | ||
| sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp |
There was a problem hiding this comment.
This should be possible to avoid. In faiss, I think they are building it without patches: facebookresearch/faiss#3411.
.github/workflows/CI.yml
Outdated
| cd jni | ||
| sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake | ||
| sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp | ||
| sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc |
There was a problem hiding this comment.
why do we need to switch the WARN message?
.github/workflows/CI.yml
Outdated
| sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake | ||
| sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp | ||
| sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc | ||
| sed -i -e 's/-march=native/-mcpu=apple-m1/g' external/nmslib/similarity_search/CMakeLists.txt |
There was a problem hiding this comment.
I think that native should be fine. We shouldnt need this
|
Thank @jmazanec15 for comments. For the arm setup, I followed steps from k-NN developer guide doc. But currently the it has another new error happened during k-NN run time in integ test when we use the |
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
|
After we just changed the label to use |
.github/workflows/CI.yml
Outdated
| brew reinstall gcc | ||
| export FC=/usr/local/Cellar/gcc/12.2.0/bin/gfortran | ||
| brew install llvm | ||
| brew install openblas |
There was a problem hiding this comment.
I saw this message in logs:
2024-05-03T00:54:26.3237060Z openblas is keg-only, which means it was not symlinked into /opt/homebrew,
2024-05-03T00:54:26.3237780Z because macOS provides BLAS in Accelerate.framework.
Can we skip this?
| - name: Build native libraries | ||
| run: | | ||
| git submodule update --init --recursive | ||
| brew reinstall gcc |
There was a problem hiding this comment.
If we're using clang, I dont think we need gcc
Signed-off-by: Junqiu Lei <junqiu@amazon.com> (cherry picked from commit 73d5425)
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
Description
Fix build CI failure for MacOS. The github CI runner for
macos-latestchanged to use ARM platform recently, updating to usemacos-12with x86_64 architecture to pass the CI.Issues Resolved
#1660
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.