lib/xgboost.rb in xgb-0.5.1 vs lib/xgboost.rb in xgb-0.5.2

- old
+ new

@@ -17,10 +17,15 @@ class Error < StandardError; end class << self attr_accessor :ffi_lib end - lib_name = FFI.map_library_name("xgboost") + lib_name = + if RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm/i + FFI.map_library_name("xgboost.arm64") + else + FFI.map_library_name("xgboost") + end vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__) self.ffi_lib = [vendor_lib] # friendlier error message autoload :FFI, "xgboost/ffi"