Skip to content

Commit 01f63e2

Browse files
ankanechenrui333
authored andcommitted
faiss 1.6.1 (new formula)
Added missing dependency Closes #49235. Signed-off-by: Rui Chen <chenrui333@gmail.com>
1 parent 4984154 commit 01f63e2

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Formula/faiss.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
class Faiss < Formula
2+
desc "Efficient similarity search and clustering of dense vectors"
3+
homepage "https://github.com/facebookresearch/faiss"
4+
url "https://github.com/facebookresearch/faiss/archive/v1.6.1.tar.gz"
5+
sha256 "827437c9a684fcb88ee21a8fd8f0ecd94f36e2db213f74357d0465c5a7e72ac6"
6+
7+
depends_on "libomp"
8+
9+
def install
10+
system "./configure", "--without-cuda",
11+
"--prefix=#{prefix}"
12+
system "make"
13+
system "make", "install"
14+
end
15+
16+
test do
17+
(testpath/"test.cpp").write <<~EOS
18+
#include <faiss/IndexFlat.h>
19+
20+
int main()
21+
{
22+
faiss::IndexFlatL2 index(64);
23+
return 0;
24+
}
25+
EOS
26+
system ENV.cxx, "-std=c++11", "-L#{lib}", "-lfaiss", "test.cpp", "-o", "test"
27+
system "./test"
28+
end
29+
end

0 commit comments

Comments
 (0)