fix build on windows

This commit is contained in:
jmorganca 2024-06-12 02:47:12 -04:00
parent 4d476d894e
commit 24a741424f
4 changed files with 5 additions and 8 deletions

View File

@ -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 $@ $<

View File

@ -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))))

View File

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

2
llama/metal.c Normal file
View File

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