aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/tbb.rb
blob: bc34ade4f3e5d59a6ec4f425f260e361bc3029d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require "formula"

class Tbb < Formula
  homepage "http://www.threadingbuildingblocks.org/"
  url "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20140724oss_src.tgz"
  sha1 "4cb73cd0ac61b790318358ae4782f80255715278"
  version "4.3-20140724"

  bottle do
    cellar :any
    sha1 "500a19e3b12c7ecd04d09c558403b03dabaef465" => :mavericks
    sha1 "17194db68fe3dc0a932094f04776bc5c7eee756d" => :mountain_lion
    sha1 "2bb200abaf9f8182bfb948e4dee513b9afca2198" => :lion
  end

  # requires malloc features first introduced in Lion
  # https://github.com/Homebrew/homebrew/issues/32274
  depends_on :macos => :lion

  option :cxx11

  def install
    # Intel sets varying O levels on each compile command.
    ENV.no_optimization

    args = %W[tbb_build_prefix=BUILDPREFIX]

    case ENV.compiler
    when :clang
      args << "compiler=clang"
    else
      args << "compiler=gcc"
    end

    if MacOS.prefer_64_bit?
      args << "arch=intel64"
    else
      args << "arch=ia32"
    end

    if build.cxx11?
      ENV.cxx11
      args << "cpp0x=1" << "stdlib=libc++"
    end

    system "make", *args
    lib.install Dir["build/BUILDPREFIX_release/*.dylib"]
    include.install "include/tbb"
  end
end