Merge pull request #1982 from dhiltgen/fix_intel_mac

Fix intel mac build
This commit is contained in:
Daniel Hiltgen 2024-01-14 08:26:46 -08:00 committed by GitHub
commit cfa6337960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -75,7 +75,7 @@ func newDynExtServer(library, model string, adapters, projectors []string, opts
updatePath(filepath.Dir(library)) updatePath(filepath.Dir(library))
libPath := C.CString(library) libPath := C.CString(library)
defer C.free(unsafe.Pointer(libPath)) defer C.free(unsafe.Pointer(libPath))
resp := newExtServerResp(128) resp := newExtServerResp(512)
defer freeExtServerResp(resp) defer freeExtServerResp(resp)
var srv C.struct_dynamic_llama_server var srv C.struct_dynamic_llama_server
C.dyn_init(libPath, &srv, &resp) C.dyn_init(libPath, &srv, &resp)

View file

@ -14,9 +14,11 @@ BUILD_DIR="${LLAMACPP_DIR}/build/darwin/metal"
case "${GOARCH}" in case "${GOARCH}" in
"amd64") "amd64")
CMAKE_DEFS="-DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DLLAMA_METAL=off -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off ${CMAKE_DEFS}" CMAKE_DEFS="-DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DLLAMA_METAL=off -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off ${CMAKE_DEFS}"
ARCH="x86_64"
;; ;;
"arm64") "arm64")
CMAKE_DEFS="-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64 -DLLAMA_METAL=on ${CMAKE_DEFS}" CMAKE_DEFS="-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64 -DLLAMA_METAL=on ${CMAKE_DEFS}"
ARHC="arm64"
;; ;;
*) *)
echo "GOARCH must be set" echo "GOARCH must be set"
@ -30,6 +32,7 @@ apply_patches
build build
install install
gcc -fPIC -g -shared -o ${BUILD_DIR}/lib/libext_server.so \ gcc -fPIC -g -shared -o ${BUILD_DIR}/lib/libext_server.so \
-arch ${ARCH} \
-Wl,-force_load ${BUILD_DIR}/lib/libext_server.a \ -Wl,-force_load ${BUILD_DIR}/lib/libext_server.a \
${BUILD_DIR}/lib/libcommon.a \ ${BUILD_DIR}/lib/libcommon.a \
${BUILD_DIR}/lib/libllama.a \ ${BUILD_DIR}/lib/libllama.a \