Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / opencl.scm
index da97925..f14d5df 100644 (file)
@@ -20,6 +20,7 @@
 (define-module (gnu packages opencl)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system python)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
@@ -35,6 +36,7 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xdisorg)
@@ -128,7 +130,7 @@ programming.")
        ;; The regression tests require a lot more dependencies.
        #:tests? #f))
     (build-system cmake-build-system)
-    (home-page "http://github.khronos.org/OpenCL-CLHPP/")
+    (home-page "https://github.khronos.org/OpenCL-CLHPP/")
     (synopsis "Khronos OpenCL-CLHPP")
     (description
      "This package provides the @dfn{host API} C++ headers for OpenCL.")
@@ -240,7 +242,7 @@ the system.")
               ("llvm@3.7" ,llvm-3.7)
               ("libdrm" ,libdrm)
               ("libedit" ,libedit)
-              ("libpthread-stubs"libpthread-stubs)
+              ("libpthread-stubs" ,libpthread-stubs)
               ("libsm" ,libsm)
               ("libva" ,libva)
               ("libxfixes" ,libxfixes)
@@ -289,12 +291,14 @@ Haswell, Skylake, Apollolake, etc.  It defines and implements the OpenCL host
 functions required to initialize the device, create the command queues, the
 kernels and the programs, and run them on the GPU.  The code also contains a
 back-end for the LLVM compiler framework.")
+    ;; Beignet only supports Intel processors.
+    (supported-systems '("x86_64-linux" "i686-linux"))
     (license license:lgpl2.1+)))
 
 (define-public pocl
   (package
     (name "pocl")
-    (version "1.2")
+    (version "1.4")
     (source
      (origin
        (method git-fetch)
@@ -302,7 +306,7 @@ back-end for the LLVM compiler framework.")
              (url "https://github.com/pocl/pocl.git")
              (commit (string-append "v" version))))
        (sha256
-        (base32 "0fyiwd9nrqhl0jsac0bx17p9acpfzhyxp50mmp28mzn7psb9qidg"))
+        (base32 "1c4y69zks6hkq5fqh9waxgb8g4ka7y6h3vacmsm720kba0h57g8a"))
        (file-name (git-file-name name version))))
     (build-system cmake-build-system)
     (native-inputs
@@ -310,7 +314,7 @@ back-end for the LLVM compiler framework.")
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("clang" ,clang)
-       ("hwloc" ,hwloc-2.0 "lib")
+       ("hwloc" ,hwloc-2 "lib")
        ("llvm" ,llvm)
        ("ocl-icd" ,ocl-icd)))
     (arguments
@@ -340,3 +344,92 @@ implementation, and as a portability layer.  Thus, if your desired target has
 an LLVM backend, it should be able to get OpenCL support easily by using
 pocl.")
     (license license:expat)))
+
+(define-public python-pytools
+  (package
+    (name "python-pytools")
+    (version "2020.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytools" version))
+       (sha256
+        (base32
+         "19h47pqfrq7ax7601i5g8icpb6b42h8zzwq0dqfdcjjqamwd2cn1"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-appdirs" ,python-appdirs)
+       ("python-decorator" ,python-decorator)
+       ("python-numpy" ,python-numpy)
+       ("python-six" ,python-six)
+       ("python-mpi4py" ,python-mpi4py)))
+    (home-page "https://pypi.org/project/pytools/")
+    (synopsis "Assorted tools for Python")
+    (description
+     "Pytools is a bag of things that are ``missing'' from the Python standard
+library:
+
+@itemize
+@item
+small helper functions such as @code{len_iterable}, @code{argmin},
+tuple generation, permutation generation, ASCII table pretty printing,
+GvR's @code{monkeypatch_xxx} hack, the elusive @code{flatten}, and much more.
+@item
+Michele Simionato's decorator module
+@item
+A time-series logging module, @code{pytools.log}.
+@item
+Batch job submission, @code{pytools.batchjob}.
+@item
+A lexer, @code{pytools.lex}.
+@end itemize\n")
+    (license license:expat)))
+
+(define-public python-pyopencl
+  (package
+    (name "python-pyopencl")
+    (version "2019.1.1")
+    (source
+     (origin
+       ;; The tarball on PyPI lacks test programs such as
+       ;; 'pygpu_language_opencl.cpp' so fetch it from Git.
+       ;; XXX: The server at git.tiker.net is unreliable.
+       (method git-fetch)
+       (uri (git-reference
+             (url "http://git.tiker.net/trees/pyopencl.git")
+             (commit (string-append "v" version))
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "12q0rs8yla571vcfpsh0mfrjbdiayv0hi8r1rq0f178m3i3qjz80"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-before 'build 'set-home
+                    (lambda _
+                      ;; Some of the Python build scripts expect 'HOME' to be
+                      ;; set.
+                      (setenv "HOME" (getcwd))
+                      #t)))
+
+       ;; Tests in 'compyte/ndarray/setup_opencl.py' appear to rely on
+       ;; 'nvcc', which is not an option.
+       #:tests? #f))
+    (inputs
+     `(("opencl-headers" ,opencl-headers-1.2)   ;POCL only supports OpenCL 1.2
+       ("pybind11" ,pybind11)
+       ("ocl-icd" ,ocl-icd)))                     ;libOpenCL
+    (propagated-inputs
+     `(("python-appdirs" ,python-appdirs)
+       ("python-decorator" ,python-decorator)
+       ("python-numpy" ,python-numpy)
+       ("python-pytools" ,python-pytools)
+       ("python-six" ,python-six)
+       ("python-mako" ,python-mako)))
+    (home-page "http://mathema.tician.de/software/pyopencl")
+    (synopsis "Python wrapper for OpenCL")
+    (description
+     "PyOpenCL lets you access parallel computing devices such as GPUs from
+Python @i{via} OpenCL.")
+    (license license:expat)))