Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix LLVM failure
- Loading branch information
Showing
1 changed file
with
28 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,39 @@ | ||
require 'formula' | ||
require "formula" | ||
|
||
class Tbb < Formula | ||
homepage 'http://www.threadingbuildingblocks.org/' | ||
url 'https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20140122oss_src.tgz' | ||
sha1 'd897a6ced4f425c6608422a2e19218898e727260' | ||
version '4.2.3' | ||
homepage "http://www.threadingbuildingblocks.org/" | ||
url "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20140416oss_src.tgz" | ||
sha1 "1285471b4dce67cf3edf20a071db37f4f205bcf1" | ||
version "4.2.4" | ||
|
||
option :cxx11 | ||
|
||
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 | ||
ENV.cxx11 if build.cxx11? | ||
# 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. | ||
compiler = ENV.compiler.to_s.start_with?('gcc') ? 'gcc' : ENV.compiler | ||
args = ['tbb_build_prefix=BUILDPREFIX', | ||
"compiler=#{compiler}"] | ||
args << (MacOS.prefer_64_bit? ? "arch=intel64" : "arch=ia32") | ||
args << "cpp0x=1" << "stdlib=libc++" if build.cxx11? | ||
|
||
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' | ||
lib.install Dir["build/BUILDPREFIX_release/*.dylib"] | ||
include.install "include/tbb" | ||
end | ||
end |