Skip to content

Commit 2a68c92

Browse files
committed
fix(Makefile): handle macOS
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent fdbf125 commit 2a68c92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ ifeq ($(OS),Darwin)
102102
ONNX_OS=osx
103103
ifneq (,$(findstring aarch64,$(shell uname -m)))
104104
ONNX_ARCH=arm64
105+
else ifneq (,$(findstring arm64,$(shell uname -m)))
106+
ONNX_ARCH=arm64
105107
else
106108
ONNX_ARCH=x86_64
107109
endif
@@ -299,13 +301,17 @@ sources/go-stable-diffusion/libstablediffusion.a: sources/go-stable-diffusion
299301

300302
sources/onnxruntime:
301303
mkdir -p sources/onnxruntime
302-
wget https://github.com/microsoft/onnxruntime/releases/download/v$(ONNX_VERSION)/onnxruntime-$(ONNX_OS)-$(ONNX_ARCH)-$(ONNX_VERSION).tgz -O sources/onnxruntime/onnxruntime-$(ONNX_OS)-$(ONNX_ARCH)-$(ONNX_VERSION).tgz
304+
curl -L https://github.com/microsoft/onnxruntime/releases/download/v$(ONNX_VERSION)/onnxruntime-$(ONNX_OS)-$(ONNX_ARCH)-$(ONNX_VERSION).tgz -o sources/onnxruntime/onnxruntime-$(ONNX_OS)-$(ONNX_ARCH)-$(ONNX_VERSION).tgz
303305
cd sources/onnxruntime && tar -xvf onnxruntime-$(ONNX_OS)-$(ONNX_ARCH)-$(ONNX_VERSION).tgz && rm onnxruntime-$(ONNX_OS)-$(ONNX_ARCH)-$(ONNX_VERSION).tgz
304306
cd sources/onnxruntime && mv onnxruntime-$(ONNX_OS)-$(ONNX_ARCH)-$(ONNX_VERSION)/* ./
305307

306308
backend-assets/lib/libonnxruntime.so.1: backend-assets/lib sources/onnxruntime
307309
cp -rfv sources/onnxruntime/lib/* backend-assets/lib/
310+
ifeq ($(OS),Darwin)
311+
mv backend-assets/lib/libonnxruntime.$(ONNX_VERSION).dylib backend-assets/lib/libonnxruntime.dylib
312+
else
308313
mv backend-assets/lib/libonnxruntime.so.$(ONNX_VERSION) backend-assets/lib/libonnxruntime.so.1
314+
endif
309315

310316
## tiny-dream
311317
sources/go-tiny-dream:

0 commit comments

Comments
 (0)