File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,13 @@ fn main() {
1212 . define ( "_GNU_SOURCE" , Some ( "1" ) )
1313 . compile ( "ggml" ) ;
1414
15- cc:: Build :: new ( )
16- . cuda ( true )
17- . include ( "llama.cpp" )
18- . file ( "llama.cpp/ggml-cuda.cu" )
19- . compile ( "ggml-cuda" ) ;
15+ if cublas_enabled {
16+ cc:: Build :: new ( )
17+ . cuda ( true )
18+ . include ( "llama.cpp" )
19+ . file ( "llama.cpp/ggml-cuda.cu" )
20+ . compile ( "ggml-cuda" ) ;
21+ }
2022
2123 cc:: Build :: new ( )
2224 . include ( "llama.cpp" )
@@ -33,11 +35,19 @@ fn main() {
3335 . file ( "llama.cpp/ggml-quants.c" )
3436 . compile ( "ggml-quants" ) ;
3537
36- cc:: Build :: new ( )
38+ let mut llama_build = cc:: Build :: new ( ) ;
39+
40+ llama_build
3741 . cpp ( true )
38- . include ( "llama.cpp" )
39- . define ( "GGML_USE_CUBLAS" , if cublas_enabled { Some ( "1" ) } else { None } )
40- . cuda ( cublas_enabled)
42+ . include ( "llama.cpp" ) ;
43+
44+ if cublas_enabled {
45+ llama_build
46+ . define ( "GGML_USE_CUBLAS" , None )
47+ . cuda ( true ) ;
48+ }
49+
50+ llama_build
4151 . file ( "llama.cpp/llama.cpp" )
4252 . compile ( "llama" ) ;
4353
You can’t perform that action at this time.
0 commit comments