Skip to content

Commit 23a5de8

Browse files
Add linux-arm64 support (#13)
1 parent e4d9157 commit 23a5de8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Rakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Rake::TestTask.new do |t|
88
t.warning = false # for daru
99
end
1010

11-
shared_libraries = %w(lib_lightgbm.dll lib_lightgbm.dylib lib_lightgbm.arm64.dylib lib_lightgbm.so)
11+
shared_libraries = %w(lib_lightgbm.dll lib_lightgbm.dylib lib_lightgbm.arm64.dylib lib_lightgbm.so lib_lightgbm.arm64.so)
1212

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

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

5152
task :mac do

lib/lightgbm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class << self
2424
attr_accessor :ffi_lib
2525
end
2626
lib_name =
27-
if RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
27+
if !::FFI::Platform.windows? && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
2828
"lib_lightgbm.arm64.#{::FFI::Platform::LIBSUFFIX}"
2929
else
3030
"lib_lightgbm.#{::FFI::Platform::LIBSUFFIX}"

0 commit comments

Comments
 (0)