Skip to content

Commit d25be3d

Browse files
Autodetect target OS and target Arch
Signed-off-by: Julien Barbot <[email protected]>
1 parent 6f5e1bc commit d25be3d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ $(foreach bin,$(REQUIRED_BINS),\
2525

2626
ifeq ($(TARGET_OS), linux)
2727
LIB_ENV_VAR = LD_LIBRARY_PATH
28+
SEARCH_LIB = libllama_go.so
2829
else
2930
LIB_ENV_VAR = DYLD_LIBRARY_PATH
31+
SEARCH_LIB = libllama_go.dylib
3032
endif
3133

3234
.PHONY: default all build_release build setup clean setup \
@@ -71,7 +73,7 @@ search-release-$(SEARCH_VERSION)/README.md: download_models_for_semrouter
7173

7274
build_search_lib search-release-$(SEARCH_VERSION)/build/lib/$(SEARCH_LIB): search-release-$(SEARCH_VERSION)/README.md
7375
-mkdir -p "search-release-$(SEARCH_VERSION)/build"
74-
cd "search-release-$(SEARCH_VERSION)/build" && cmake -DCMAKE_BUILD_TYPE=Release ..
76+
cd "search-release-$(SEARCH_VERSION)/build" && cmake -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=Release ..
7577
cd "search-release-$(SEARCH_VERSION)/build" && cmake --build . --config Release
7678

7779
tyk-release-$(TYK_VERSION)/$(SEARCH_LIB): search-release-$(SEARCH_VERSION)/build/lib/$(SEARCH_LIB)
@@ -91,7 +93,7 @@ start_redis: deploy/docker-compose.yaml
9193

9294
build_plugin plugins/$(FULL_PLUGIN_NAME).so: plugins/*.go plugins/go.mod tyk-release-$(TYK_VERSION)/go.mod
9395
cd plugins && go mod tidy -go=$$(go mod edit -json ../tyk-release-$(TYK_VERSION)/go.mod | jq -r .Go)
94-
GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) go build -C plugins -trimpath -buildmode=plugin -o $(FULL_PLUGIN_NAME).so .
96+
CGO_ENABLED='1' GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) go build -C plugins -trimpath -buildmode=plugin -o $(FULL_PLUGIN_NAME).so .
9597

9698
install_plugin tyk-release-$(TYK_VERSION)/middleware/agent-bridge-plugin.so: plugins/$(FULL_PLUGIN_NAME).so
9799
cp plugins/$(FULL_PLUGIN_NAME).so ./tyk-release-$(TYK_VERSION)/middleware/agent-bridge-plugin.so

0 commit comments

Comments
 (0)