Skip to content

Commit d829fd5

Browse files
authored
Makefile fixes for MacOS (#304)
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent 085c6b6 commit d829fd5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ EPP_TAG ?= dev
1313
IMG = $(IMAGE_TAG_BASE):$(EPP_TAG)
1414
NAMESPACE ?= hc4ai-operator
1515

16+
ifeq ($(TARGETOS),darwin)
17+
ifeq ($(TARGETARCH),amd64)
18+
TOKENIZER_ARCH = x86_64
19+
else
20+
TOKENIZER_ARCH = $(TARGETARCH)
21+
endif
22+
else
23+
TOKENIZER_ARCH = $(TARGETARCH)
24+
endif
25+
1626
CONTAINER_TOOL := $(shell { command -v docker >/dev/null 2>&1 && echo docker; } || { command -v podman >/dev/null 2>&1 && echo podman; } || echo "")
1727
BUILDER := $(shell command -v buildah >/dev/null 2>&1 && echo buildah || echo $(CONTAINER_TOOL))
1828
PLATFORMS ?= linux/amd64 # linux/arm64 # linux/s390x,linux/ppc64le
@@ -41,7 +51,7 @@ $(TOKENIZER_LIB):
4151
## Download the HuggingFace tokenizer bindings.
4252
@echo "Downloading HuggingFace tokenizer bindings for version $(TOKENIZER_VERSION)..."
4353
mkdir -p lib
44-
curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION)/libtokenizers.$(TARGETOS)-$(TARGETARCH).tar.gz | tar -xz -C lib
54+
curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION)/libtokenizers.$(TARGETOS)-$(TOKENIZER_ARCH).tar.gz | tar -xz -C lib
4555
ranlib lib/*.a
4656

4757
##@ Development
@@ -93,8 +103,8 @@ build: check-go download-zmq download-tokenizer ## Build the project
93103
image-build: check-container-tool ## Build Docker image ## Build Docker image using $(CONTAINER_TOOL)
94104
@printf "\033[33;1m==== Building Docker image $(IMG) ====\033[0m\n"
95105
$(CONTAINER_TOOL) build \
96-
--platform $(TARGETOS)/$(TARGETARCH) \
97-
--build-arg TARGETOS=$(TARGETOS) \
106+
--platform linux/$(TARGETARCH) \
107+
--build-arg TARGETOS=linux \
98108
--build-arg TARGETARCH=$(TARGETARCH) \
99109
--build-arg COMMIT_SHA=${GIT_COMMIT_SHA} \
100110
--build-arg BUILD_REF=${BUILD_REF} \

0 commit comments

Comments
 (0)