Skip to content
Closed
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
23 changes: 10 additions & 13 deletions Formula/dlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class Dlib < Formula
homepage "http://dlib.net/"
url "http://dlib.net/files/dlib-19.16.tar.bz2"
sha256 "37308406c2b1459a70f21ec2fd7bdc922277659534c708323cb28d6e8e4764a8"
revision 1
head "https://github.com/davisking/dlib.git"

bottle do
Expand All @@ -16,31 +17,27 @@ class Dlib < Formula
depends_on "jpeg"
depends_on "libpng"
depends_on :macos => :el_capitan # needs thread-local storage
depends_on "openblas" => :optional
depends_on :x11 => :optional
depends_on "openblas"

needs :cxx11

def install
ENV.cxx11

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
args = std_cmake_args + %W[
-DDLIB_USE_BLAS=ON
-DDLIB_USE_LAPACK=ON
-Dcblas_lib=#{Formula["openblas"].opt_lib}/libopenblas.dylib
-Dlapack_lib=#{Formula["openblas"].opt_lib}/libopenblas.dylib
-DDLIB_NO_GUI_SUPPORT=ON
-DUSE_SSE2_INSTRUCTIONS=ON
]

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"
args << "-Dlapack_lib=#{Formula["openblas"].opt_lib}/libopenblas.dylib"
else
args << "-Dcblas_lib=/usr/lib/libcblas.dylib"
args << "-Dlapack_lib=/usr/lib/liblapack.dylib"
end

mkdir "dlib/build" do
system "cmake", "..", *args
system "make", "install"
Expand Down
20 changes: 4 additions & 16 deletions Formula/r.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class R < Formula
homepage "https://www.r-project.org/"
url "https://cran.r-project.org/src/base/R-3/R-3.5.2.tar.gz"
sha256 "e53d8c3cf20f2b8d7a9c1631b6f6a22874506fb392034758b3bb341c586c5b62"
revision 1

bottle do
sha256 "08120ed5b37e5cf4b067e03ba8cd90bd03c6c4af66d20ab96be3abe2658a4a63" => :mojave
Expand All @@ -15,11 +16,10 @@ class R < Formula
depends_on "gettext"
depends_on "jpeg"
depends_on "libpng"
depends_on "openblas"
depends_on "pcre"
depends_on "readline"
depends_on "xz"
depends_on :java => :optional
depends_on "openblas" => :optional

# needed to preserve executable permissions on files without shebangs
skip_clean "lib/R/bin"
Expand All @@ -46,22 +46,10 @@ def install
"--with-lapack",
"--enable-R-shlib",
"SED=/usr/bin/sed", # don't remember Homebrew's sed shim
"--disable-java",
"--with-blas=-L#{Formula["openblas"].opt_lib} -lopenblas",
]

if build.with? "openblas"
args << "--with-blas=-L#{Formula["openblas"].opt_lib} -lopenblas"
ENV.append "LDFLAGS", "-L#{Formula["openblas"].opt_lib}"
else
args << "--with-blas=-framework Accelerate"
ENV.append_to_cflags "-D__ACCELERATE__" if ENV.compiler != :clang
end

if build.with? "java"
args << "--enable-java"
else
args << "--disable-java"
end

# Help CRAN packages find gettext and readline
["gettext", "readline"].each do |f|
ENV.append "CPPFLAGS", "-I#{Formula[f].opt_include}"
Expand Down
12 changes: 3 additions & 9 deletions Formula/scalapack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Scalapack < Formula
homepage "https://www.netlib.org/scalapack/"
url "https://www.netlib.org/scalapack/scalapack-2.0.2.tgz"
sha256 "0c74aeae690fe5ee4db7926f49c5d0bb69ce09eea75beb915e00bba07530395c"
revision 12
revision 13

bottle do
cellar :any
Expand All @@ -15,17 +15,11 @@ class Scalapack < Formula
depends_on "cmake" => :build
depends_on "gcc" # for gfortran
depends_on "open-mpi"
depends_on "veclibfort" if build.without?("openblas")
depends_on "openblas" => :optional
depends_on "openblas"

def install
if build.with? "openblas"
blas = "-L#{Formula["openblas"].opt_lib} -lopenblas"
else
blas = "-L#{Formula["veclibfort"].opt_lib} -lvecLibFort"
end

mkdir "build" do
blas = "-L#{Formula["openblas"].opt_lib} -lopenblas"
system "cmake", "..", *std_cmake_args, "-DBUILD_SHARED_LIBS=ON",
"-DBLAS_LIBRARIES=#{blas}", "-DLAPACK_LIBRARIES=#{blas}"
system "make", "all"
Expand Down