2018-03-21 08:31:42 +00:00
|
|
|
class Parallelstl < Formula
|
|
|
|
desc "C++ standard library algorithms with support for execution policies"
|
|
|
|
homepage "https://github.com/intel/parallelstl"
|
2018-03-29 15:45:05 +00:00
|
|
|
url "https://github.com/intel/parallelstl/archive/20180329.tar.gz"
|
|
|
|
sha256 "415184f093b9dc27fbcfab1dfb0889321b9412614cf9ace9251cf65e0bb98d0b"
|
2018-03-21 08:31:42 +00:00
|
|
|
|
|
|
|
bottle :unneeded
|
|
|
|
|
|
|
|
depends_on "tbb"
|
|
|
|
|
|
|
|
def install
|
|
|
|
include.install Dir["include/*"]
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<~EOS
|
|
|
|
#include <pstl/execution>
|
|
|
|
#include <pstl/algorithm>
|
|
|
|
#include <array>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
std::array<int, 10> arr {{5,2,3,1,4,9,7,0,8,6}};
|
|
|
|
std::sort(std::execution::par_unseq, arr.begin(), arr.end());
|
|
|
|
for(int i=0; i<10; i++)
|
|
|
|
assert(i==arr.at(i));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cxx, "-std=c++11", "-L#{Formula["tbb"].opt_lib}", "-ltbb",
|
|
|
|
"-I#{include}", "test.cpp", "-o", "test"
|
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|