diff options
| author | Fis Trivial <ybbs.daans@hotmail.com> | 2018-06-29 00:10:25 +0000 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2018-07-03 17:50:04 +0200 |
| commit | 53fc7a09f6480ed2f898832afb614ec537c33d73 (patch) | |
| tree | e7cbc28e8b800e8b3d909b0f8b79e9809a5c53bd /gnu | |
| parent | 3c78f5b5c341aa741a39417e6007dbaf369438f8 (diff) | |
gnu: Add pocl.
* gnu/packages/opencl.scm (pocl): New variable.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/opencl.scm | 62 |
1 files changed, 60 insertions, 2 deletions
diff --git a/gnu/packages/opencl.scm b/gnu/packages/opencl.scm index 644cd95e934..42cedd15445 100644 --- a/gnu/packages/opencl.scm +++ b/gnu/packages/opencl.scm | |||
| @@ -24,11 +24,13 @@ | |||
| 24 | #:use-module ((guix licenses) #:prefix license:) | 24 | #:use-module ((guix licenses) #:prefix license:) |
| 25 | #:use-module (guix packages) | 25 | #:use-module (guix packages) |
| 26 | #:use-module (gnu packages) | 26 | #:use-module (gnu packages) |
| 27 | #:use-module (gnu packages autotools) | ||
| 27 | #:use-module (gnu packages gl) | 28 | #:use-module (gnu packages gl) |
| 28 | #:use-module (gnu packages gnupg) | 29 | #:use-module (gnu packages gnupg) |
| 29 | #:use-module (gnu packages compression) | 30 | #:use-module (gnu packages compression) |
| 30 | #:use-module (gnu packages libedit) | 31 | #:use-module (gnu packages libedit) |
| 31 | #:use-module (gnu packages llvm) | 32 | #:use-module (gnu packages llvm) |
| 33 | #:use-module (gnu packages mpi) | ||
| 32 | #:use-module (gnu packages ncurses) | 34 | #:use-module (gnu packages ncurses) |
| 33 | #:use-module (gnu packages pkg-config) | 35 | #:use-module (gnu packages pkg-config) |
| 34 | #:use-module (gnu packages python) | 36 | #:use-module (gnu packages python) |
| @@ -38,8 +40,8 @@ | |||
| 38 | #:use-module (gnu packages xorg)) | 40 | #:use-module (gnu packages xorg)) |
| 39 | 41 | ||
| 40 | ;; This file adds OpenCL implementation related packages. Due to the fact that | 42 | ;; This file adds OpenCL implementation related packages. Due to the fact that |
| 41 | ;; OpenCL devices are not available during build (store environment), tests are | 43 | ;; OpenCL devices like GPU are not available during build (store environment), |
| 42 | ;; all disabled. | 44 | ;; tests that require such devices are all disabled. |
| 43 | ;; Check https://lists.gnu.org/archive/html/guix-devel/2018-04/msg00293.html | 45 | ;; Check https://lists.gnu.org/archive/html/guix-devel/2018-04/msg00293.html |
| 44 | 46 | ||
| 45 | (define (make-opencl-headers major-version subversion) | 47 | (define (make-opencl-headers major-version subversion) |
| @@ -288,3 +290,59 @@ functions required to initialize the device, create the command queues, the | |||
| 288 | kernels and the programs, and run them on the GPU. The code also contains a | 290 | kernels and the programs, and run them on the GPU. The code also contains a |
| 289 | back-end for the LLVM compiler framework.") | 291 | back-end for the LLVM compiler framework.") |
| 290 | (license license:lgpl2.1+))) | 292 | (license license:lgpl2.1+))) |
| 293 | |||
| 294 | (define-public pocl | ||
| 295 | (package | ||
| 296 | (name "pocl") | ||
| 297 | (version "1.1") | ||
| 298 | (source (origin | ||
| 299 | (method url-fetch) | ||
| 300 | (uri (string-append | ||
| 301 | "https://github.com/pocl/pocl/archive/v" | ||
| 302 | version ".tar.gz")) | ||
| 303 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 304 | (sha256 | ||
| 305 | (base32 | ||
| 306 | "0lrw3hlb0w53xzmrf2hvbda406l70ar4gyadflvlkj4879lx138y")))) | ||
| 307 | (build-system cmake-build-system) | ||
| 308 | (native-inputs | ||
| 309 | `(("libltdl" ,libltdl) | ||
| 310 | ("pkg-config" ,pkg-config))) | ||
| 311 | (inputs | ||
| 312 | `(("clang" ,clang) | ||
| 313 | ("hwloc" ,hwloc "lib") | ||
| 314 | ("llvm" ,llvm) | ||
| 315 | ("ocl-icd" ,ocl-icd))) | ||
| 316 | (arguments | ||
| 317 | `(#:configure-flags | ||
| 318 | (list "-DENABLE_ICD=ON" | ||
| 319 | "-DENABLE_TESTSUITES=ON" | ||
| 320 | ;; We are not developers, don't run conformance suite. | ||
| 321 | "-DENABLE_CONFORMANCE=OFF" | ||
| 322 | (string-append "-DEXTRA_HOST_LD_FLAGS=-L" | ||
| 323 | (assoc-ref %build-inputs "libc") "/lib")) | ||
| 324 | #:phases | ||
| 325 | (modify-phases %standard-phases | ||
| 326 | (add-after 'install 'remove-headers | ||
| 327 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 328 | (let ((out (assoc-ref outputs "out"))) | ||
| 329 | (delete-file-recursively | ||
| 330 | (string-append out "/include")) | ||
| 331 | #t))) | ||
| 332 | (add-before 'check 'set-HOME | ||
| 333 | (lambda _ | ||
| 334 | (setenv "HOME" "/tmp") | ||
| 335 | #t))))) | ||
| 336 | (home-page "http://portablecl.org/") | ||
| 337 | (synopsis "Portable Computing Language (pocl), an OpenCL implementation") | ||
| 338 | (description | ||
| 339 | "Pocl is a portable implementation of the OpenCL standard (1.2 with some | ||
| 340 | 2.0 features supported). This project seeks to improve performance | ||
| 341 | portability of OpenCL programs with the kernel compiler and the task run-time, | ||
| 342 | reducing the need for target-dependent manual optimizations. | ||
| 343 | |||
| 344 | pocl uses Clang as an OpenCL C frontend and LLVM for kernel compiler | ||
| 345 | implementation, and as a portability layer. Thus, if your desired target has | ||
| 346 | an LLVM backend, it should be able to get OpenCL support easily by using | ||
| 347 | pocl.") | ||
| 348 | (license license:expat))) | ||
