Allow Accelerate linkage, deny veclibfort & lapack
- Accelerate provides more than just BLAS and LAPACK functionality, see https://developer.apple.com/documentation/accelerate - Veclibfort exists only to wrap Accelerate's BLAS/LAPACK - LAPACK is a slow, seldom updated reference implementation - Encourage usage of OpenBLAS - Reverts PR #6130
This commit is contained in:
parent
7f4aefe41a
commit
0cf8ec7547
@ -48,28 +48,6 @@ module FormulaCellarChecks
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_accelerate_framework_links
|
|
||||||
return unless @core_tap
|
|
||||||
return unless formula.prefix.directory?
|
|
||||||
return if formula.name == "veclibfort" # veclibfort exists to wrap accelerate
|
|
||||||
|
|
||||||
keg = Keg.new(formula.prefix)
|
|
||||||
system_accelerate = keg.mach_o_files.select do |obj|
|
|
||||||
dlls = obj.dynamically_linked_libraries
|
|
||||||
dlls.any? { |dll| %r{^/System/Library/Frameworks/Accelerate.framework}.match dll }
|
|
||||||
end
|
|
||||||
return if system_accelerate.empty?
|
|
||||||
|
|
||||||
<<~EOS
|
|
||||||
object files were linked against system Accelerate
|
|
||||||
These object files were linked against the outdated system Accelerate framework.
|
|
||||||
Core tap formulae should link against OpenBLAS instead.
|
|
||||||
Removing `depends_on "veclibfort" and/or adding `depends_on "openblas"` to the
|
|
||||||
formula may help.
|
|
||||||
#{system_accelerate * "\n "}
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
def check_python_framework_links(lib)
|
def check_python_framework_links(lib)
|
||||||
python_modules = Pathname.glob lib/"python*/site-packages/**/*.so"
|
python_modules = Pathname.glob lib/"python*/site-packages/**/*.so"
|
||||||
framework_links = python_modules.select do |obj|
|
framework_links = python_modules.select do |obj|
|
||||||
@ -117,7 +95,6 @@ module FormulaCellarChecks
|
|||||||
generic_audit_installed
|
generic_audit_installed
|
||||||
problem_if_output(check_shadowed_headers)
|
problem_if_output(check_shadowed_headers)
|
||||||
problem_if_output(check_openssl_links)
|
problem_if_output(check_openssl_links)
|
||||||
problem_if_output(check_accelerate_framework_links)
|
|
||||||
problem_if_output(check_python_framework_links(formula.lib))
|
problem_if_output(check_python_framework_links(formula.lib))
|
||||||
check_linkage
|
check_linkage
|
||||||
end
|
end
|
||||||
|
|||||||
@ -16,6 +16,10 @@ module RuboCop
|
|||||||
problem "Formulae should not depend on both OpenSSL and LibreSSL (even optionally)."
|
problem "Formulae should not depend on both OpenSSL and LibreSSL (even optionally)."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if depends_on?("veclibfort") || depends_on?("lapack")
|
||||||
|
problem "Formulae should use OpenBLAS as the default serial linear algebra library."
|
||||||
|
end
|
||||||
|
|
||||||
if method_called_ever?(body_node, :virtualenv_create) ||
|
if method_called_ever?(body_node, :virtualenv_create) ||
|
||||||
method_called_ever?(body_node, :virtualenv_install_with_resources)
|
method_called_ever?(body_node, :virtualenv_install_with_resources)
|
||||||
find_method_with_args(body_node, :resource, "setuptools") do
|
find_method_with_args(body_node, :resource, "setuptools") do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user