-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Pull Request resolved: #2857 Reviewed By: alexanderguzhva Differential Revision: D45791625 Pulled By: algoriddle fbshipit-source-id: 52ec30f0ec66812f60a08843947aabe8be876afa
- Loading branch information
1 parent
eea4a48
commit f809cf0
Showing
4 changed files
with
80 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -e | ||
|
||
|
||
# Build libfaiss.so/libfaiss_avx2.so. | ||
cmake -B _build \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DBUILD_TESTING=OFF \ | ||
-DFAISS_OPT_LEVEL=avx2 \ | ||
-DFAISS_ENABLE_GPU=OFF \ | ||
-DFAISS_ENABLE_PYTHON=OFF \ | ||
-DBLA_VENDOR=Intel10_64lp \ | ||
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \ | ||
-DOpenMP_CXX_LIB_NAMES=libiomp5 \ | ||
-DOpenMP_libiomp5_LIBRARY=$PREFIX/lib/libiomp5.dylib \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DCMAKE_BUILD_TYPE=Release . | ||
|
||
make -C _build -j$(nproc) faiss faiss_avx2 | ||
|
||
cmake --install _build --prefix $PREFIX | ||
cmake --install _build --prefix _libfaiss_stage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -e | ||
|
||
|
||
# Build swigfaiss.so/swigfaiss_avx2.so. | ||
cmake -B _build_python_${PY_VER} \ | ||
-Dfaiss_ROOT=_libfaiss_stage/ \ | ||
-DFAISS_OPT_LEVEL=avx2 \ | ||
-DFAISS_ENABLE_GPU=OFF \ | ||
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \ | ||
-DOpenMP_CXX_LIB_NAMES=libiomp5 \ | ||
-DOpenMP_libiomp5_LIBRARY=$PREFIX/lib/libiomp5.dylib \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DPython_EXECUTABLE=$PYTHON \ | ||
faiss/python | ||
|
||
make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 | ||
|
||
# Build actual python module. | ||
cd _build_python_${PY_VER}/ | ||
$PYTHON setup.py install --single-version-externally-managed --record=record.txt --prefix=$PREFIX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters