From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHaYp-0006Rn-0j for guix-patches@gnu.org; Sat, 12 May 2018 15:52:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHaYl-0002XG-3c for guix-patches@gnu.org; Sat, 12 May 2018 15:52:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51962) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHaYk-0002XC-VS for guix-patches@gnu.org; Sat, 12 May 2018 15:52:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fHaYk-0000A4-GA for guix-patches@gnu.org; Sat, 12 May 2018 15:52:02 -0400 Subject: [bug#31436] [PATCH 4/6] gnu: Add beignet. References: In-Reply-To: Resent-Message-ID: From: Fis Trivial Date: Sat, 12 May 2018 19:50:53 +0000 Message-ID: Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: "31436@debbugs.gnu.org" <31436@debbugs.gnu.org> * gnu/packages/patches/beignet-correct-paths.patch: New file. * gnu/local.mk: Add it. * gnu/packages/opencl.scm (beignet): New variable. --- gnu/local.mk | 1 + gnu/packages/opencl.scm | 81 ++++++++++++++++++++= +++- gnu/packages/patches/beignet-correct-paths.patch | 41 ++++++++++++ 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/beignet-correct-paths.patch diff --git a/gnu/local.mk b/gnu/local.mk index 39d53586d..2631b070e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -580,6 +580,7 @@ dist_patch_DATA =3D \ %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/binutils-ld-new-dtags.patch \ %D%/packages/patches/binutils-loongson-workaround.patch \ %D%/packages/patches/blast+-fix-makefile.patch \ diff --git a/gnu/packages/opencl.scm b/gnu/packages/opencl.scm index a7b639b8c..a84eeac01 100644 --- a/gnu/packages/opencl.scm +++ b/gnu/packages/opencl.scm @@ -23,9 +23,20 @@ #:use-module (guix git-download) #:use-module (guix packages) #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #: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 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)) =20 ;; This file adds OpenCL implementation related packages. Due to the fact = that ;; OpenCL devices are not available during build (store environment), test= s are @@ -151,3 +162,71 @@ Driver). An OpenCL program can use several ICD thanks= to the use of an ICD Loader as provided by this project. This free ICD Loader can load any (fr= ee or non free) ICD") (license license:bsd-2))) + +(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=3D" + (assoc-ref %build-inputs "clang@3.7") "/lib") + "-DENABLE_GL_SHARING=3DON" + "-DEXPERIMENTAL_DOUBLE=3DON") + #: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"))))) + ;; Kernel files are used for testing. But we don't have test here= yet. + ;; So copying kernels is just a reminder for the future when we c= an + ;; enable tests. + (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")))))) + #: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:lgpl2.1))) diff --git a/gnu/packages/patches/beignet-correct-paths.patch b/gnu/package= s/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 +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=3D0.") +--=20 +2.14.3 + --=20 2.14.3