File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,16 @@ tracing = { workspace = true }
1818encoding_rs = { workspace = true }
1919
2020[features ]
21+ default = [" openmp" ]
2122cuda = [" llama-cpp-sys-2/cuda" ]
2223metal = [" llama-cpp-sys-2/metal" ]
2324dynamic-link = [" llama-cpp-sys-2/dynamic-link" ]
2425vulkan = [" llama-cpp-sys-2/vulkan" ]
2526native = [" llama-cpp-sys-2/native" ]
27+ openmp = [" llama-cpp-sys-2/openmp" ]
2628sampler = []
2729
30+
2831[target .'cfg(all(target_os = "macos", any(target_arch = "aarch64", target_arch = "arm64")))' .dependencies ]
2932llama-cpp-sys-2 = { path = " ../llama-cpp-sys-2" , version = " 0.1.69" , features = [
3033 " metal" ,
Original file line number Diff line number Diff line change @@ -69,3 +69,4 @@ metal = []
6969dynamic-link = []
7070vulkan = []
7171native = []
72+ openmp = []
Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ fn main() {
245245 config. define ( "GGML_CUDA" , "ON" ) ;
246246 }
247247
248+ if cfg ! ( feature = "openmp" ) {
249+ config. define ( "GGML_OPENMP" , "ON" ) ;
250+ }
251+
248252 // General
249253 config
250254 . profile ( & profile)
@@ -272,6 +276,13 @@ fn main() {
272276 ) ;
273277 }
274278
279+ // OpenMP
280+ if cfg ! ( feature = "openmp" ) {
281+ if target. contains ( "gnu" ) {
282+ println ! ( "cargo:rustc-link-lib=gomp" ) ;
283+ }
284+ }
285+
275286 // Windows debug
276287 if cfg ! ( all( debug_assertions, windows) ) {
277288 println ! ( "cargo:rustc-link-lib=dylib=msvcrtd" ) ;
You can’t perform that action at this time.
0 commit comments