浏览代码

fix build on windows

jmorganca 10 月之前
父节点
当前提交
24a741424f
共有 4 个文件被更改,包括 5 次插入8 次删除
  1. 3 3
      llama/Makefile
  2. 0 1
      llama/llama.go
  3. 0 4
      llama/metal-darwin-arm64.m
  4. 2 0
      llama/metal.c

+ 3 - 3
llama/Makefile

@@ -99,14 +99,14 @@ RUNNERS := ollama_runner
 ifeq ($(ARCH),amd64)
 	RUNNERS += ollama_runner_avx ollama_runner_avx2
 endif
-ifeq ($(NVCC),)
+ifneq ($(NVCC),)
 	RUNNERS += ollama_runner_cuda
 endif
-ifeq ($(HIPCC),)
+ifneq ($(HIPCC),)
 	RUNNERS += ollama_runner_rocm
 endif
 
-all: ollama_runner $(RUNNERS)
+runners: $(RUNNERS)
 
 %.cuda.$(OBJ_EXT): %.cu
 	$(NVCC) -c $(CUDA_FLAGS) -o $@ $<

+ 0 - 1
llama/llama.go

@@ -59,7 +59,6 @@ var ggmlMetal string
 
 func init() {
 	metal := strings.ReplaceAll(ggmlMetal, `#include "ggml-common.h"`, ggmlCommon)
-	fmt.Println(metal)
 	cMetal := C.CString(metal)
 	C.ggml_metallib_start = cMetal
 	C.ggml_metallib_end = (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cMetal)) + uintptr(len(metal))))

+ 0 - 4
llama/metal-darwin-arm64.m

@@ -1,4 +0,0 @@
-#import <Foundation/Foundation.h>
-
-const char* ggml_metallib_start = NULL;
-const char* ggml_metallib_end = NULL;

+ 2 - 0
llama/metal.c

@@ -0,0 +1,2 @@
+const char* ggml_metallib_start = 0;
+const char* ggml_metallib_end = 0;