File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ impl Booster {
148
148
dmats
149
149
} ;
150
150
151
- let mut bst = Booster :: new_with_cached_dmats ( & params. booster_params , & cached_dmats) ?;
151
+ let bst = Booster :: new_with_cached_dmats ( & params. booster_params , & cached_dmats) ?;
152
152
for i in 0 ..params. boost_rounds as i32 {
153
153
if let Some ( eval_sets) = params. evaluation_sets {
154
154
let mut dmat_eval_results = bst. eval_set ( eval_sets, i) ?;
Original file line number Diff line number Diff line change @@ -33,17 +33,21 @@ fn main() {
33
33
#[ cfg( not( feature = "cuda" ) ) ]
34
34
let mut dst = Config :: new ( & xgb_root) ;
35
35
36
- let dst = dst. uses_cxx11 ( )
36
+ let mut dst = dst. uses_cxx11 ( )
37
37
. define ( "BUILD_STATIC_LIB" , "ON" ) ;
38
38
39
39
#[ cfg( target_os = "macos" ) ]
40
- let dst =
41
- dst
42
- . define ( "CMAKE_C_COMPILER" , "/opt/homebrew/opt/llvm/bin/clang" )
43
- . define ( "CMAKE_CXX_COMPILER" , "/opt/homebrew/opt/llvm/bin/clang++" )
44
- . define ( "OPENMP_LIBRARIES" , "/opt/homebrew/opt/llvm/lib" )
45
- . define ( "OPENMP_INCLUDES" , "/opt/homebrew/opt/llvm/include" ) ;
46
-
40
+ {
41
+ let path = PathBuf :: from ( "/opt/homebrew/" ) ; // check for m1 vs intel config
42
+ if let Ok ( _dir) = std:: fs:: read_dir ( & path) {
43
+ dst =
44
+ dst
45
+ . define ( "CMAKE_C_COMPILER" , "/opt/homebrew/opt/llvm/bin/clang" )
46
+ . define ( "CMAKE_CXX_COMPILER" , "/opt/homebrew/opt/llvm/bin/clang++" )
47
+ . define ( "OPENMP_LIBRARIES" , "/opt/homebrew/opt/llvm/lib" )
48
+ . define ( "OPENMP_INCLUDES" , "/opt/homebrew/opt/llvm/include" ) ;
49
+ } ;
50
+ }
47
51
let dst = dst. build ( ) ;
48
52
49
53
let xgb_root = xgb_root. canonicalize ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments