mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-26 06:10:29 +01:00
f3f65429c4
* scripts : update sync [no ci] * files : relocate [no ci] * ci : disable kompute build [no ci] * cmake : fixes [no ci] * server : fix mingw build ggml-ci * cmake : minor [no ci] * cmake : link math library [no ci] * cmake : build normal ggml library (not object library) [no ci] * cmake : fix kompute build ggml-ci * make,cmake : fix LLAMA_CUDA + replace GGML_CDEF_PRIVATE ggml-ci * move public backend headers to the public include directory (#8122) * move public backend headers to the public include directory * nix test * spm : fix metal header --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * scripts : fix sync paths [no ci] * scripts : sync ggml-blas.h [no ci] --------- Co-authored-by: slaren <slarengh@gmail.com>
76 lines
1.9 KiB
Swift
76 lines
1.9 KiB
Swift
// swift-tools-version:5.5
|
|
|
|
import PackageDescription
|
|
|
|
var sources = [
|
|
"src/llama.cpp",
|
|
"src/unicode.cpp",
|
|
"src/unicode-data.cpp",
|
|
"ggml/src/ggml.c",
|
|
"ggml/src/ggml-alloc.c",
|
|
"ggml/src/ggml-backend.c",
|
|
"ggml/src/ggml-quants.c",
|
|
]
|
|
|
|
var resources: [Resource] = []
|
|
var linkerSettings: [LinkerSetting] = []
|
|
var cSettings: [CSetting] = [
|
|
.unsafeFlags(["-Wno-shorten-64-to-32", "-O3", "-DNDEBUG"]),
|
|
.unsafeFlags(["-fno-objc-arc"]),
|
|
// NOTE: NEW_LAPACK will required iOS version 16.4+
|
|
// We should consider add this in the future when we drop support for iOS 14
|
|
// (ref: ref: https://developer.apple.com/documentation/accelerate/1513264-cblas_sgemm?language=objc)
|
|
// .define("ACCELERATE_NEW_LAPACK"),
|
|
// .define("ACCELERATE_LAPACK_ILP64")
|
|
]
|
|
|
|
#if canImport(Darwin)
|
|
sources.append("ggml/src/ggml-metal.m")
|
|
resources.append(.process("ggml/src/ggml-metal.metal"))
|
|
linkerSettings.append(.linkedFramework("Accelerate"))
|
|
cSettings.append(
|
|
contentsOf: [
|
|
.define("GGML_USE_ACCELERATE"),
|
|
.define("GGML_USE_METAL")
|
|
]
|
|
)
|
|
#endif
|
|
|
|
#if os(Linux)
|
|
cSettings.append(.define("_GNU_SOURCE"))
|
|
#endif
|
|
|
|
let package = Package(
|
|
name: "llama",
|
|
platforms: [
|
|
.macOS(.v12),
|
|
.iOS(.v14),
|
|
.watchOS(.v4),
|
|
.tvOS(.v14)
|
|
],
|
|
products: [
|
|
.library(name: "llama", targets: ["llama"]),
|
|
],
|
|
targets: [
|
|
.target(
|
|
name: "llama",
|
|
path: ".",
|
|
exclude: [
|
|
"cmake",
|
|
"examples",
|
|
"scripts",
|
|
"models",
|
|
"tests",
|
|
"CMakeLists.txt",
|
|
"Makefile"
|
|
],
|
|
sources: sources,
|
|
resources: resources,
|
|
publicHeadersPath: "spm-headers",
|
|
cSettings: cSettings,
|
|
linkerSettings: linkerSettings
|
|
)
|
|
],
|
|
cxxLanguageStandard: .cxx11
|
|
)
|