From: Fis Trivial <ybbs.daans@hotmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: "31436@debbugs.gnu.org" <31436@debbugs.gnu.org>
Subject: [bug#31436] [PATCH 3/3] gnu: Add beignet.
Date: Tue, 26 Jun 2018 19:40:31 +0000 [thread overview]
Message-ID: <SN1PR16MB051193DD65457EAA67E270A192490@SN1PR16MB0511.namprd16.prod.outlook.com> (raw)
In-Reply-To: <87in654q79.fsf@gnu.org>
* gnu/packages/opencl.scm (beignet): New variable.
* gnu/packages/patches/beignet-correct-paths.patch: New file.
* gnu/local.mk: Add it.
---
gnu/local.mk | 1 +
gnu/packages/opencl.scm | 81 +++++++++++++++++++++++-
gnu/packages/patches/beignet-correct-paths.patch | 41 ++++++++++++
3 files changed, 121 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/beignet-correct-paths.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 30d314c88..07cff9b0c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -583,6 +583,7 @@ dist_patch_DATA = \
%D%/packages/patches/azr3.patch \
%D%/packages/patches/bash-completion-directories.patch \
%D%/packages/patches/bazaar-CVE-2017-14176.patch \
+ %D%/packages/patches/beignet-correct-paths.patch \
%D%/packages/patches/bind-CVE-2018-5738.patch \
%D%/packages/patches/binutils-aarch64-symbol-relocation.patch \
%D%/packages/patches/binutils-loongson-workaround.patch \
diff --git a/gnu/packages/opencl.scm b/gnu/packages/opencl.scm
index 0c2f7d147..ca633f8de 100644
--- a/gnu/packages/opencl.scm
+++ b/gnu/packages/opencl.scm
@@ -21,11 +21,21 @@
#:use-module (guix build-system cmake)
#:use-module (guix download)
#:use-module (guix git-download)
- #:use-module (guix packages)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages gl)
#:use-module (gnu packages gnupg)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu packages libedit)
+ #:use-module (gnu packages llvm)
+ #:use-module (gnu packages ncurses)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
- #:use-module (gnu packages ruby))
+ #:use-module (gnu packages ruby)
+ #:use-module (gnu packages video)
+ #:use-module (gnu packages xdisorg)
+ #:use-module (gnu packages xorg))
;; This file adds OpenCL implementation related packages. Due to the fact that
;; OpenCL devices are not available during build (store environment), tests are
@@ -198,3 +208,70 @@ and devices in the system")
enumerates all possible (known) properties of the OpenCL platform and devices
available on the Guix.")
(license license:non-copyleft)))
+
+(define-public beignet
+ (package
+ (name "beignet")
+ (version "1.3.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/intel/beignet/archive/Release_v"
+ version
+ ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "18r0lq3dkd4yn6bxa45s2lrr9cjbg70nr2nn6xablvgqwzw0jb0r"))
+ (patches (search-patches "beignet-correct-paths.patch"))))
+ (native-inputs `(("pkg-config" ,pkg-config)
+ ("python" ,python)))
+ (inputs `(("clang@3.7" ,clang-3.7)
+ ("clang-runtime@3.7" ,clang-runtime-3.7)
+ ("glu" ,glu)
+ ("llvm@3.7" ,llvm-3.7)
+ ("libdrm" ,libdrm)
+ ("libedit" ,libedit)
+ ("libpthread-stubs", libpthread-stubs)
+ ("libsm" ,libsm)
+ ("libva" ,libva)
+ ("libxfixes" ,libxfixes)
+ ("libxext" ,libxext)
+ ("mesa-utils" ,mesa-utils)
+ ("ncurses" ,ncurses)
+ ("ocl-icd" ,ocl-icd)
+ ("opencl-headers" ,opencl-headers)
+ ("xextproto" ,xextproto)
+ ("zlib" ,zlib)))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list (string-append "-DCLANG_LIBRARY_DIR="
+ (assoc-ref %build-inputs "clang@3.7") "/lib")
+ "-DENABLE_GL_SHARING=ON"
+ "-DEXPERIMENTAL_DOUBLE=ON")
+ #: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")))))
+ (add-after 'remove-headers 'install-kernels
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (builddir (getcwd))
+ (source-dir (string-append
+ builddir
+ "/../beignet-Release_v1.3.2/kernels")))
+ (copy-recursively source-dir (string-append
+ out
+ "/lib/beignet/kernels"))))))
+ ;; Beignet tries to find GPU when running tests, which is not available
+ ;; during build.
+ #:tests? #f))
+ (home-page "https://wiki.freedesktop.org/www/Software/Beignet/")
+ (synopsis "Intel's OpenCL framework")
+ (description "Intel's OpenCL framework that works with Intel IvyBridge GPUs
+and above.")
+ (license license:gpl2)))
diff --git a/gnu/packages/patches/beignet-correct-paths.patch b/gnu/packages/patches/beignet-correct-paths.patch
new file mode 100644
index 000000000..0435f9503
--- /dev/null
+++ b/gnu/packages/patches/beignet-correct-paths.patch
@@ -0,0 +1,41 @@
+From 0ba525465782ec3fd6484b7483941344f293d3ab Mon Sep 17 00:00:00 2001
+From: fis <ybbs.daans@hotmail.com>
+Date: Sun, 8 Apr 2018 02:14:44 +0800
+Subject: [PATCH] Correct paths.
+
+* CMake/FindLLVM.cmake (CLANG_LIBRARY_DIR): New vairable.
+* CMakelists: Let cmake figure out where to install icd file.
+---
+ CMake/FindLLVM.cmake | 2 +-
+ CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake
+index 5457f248..e8e8f94a 100644
+--- a/CMake/FindLLVM.cmake
++++ b/CMake/FindLLVM.cmake
+@@ -107,7 +107,7 @@ endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
+ macro(add_one_lib name)
+ FIND_LIBRARY(CLANG_LIB
+ NAMES ${name}
+- PATHS ${LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
++ PATHS ${CLANG_LIBRARY_DIR} NO_DEFAULT_PATH)
+ set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_LIB})
+ unset(CLANG_LIB CACHE)
+ endmacro()
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c11acbb2..fb99e5c8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -217,7 +217,7 @@ IF(OCLIcd_FOUND)
+ "intel-beignet.icd.in"
+ "${ICD_FILE_NAME}"
+ )
+- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION /etc/OpenCL/vendors)
++ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION etc/OpenCL/vendors COMPONENT config)
+ ELSE(OCLIcd_FOUND)
+ MESSAGE(STATUS "Looking for OCL ICD header file - not found")
+ MESSAGE(FATAL_ERROR "OCL ICD loader miss. If you really want to disable OCL ICD support, please run cmake with option -DOCLICD_COMPAT=0.")
+--
+2.14.3
+
--
2.14.4
next prev parent reply other threads:[~2018-06-26 19:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-12 19:46 [bug#31436] [PATCH 0/6] gnu: Add opencl related packages Fis Trivial
2018-05-12 19:49 ` [bug#31436] [PATCH 1/6] gnu: Add opencl-headers Fis Trivial
2018-05-12 19:49 ` [bug#31436] [PATCH 2/6] gnu: Add opencl-clhpp Fis Trivial
2018-05-12 19:50 ` [bug#31436] [PATCH 3/6] gnu: Add ocl-icd Fis Trivial
2018-05-12 19:50 ` [bug#31436] [PATCH 4/6] gnu: Add beignet Fis Trivial
2018-05-12 19:51 ` [bug#31436] [PATCH 5/6] gnu: Add clinfo Fis Trivial
2018-05-12 19:52 ` [bug#31436] [PATCH 6/6] gnu: Add pocl Fis Trivial
2018-05-26 17:42 ` [bug#31436] [PATCH 0/6] gnu: Add opencl related packages Fis Trivial
2018-05-28 12:51 ` Ludovic Courtès
2018-06-25 20:22 ` Ludovic Courtès
2018-06-25 20:58 ` Fis Trivial
2018-06-26 13:44 ` Ludovic Courtès
2018-06-26 18:49 ` Fis Trivial
2018-06-26 19:37 ` [bug#31436] [PATCH 0/3] Resend some opencl packages Fis Trivial
2018-06-26 19:39 ` [bug#31436] [PATCH 1/3] gnu: Add ocl-icd Fis Trivial
2018-06-26 20:26 ` Ludovic Courtès
2018-06-26 20:57 ` Fis Trivial
2018-06-26 19:39 ` [bug#31436] [PATCH 2/3] gnu: Add clinfo Fis Trivial
2018-06-26 20:32 ` Ludovic Courtès
2018-06-26 19:40 ` Fis Trivial [this message]
2018-06-26 21:00 ` bug#31436: [PATCH 3/3] gnu: Add beignet Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SN1PR16MB051193DD65457EAA67E270A192490@SN1PR16MB0511.namprd16.prod.outlook.com \
--to=ybbs.daans@hotmail.com \
--cc=31436@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).