aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/tbb.rb
blob: 0de2fc2271505d4225ff140252871845c3fa6b91 (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
require "formula"

class Tbb < Formula
  homepage "http://www.threadingbuildingblocks.org/"
  url "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20140601oss_src.tgz"
  sha1 "f50c04a27f5e37c920a03be134dc57ccf909515d"
  version "4.2.5"

  bottle do
    cellar :any
    sha1 "1acf91deb5540f1ed153c3ece947146f84e52946" => :mavericks
    sha1 "0e2799b23f8a7ee446fe49b986d1d8cc308ae755" => :mountain_lion
    sha1 "626775355972feb9cbcf7a786c109112f36fd746" => :lion
  end

  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