From ecfa2c993ae667257d95888712c84a443d92a29f Mon Sep 17 00:00:00 2001 From: Kosuke Morimoto Date: Fri, 22 Mar 2024 15:17:20 +0900 Subject: [PATCH] add extra flags for NGT build phase --- Makefile | 5 ++++- dockers/agent/core/ngt/Dockerfile | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3af9c87a17..5641df39e0 100644 --- a/Makefile +++ b/Makefile @@ -138,14 +138,17 @@ ifeq ($(GOARCH),amd64) CFLAGS ?= -mno-avx512f -mno-avx512dq -mno-avx512cd -mno-avx512bw -mno-avx512vl CXXFLAGS ?= $(CFLAGS) EXTLDFLAGS ?= -m64 +NGT_EXTRA_FLAGS ?= else ifeq ($(GOARCH),arm64) CFLAGS ?= CXXFLAGS ?= $(CFLAGS) EXTLDFLAGS ?= -march=armv8-a +NGT_EXTRA_FLAGS ?= else CFLAGS ?= CXXFLAGS ?= $(CFLAGS) EXTLDFLAGS ?= +NGT_EXTRA_FLAGS ?= endif BENCH_DATASET_MD5S := $(eval BENCH_DATASET_MD5S := $(shell find $(BENCH_DATASET_MD5_DIR) -type f -regex ".*\.md5"))$(BENCH_DATASET_MD5S) @@ -571,7 +574,7 @@ ngt/install: /usr/local/include/NGT/Capi.h /usr/local/include/NGT/Capi.h: git clone --depth 1 --branch v$(NGT_VERSION) https://github.com/yahoojapan/NGT $(TEMP_DIR)/NGT-$(NGT_VERSION) cd $(TEMP_DIR)/NGT-$(NGT_VERSION) && \ - cmake -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" . + cmake -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" "$(NGT_EXTRA_FLAGS)" . make -j -C $(TEMP_DIR)/NGT-$(NGT_VERSION) make install -C $(TEMP_DIR)/NGT-$(NGT_VERSION) cd $(ROOTDIR) diff --git a/dockers/agent/core/ngt/Dockerfile b/dockers/agent/core/ngt/Dockerfile index ecc852f2f2..bc840f6239 100644 --- a/dockers/agent/core/ngt/Dockerfile +++ b/dockers/agent/core/ngt/Dockerfile @@ -37,6 +37,7 @@ ENV REPO vald ENV PKG agent/core/ngt ENV PKG_INTERNAL agent/internal ENV APP_NAME ngt +ENV NGT_EXTRA_FLAGS -DNGT_BFLOAT_DISABLED=true # skipcq: DOK-DL3008 RUN apt-get update && apt-get install -y --no-install-recommends \