Skip to content

Commit

Permalink
Add TEST_LDFLAGS (#2829) (#2830)
Browse files Browse the repository at this point in the history
* ♻️ Add Link opts for HDF Flg



* ♻️ Add TEST_FLAGS



---------

Signed-off-by: vankichi <[email protected]>
Co-authored-by: Kiichiro YUKAWA <[email protected]>
  • Loading branch information
vdaas-ci and vankichi authored Feb 4, 2025
1 parent 39ed0f2 commit 8c1eef0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 30 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ NGT_LDFLAGS = -fopenmp -lopenblas -llapack
FAISS_LDFLAGS = $(NGT_LDFLAGS) -lgfortran
HDF5_LDFLAGS = -lhdf5 -lhdf5_hl -lsz -laec -lz -ldl
CGO_LDFLAGS = $(FAISS_LDFLAGS) $(HDF5_LDFLAGS)
TEST_LDFLAGS = $(LDFLAGS) $(FAISS_LDFLAGS) $(HDF5_LDFLAGS)

ifeq ($(GOARCH),amd64)
CFLAGS ?= -mno-avx512f -mno-avx512dq -mno-avx512cd -mno-avx512bw -mno-avx512vl
Expand Down
12 changes: 6 additions & 6 deletions Makefile.d/bench.mk
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pprof/core/ngt/sequential.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand All @@ -155,7 +155,7 @@ pprof/core/ngt/parallel.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand Down Expand Up @@ -187,7 +187,7 @@ pprof/agent/stream.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand All @@ -213,7 +213,7 @@ pprof/agent/sequential/grpc.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand Down Expand Up @@ -244,7 +244,7 @@ pprof/gateway/sequential.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand Down Expand Up @@ -293,7 +293,7 @@ $(ROOTDIR)/metrics.gob:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -mod=readonly -v --timeout=1h $(ROOTDIR)/hack/benchmark/e2e/agent/core/ngt/... -output=$(ROOTDIR)/metrics.gob

.PHONY: metrics/chart
Expand Down
10 changes: 5 additions & 5 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ define run-e2e-crud-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(HDF5_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand Down Expand Up @@ -174,7 +174,7 @@ define run-e2e-crud-faiss-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(HDF5_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand All @@ -200,7 +200,7 @@ define run-e2e-multi-crud-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(HDF5_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand Down Expand Up @@ -230,7 +230,7 @@ define run-e2e-max-dim-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(HDF5_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand All @@ -252,7 +252,7 @@ define run-e2e-sidecar-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(HDF5_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand Down
38 changes: 19 additions & 19 deletions Makefile.d/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... $(ROOTDIR)/internal/... $(ROOTDIR)/pkg/...

.PHONY: test/tparse
Expand All @@ -57,7 +57,7 @@ test/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... $(ROOTDIR)/internal/... $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -71,7 +71,7 @@ test/cmd/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -85,7 +85,7 @@ test/internal/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/internal/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -99,7 +99,7 @@ test/pkg/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -115,7 +115,7 @@ test/hack/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=vendor -json -cover \
$(ROOTDIR)/hack/gorules/... \
$(ROOTDIR)/hack/helm/... \
Expand All @@ -134,7 +134,7 @@ test/all/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -148,7 +148,7 @@ test/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... $(ROOTDIR)/internal/... $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -162,7 +162,7 @@ test/cmd/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -176,7 +176,7 @@ test/internal/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/internal/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -190,7 +190,7 @@ test/pkg/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -206,7 +206,7 @@ test/hack/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=vendor -json -cover \
$(ROOTDIR)/hack/gorules/... \
$(ROOTDIR)/hack/helm/... \
Expand All @@ -225,7 +225,7 @@ test/all/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand Down Expand Up @@ -263,7 +263,7 @@ test/pkg:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/pkg/...

.PHONY: test/internal
Expand All @@ -272,7 +272,7 @@ test/internal:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/internal/...

.PHONY: test/cmd
Expand All @@ -281,7 +281,7 @@ test/cmd:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/cmd/...

.PHONY: test/rust/qbg
Expand All @@ -302,7 +302,7 @@ test/hack:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=vendor -cover \
$(ROOTDIR)/hack/gorules... \
$(ROOTDIR)/hack/helm/... \
Expand All @@ -316,7 +316,7 @@ test/all:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/...

.PHONY: coverage
Expand All @@ -325,7 +325,7 @@ coverage:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
CGO_LDFLAGS="$(TEST_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -v -race -covermode=atomic -timeout=$(GOTEST_TIMEOUT) -coverprofile=coverage.out $(ROOTDIR)/...
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
Expand Down

0 comments on commit 8c1eef0

Please sign in to comment.