Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Rake::TestTask.new do |t|
t.warning = false # for daru
end

shared_libraries = %w(lib_lightgbm.dll lib_lightgbm.dylib lib_lightgbm.arm64.dylib lib_lightgbm.so)
shared_libraries = %w(lib_lightgbm.dll lib_lightgbm.dylib lib_lightgbm.arm64.dylib lib_lightgbm.so lib_lightgbm.arm64.so)

# ensure vendor files exist
task :ensure_vendor do
Expand All @@ -26,7 +26,7 @@ def download_file(file, sha256)
version = "4.6.0"

url =
if file == "lib_lightgbm.arm64.dylib"
if ["lib_lightgbm.arm64.so", "lib_lightgbm.arm64.dylib"].include?(file)
"https://github.com/ankane/ml-builds/releases/download/lightgbm-#{version}/#{file}"
else
"https://github.com/microsoft/LightGBM/releases/download/v#{version}/#{file}"
Expand All @@ -46,6 +46,7 @@ end
namespace :vendor do
task :linux do
download_file("lib_lightgbm.so", "237f15e1362a5abab4be0fae14aebba7bb278763f3412a82c50ab9d1fc0dc8bd")
download_file("lib_lightgbm.arm64.so", "748e78afbb275d03b0de114d9d629e3b31e397f052c3fe9fe7d4e2fddc7e536e")
end

task :mac do
Expand Down
2 changes: 1 addition & 1 deletion lib/lightgbm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class << self
attr_accessor :ffi_lib
end
lib_name =
if RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
if !::FFI::Platform.windows? && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
"lib_lightgbm.arm64.#{::FFI::Platform::LIBSUFFIX}"
else
"lib_lightgbm.#{::FFI::Platform::LIBSUFFIX}"
Expand Down