lib/lightgbm.rb in lightgbm-0.2.2 vs lib/lightgbm.rb in lightgbm-0.2.3

- old
+ new

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