homebrew-core/Formula/parallelstl.rb
Igor Kapkov 3447a1a5d0 parallelstl 20181109
Closes #34233.

Signed-off-by: Jan Viljanen <527069+javian@users.noreply.github.com>
2018-11-17 11:29:14 +01:00

34 lines
971 B
Ruby

class Parallelstl < Formula
desc "C++ standard library algorithms with support for execution policies"
homepage "https://github.com/intel/parallelstl"
url "https://github.com/intel/parallelstl/archive/20181109.tar.gz"
sha256 "34996b5ce47f32ed8db0b68a765a4af5b8358183ddc32b84286a00829a23126d"
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