aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/tbb.rb
blob: 952ed7097047467347ee644ed1e4d340d55fd8ae (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
require 'formula'

class Tbb < Formula
  homepage 'http://www.threadingbuildingblocks.org/'
  url 'https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20130725oss_src.tgz'
  sha1 'f354bd9b67295f65c43531b751e34f483ed8a024'
  version '4.2'

  fails_with :llvm do
    cause 'llvm is not supported on macos. Add build/macos.llvm.inc file with compiler-specific settings.'
  end

  def install
    # Intel sets varying O levels on each compile command.
    ENV.no_optimization
    # Override build prefix so we can copy the dylibs out of the same place
    # no matter what system we're on, and use our compilers.
    args = ['tbb_build_prefix=BUILDPREFIX',
            "compiler=#{ENV.compiler}"]
    args << (MacOS.prefer_64_bit? ? "arch=intel64" : "arch=ia32")
    system "make", *args
    lib.install Dir['build/BUILDPREFIX_release/*.dylib']
    include.install 'include/tbb'
  end
end