2010-04-12 20:52:53 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Tbb < Formula
|
2010-04-12 20:52:53 +00:00
|
|
|
homepage 'http://www.threadingbuildingblocks.org/'
|
2013-09-13 15:31:11 +00:00
|
|
|
url 'https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20130725oss_src.tgz'
|
|
|
|
sha1 'f354bd9b67295f65c43531b751e34f483ed8a024'
|
|
|
|
version '4.2'
|
2010-04-12 20:52:53 +00:00
|
|
|
|
2013-11-14 18:42:52 +00:00
|
|
|
option :cxx11
|
|
|
|
|
2013-09-13 15:31:11 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
cause 'llvm is not supported on macos. Add build/macos.llvm.inc file with compiler-specific settings.'
|
2013-01-31 18:06:54 +00:00
|
|
|
end
|
|
|
|
|
2013-09-28 02:25:30 +00:00
|
|
|
# tbb uses the wrong command (-v, verbose) to fetch the version from the
|
|
|
|
# compiler, causing problems if the compiler returns additional debug info
|
|
|
|
# Reported upstream at http://software.intel.com/en-us/forums/topic/475120
|
|
|
|
def patches; DATA; end
|
|
|
|
|
2010-04-12 20:52:53 +00:00
|
|
|
def install
|
2011-10-27 20:20:11 +00:00
|
|
|
# Intel sets varying O levels on each compile command.
|
|
|
|
ENV.no_optimization
|
2013-11-14 18:42:52 +00:00
|
|
|
ENV.cxx11 if build.cxx11?
|
2010-04-12 20:52:53 +00:00
|
|
|
# Override build prefix so we can copy the dylibs out of the same place
|
2011-10-27 20:20:11 +00:00
|
|
|
# no matter what system we're on, and use our compilers.
|
|
|
|
args = ['tbb_build_prefix=BUILDPREFIX',
|
2013-09-13 15:31:11 +00:00
|
|
|
"compiler=#{ENV.compiler}"]
|
2011-03-18 17:30:47 +00:00
|
|
|
args << (MacOS.prefer_64_bit? ? "arch=intel64" : "arch=ia32")
|
2013-11-14 18:42:52 +00:00
|
|
|
args << "cpp0x=1" << "stdlib=libc++" if build.cxx11?
|
2010-04-12 20:52:53 +00:00
|
|
|
system "make", *args
|
|
|
|
lib.install Dir['build/BUILDPREFIX_release/*.dylib']
|
|
|
|
include.install 'include/tbb'
|
|
|
|
end
|
|
|
|
end
|
2013-09-28 02:25:30 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/build/version_info_macos.sh b/build/version_info_macos.sh
|
|
|
|
index 5970aad..20c863a 100644
|
|
|
|
--- a/build/version_info_macos.sh
|
|
|
|
+++ b/build/version_info_macos.sh
|
|
|
|
@@ -31,7 +31,7 @@ echo "#define __TBB_VERSION_STRINGS(N) \\"
|
|
|
|
echo '#N": BUILD_HOST'"\t\t"`hostname -s`" ("`arch`")"'" ENDL \'
|
|
|
|
echo '#N": BUILD_OS'"\t\t"`sw_vers -productName`" version "`sw_vers -productVersion`'" ENDL \'
|
|
|
|
echo '#N": BUILD_KERNEL'"\t"`uname -v`'" ENDL \'
|
|
|
|
-echo '#N": BUILD_GCC'"\t\t"`gcc -v </dev/null 2>&1 | grep 'version'`'" ENDL \'
|
|
|
|
+echo '#N": BUILD_GCC'"\t\t"`gcc --version </dev/null 2>&1 | head -1`'" ENDL \'
|
|
|
|
[ -z "$COMPILER_VERSION" ] || echo '#N": BUILD_COMPILER'"\t"$COMPILER_VERSION'" ENDL \'
|
|
|
|
echo '#N": BUILD_TARGET'"\t$arch on $runtime"'" ENDL \'
|
|
|
|
echo '#N": BUILD_COMMAND'"\t"$*'" ENDL \'
|