Skip to content

Commit

Permalink
bazel: added bazel build support to reuse DiskANN lib in external pro…
Browse files Browse the repository at this point in the history
…jects
  • Loading branch information
msftstepanov committed Dec 9, 2024
1 parent e6afdbb commit 09f79f4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build --client_env=CC=g++
build --client_env=CXX=g++
build --client_env=BAZEL_CXXOPTS=-std=c++17
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,7 @@ gperftools

# Rust
rust/target

# bazel
bazel-*
MODULE.bazel*
18 changes: 18 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# BUILD

cc_library(
name = "diskann_library",
srcs = glob(["src/*.cpp"]),
hdrs = glob(["include/*.h", "include/tsl/*.h"]),
includes = ["include", "include/tsl"],
copts = [
"-ltcmalloc", "-Ofast", "-march=native", "-mtune=native",
"-I/usr/include/mkl", "-m64", "-Wl,--no-as-needed",
"-DMKL_ILP64", "-DNDEBUG", "-DUSE_AVX2",
"-mavx2", "-mfma", "-msse2",
"-ftree-vectorize", "-fno-builtin-malloc", "-fno-builtin-calloc", "-fno-builtin-realloc",
"-fno-builtin-free", "-fopenmp", "-fopenmp-simd",
"-funroll-loops", '-Wfatal-errors'
],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace(name = "microsoft_DiskANN")

0 comments on commit 09f79f4

Please sign in to comment.