Subject: [PATCH 6/6] gnu: Add pocl.

From: Fis Trivial <[email-masked]>
Date: Sat, 12 May 2018 19:52:14 +0000

* gnu/packages/opencl.scm (pocl): New variable.
---
 gnu/packages/opencl.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/opencl.scm b/gnu/packages/opencl.scm
index 5346d23ac..fe90a639b 100644
--- a/gnu/packages/opencl.scm
+++ b/gnu/packages/opencl.scm
@@ -24,12 +24,14 @@
   #:use-module (guix packages)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages llvm)
+  #:use-module (gnu packages mpi)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -282,3 +284,44 @@ the system.")
     (description "Intel's OpenCL framework that works with Intel IvyBridge GPUs
 and above.")
     (license license:lgpl2.1)))
+
+(define-public pocl
+  (package
+    (name "pocl")
+    (version "1.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/pocl/pocl/archive/v"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0lrw3hlb0w53xzmrf2hvbda406l70ar4gyadflvlkj4879lx138y"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("libltdl" ,libltdl)))
+    (inputs
+     `(("llvm" ,llvm)
+       ("hwloc" ,hwloc "lib")
+       ("clang" ,clang)
+       ("ocl-icd" ,ocl-icd)))
+    (arguments
+     `(#:configure-flags
+       '("-DENABLE_ICD=ON"
+         "-DENABLE_TESTSUITES=OFF"
+         "-DENABLE_CONFORMANCE=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'remove-headers
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (delete-file-recursively
+                (string-append out "/include"))))))
+       #:tests? #f))                    ; failed
+    (home-page "http://portablecl.org/")
+    (synopsis "Portable Computing Language (pocl)")
+    (description "pocl is being developed towards an efficient implementation
+of OpenCL standard which can be easily adapted for new targets.")
+    (license license:expat)))
-- 
2.14.3