dlib: use SSE2, SSE4, and AVX when possible

Closes #28347.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
etanaru 2018-05-28 16:12:45 +08:00 committed by FX Coudert
parent 9773f9c300
commit ca80c2b1ce

View file

@ -27,6 +27,12 @@ class Dlib < Formula
args = std_cmake_args + %w[-DDLIB_USE_BLAS=ON -DDLIB_USE_LAPACK=ON]
args << "-DDLIB_NO_GUI_SUPPORT=ON" if build.without? "x11"
args << "-DUSE_SSE2_INSTRUCTIONS=ON" # SSE2 is present on all modern macOS hardware
unless build.bottle?
args << "-DUSE_AVX_INSTRUCTIONS=ON" if Hardware::CPU.avx?
args << "-DUSE_SSE4_INSTRUCTIONS=ON" if Hardware::CPU.sse4?
end
if build.with? "openblas"
args << "-Dcblas_lib=#{Formula["openblas"].opt_lib}/libopenblas.dylib"