lib/xgboost/ffi.rb in xgb-0.5.1 vs lib/xgboost/ffi.rb in xgb-0.5.2
- old
+ new
@@ -3,10 +3,10 @@
extend ::FFI::Library
begin
ffi_lib XGBoost.ffi_lib
rescue LoadError => e
- if e.message.include?("Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib") && e.message.include?("Reason: image not found")
+ if ["/usr/local", "/opt/homebrew"].any? { |v| e.message.include?("Library not loaded: #{v}/opt/libomp/lib/libomp.dylib") } && e.message.include?("Reason: image not found")
raise LoadError, "OpenMP not found. Run `brew install libomp`"
else
raise e
end
end