-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
pocl 3.0 (new formula) #103141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
pocl 3.0 (new formula) #103141
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
class Pocl < Formula | ||
desc "Portable Computing Language" | ||
homepage "http://portablecl.org" | ||
url "http://portablecl.org/downloads/pocl-3.0.tar.gz" | ||
sha256 "a3fd3889ef7854b90b8e4c7899c5de48b7494bf770e39fba5ad268a5cbcc719d" | ||
license "MIT" | ||
head "https://github.com/pocl/pocl.git", branch: "master" | ||
|
||
depends_on "cmake" => :build | ||
depends_on "opencl-headers" => :build | ||
depends_on "pkg-config" => :build | ||
depends_on "hwloc" | ||
depends_on "llvm" | ||
depends_on "ocl-icd" | ||
|
||
on_linux do | ||
depends_on "gcc" | ||
end | ||
|
||
fails_with gcc: "5" # LLVM is built with GCC | ||
|
||
def install | ||
# Install the ICD into #{prefix}/etc rather than #{etc} as it contains the realpath | ||
# to the shared library and needs to be kept up-to-date to work with an ICD loader. | ||
# This relies on `brew link` automatically creating and updating #{etc} symlinks. | ||
args = %W[ | ||
-DPOCL_INSTALL_ICD_VENDORDIR=#{prefix}/etc/OpenCL/vendors | ||
-DCMAKE_INSTALL_RPATH=#{lib};#{lib}/pocl | ||
-DENABLE_EXAMPLES=OFF | ||
-DENABLE_TESTS=OFF | ||
-DLLVM_BINDIR=#{Formula["llvm"].opt_bin} | ||
] | ||
# Avoid installing another copy of OpenCL headers on macOS | ||
args << "-DOPENCL_H=#{Formula["opencl-headers"].opt_include}/CL/opencl.h" if OS.mac? | ||
# Only x86_64 supports "distro" which allows runtime detection of SSE/AVX | ||
args << "-DKERNELLIB_HOST_CPU_VARIANTS=distro" if Hardware::CPU.intel? | ||
|
||
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args | ||
system "cmake", "--build", "build" | ||
system "cmake", "--install", "build" | ||
(pkgshare/"examples").install "examples/poclcc" | ||
end | ||
|
||
test do | ||
ENV["OCL_ICD_VENDORS"] = "pocl.icd" # Ignore any other ICD that may be installed | ||
cp pkgshare/"examples/poclcc/poclcc.cl", testpath | ||
system bin/"poclcc", "-o", "poclcc.cl.pocl", "poclcc.cl" | ||
assert_predicate testpath/"poclcc.cl.pocl", :exist? | ||
# Make sure that CMake found our OpenCL headers and didn't install a copy | ||
refute_predicate include/"OpenCL", :exist? | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.