Github messages for voidlinux
 help / color / mirror / Atom feed
From: st3r4g <st3r4g@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: intel-compute-runtime-20.18.16699
Date: Fri, 22 May 2020 23:05:25 +0200	[thread overview]
Message-ID: <20200522210525.ChS8yq7sqx5OCjd7_SPbyYV7UqNDZypBdztJOa17Upo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-21855@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

There is an updated pull request by st3r4g against master on the void-packages repository

https://github.com/st3r4g/void-packages intel-compute-runtime
https://github.com/void-linux/void-packages/pull/21855

New package: intel-compute-runtime-20.18.16699
Closes #11364

Resumed the work I did some time ago, mainly updated the templates to use `llvm10`. Opening this as a draft for now because I remember musl requiring to be patched (I gave up back then), any help is welcome.

@ericonr 

A patch file from https://github.com/void-linux/void-packages/pull/21855.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-intel-compute-runtime-21855.patch --]
[-- Type: text/x-diff, Size: 13032 bytes --]

From 1cab26fc42c23fd2ceb4cc5da8f03358e683bb41 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 16 May 2020 16:12:58 +0200
Subject: [PATCH 1/5] common/shlibs: add libLLVMSPIRVLib,libopencl-clang

---
 common/shlibs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/shlibs b/common/shlibs
index 477ce5f2d3f..1fa133816c4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3892,3 +3892,5 @@ libvips.so.42 libvips-8.9.2_1
 libvips-cpp.so.42 libvips-8.9.2_1
 libselinux.so.1 libselinux-3.0_1
 libsepol.so.1 libsepol-3.0_1
+libLLVMSPIRVLib.so.10 SPIRV-LLVM-Translator-10.0.0_1
+libopencl-clang.so.10 intel-opencl-clang-10.0.0.1_1

From 876a6d9e6ad45c1a3d7269be9050d9edab822a0c Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 16 May 2020 16:15:13 +0200
Subject: [PATCH 2/5] New package: SPIRV-LLVM-Translator-10.0.0

---
 srcpkgs/SPIRV-LLVM-Translator-devel    |  1 +
 srcpkgs/SPIRV-LLVM-Translator/template | 29 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 120000 srcpkgs/SPIRV-LLVM-Translator-devel
 create mode 100644 srcpkgs/SPIRV-LLVM-Translator/template

diff --git a/srcpkgs/SPIRV-LLVM-Translator-devel b/srcpkgs/SPIRV-LLVM-Translator-devel
new file mode 120000
index 00000000000..170ae65aeda
--- /dev/null
+++ b/srcpkgs/SPIRV-LLVM-Translator-devel
@@ -0,0 +1 @@
+SPIRV-LLVM-Translator
\ No newline at end of file
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
new file mode 100644
index 00000000000..89befc40dd0
--- /dev/null
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -0,0 +1,29 @@
+# Template file for 'SPIRV-LLVM-Translator'
+pkgname=SPIRV-LLVM-Translator
+version=10.0.0
+revision=1
+archs="x86_64*"
+wrksrc=SPIRV-LLVM-Translator-${version}
+build_style=cmake
+configure_args="-DBUILD_SHARED_LIBS=ON"
+makedepends="clang-tools-extra llvm"
+short_desc="Library and tool for translation between LLVM IR and SPIR-V"
+maintainer="Stefano Ragni <st3r4g@protonmail.com>"
+license="NCSA"
+homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/v${version}.tar.gz"
+checksum=7ccde52bac4c9ad967a362a3c5ec7261aa5b7b34d28cef0f3dec38d77c923049
+
+post_install() {
+	vlicense LICENSE.TXT
+}
+
+SPIRV-LLVM-Translator-devel_package() {
+	depends="${sourcepkg}-${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 0cccdd475c084979365a55c5e644ad699f0d8c84 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 16 May 2020 16:16:36 +0200
Subject: [PATCH 3/5] New package: intel-opencl-clang-10.0.0.1

---
 srcpkgs/intel-opencl-clang-devel    |  1 +
 srcpkgs/intel-opencl-clang/template | 30 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/intel-opencl-clang-devel
 create mode 100644 srcpkgs/intel-opencl-clang/template

diff --git a/srcpkgs/intel-opencl-clang-devel b/srcpkgs/intel-opencl-clang-devel
new file mode 120000
index 00000000000..9840099b161
--- /dev/null
+++ b/srcpkgs/intel-opencl-clang-devel
@@ -0,0 +1 @@
+intel-opencl-clang
\ No newline at end of file
diff --git a/srcpkgs/intel-opencl-clang/template b/srcpkgs/intel-opencl-clang/template
new file mode 100644
index 00000000000..9cc8889cedd
--- /dev/null
+++ b/srcpkgs/intel-opencl-clang/template
@@ -0,0 +1,30 @@
+# Template file for 'intel-opencl-clang'
+pkgname=intel-opencl-clang
+version=10.0.0.1
+revision=1
+_version=${version%.*}-${version##*.}
+archs="x86_64*"
+wrksrc=opencl-clang-${_version}
+build_style=cmake
+makedepends="clang-tools-extra llvm SPIRV-LLVM-Translator-devel"
+short_desc="Wrapper library to compile OpenCL C kernels to SPIR-V modules"
+maintainer="Stefano Ragni <st3r4g@protonmail.com>"
+license="NCSA"
+homepage="https://github.com/intel/opencl-clang"
+distfiles="https://github.com/intel/opencl-clang/archive/v${_version}.tar.gz"
+checksum=815005b6fb7fd8fd2f08b9036035d3aa9543f5ce8464e41ef2f2ed08a816f507
+
+nocross="https://travis-ci.org/github/st3r4g/void-packages/jobs/686510849#L4390"
+
+post_install() {
+	vlicense LICENSE
+}
+
+intel-opencl-clang-devel_package() {
+	depends="${sourcepkg}-${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+	}
+}

From eba0e7fc8473db7600ffef1c5b9b0c3feb7f04a0 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 16 May 2020 16:17:54 +0200
Subject: [PATCH 4/5] New package: intel-graphics-compiler-1.0.3977

---
 srcpkgs/intel-graphics-compiler-devel         |  1 +
 .../patches/musl.patch                        | 21 +++++++++++++
 srcpkgs/intel-graphics-compiler/template      | 30 +++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 120000 srcpkgs/intel-graphics-compiler-devel
 create mode 100644 srcpkgs/intel-graphics-compiler/patches/musl.patch
 create mode 100644 srcpkgs/intel-graphics-compiler/template

diff --git a/srcpkgs/intel-graphics-compiler-devel b/srcpkgs/intel-graphics-compiler-devel
new file mode 120000
index 00000000000..3b09034b520
--- /dev/null
+++ b/srcpkgs/intel-graphics-compiler-devel
@@ -0,0 +1 @@
+intel-graphics-compiler
\ No newline at end of file
diff --git a/srcpkgs/intel-graphics-compiler/patches/musl.patch b/srcpkgs/intel-graphics-compiler/patches/musl.patch
new file mode 100644
index 00000000000..7c802631ec6
--- /dev/null
+++ b/srcpkgs/intel-graphics-compiler/patches/musl.patch
@@ -0,0 +1,21 @@
+--- inc/common/UFO/portable_compiler.h.orig	2020-05-13 11:41:37.725900359 +0200
++++ inc/common/UFO/portable_compiler.h	2020-05-13 11:42:26.407898739 +0200
+@@ -125,7 +125,7 @@
+ /* compile-time ASSERT */
+ 
+ #ifndef C_ASSERT
+-    #define __UNIQUENAME( a1, a2 )  __CONCAT( a1, a2 )
++    #define __UNIQUENAME( a1, a2 )  a1 ## a2
+     #define UNIQUENAME( __text )    __UNIQUENAME( __text, __COUNTER__ )
+ 
+ 
+--- visa/CISA.y.orig	2020-05-13 11:42:12.245899211 +0200
++++ visa/CISA.y	2020-05-13 11:42:26.410898739 +0200
+@@ -25,6 +25,7 @@
+ ======================= end_copyright_notice ==================================*/
+ 
+ %{
++#include <inttypes.h>
+ #include <stdio.h>
+ #include <math.h>
+ #include <string>
diff --git a/srcpkgs/intel-graphics-compiler/template b/srcpkgs/intel-graphics-compiler/template
new file mode 100644
index 00000000000..9f17c2d5361
--- /dev/null
+++ b/srcpkgs/intel-graphics-compiler/template
@@ -0,0 +1,30 @@
+# Template file for 'intel-graphics-compiler'
+pkgname=intel-graphics-compiler
+version=1.0.3977
+revision=1
+archs="x86_64*"
+wrksrc=intel-graphics-compiler-igc-${version}
+build_style=cmake
+configure_args="-DIGC_PREFERRED_LLVM_VERSION='10.0.0' -Wno-dev"
+hostmakedepends="bison flex"
+makedepends="clang-tools-extra llvm intel-opencl-clang-devel"
+short_desc="Intel Graphics Compiler for OpenCL"
+maintainer="Stefano Ragni <st3r4g@protonmail.com>"
+license="MIT"
+homepage="https://github.com/intel/intel-graphics-compiler"
+distfiles="https://github.com/intel/intel-graphics-compiler/archive/igc-${version}.tar.gz"
+checksum=60641b21c01f97f4b2a1881f7562449c733fdde9108b7e4ad5be2b4db38ceae6
+
+post_install() {
+	vlicense LICENSE.md
+}
+
+intel-graphics-compiler-devel_package() {
+	depends="${sourcepkg}-${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From d27437f0d2cbb80fbf52417a57f4e4f48267f412 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 16 May 2020 16:18:46 +0200
Subject: [PATCH 5/5] New package: intel-compute-runtime-20.20.16837

---
 .../patches/musl-ioctl.patch                  | 14 +++++++++
 .../patches/musl-pthread_yield.patch          | 20 +++++++++++++
 .../patches/musl-rtld-global.patch            | 11 +++++++
 .../patches/musl-select.patch                 | 13 +++++++++
 srcpkgs/intel-compute-runtime/template        | 29 +++++++++++++++++++
 5 files changed, 87 insertions(+)
 create mode 100644 srcpkgs/intel-compute-runtime/patches/musl-ioctl.patch
 create mode 100644 srcpkgs/intel-compute-runtime/patches/musl-pthread_yield.patch
 create mode 100644 srcpkgs/intel-compute-runtime/patches/musl-rtld-global.patch
 create mode 100644 srcpkgs/intel-compute-runtime/patches/musl-select.patch
 create mode 100644 srcpkgs/intel-compute-runtime/template

diff --git a/srcpkgs/intel-compute-runtime/patches/musl-ioctl.patch b/srcpkgs/intel-compute-runtime/patches/musl-ioctl.patch
new file mode 100644
index 00000000000..2accb14d9d2
--- /dev/null
+++ b/srcpkgs/intel-compute-runtime/patches/musl-ioctl.patch
@@ -0,0 +1,14 @@
+--- opencl/test/unit_test/linux/mock_os_layer.h.orig	2020-05-12 23:23:47.438463587 +0200
++++ opencl/test/unit_test/linux/mock_os_layer.h	2020-05-12 23:26:38.282470463 +0200
+@@ -20,7 +20,11 @@
+ 
+ extern "C" {
+ int open(const char *pathname, int flags, ...);
++#ifdef __GLIBC__
+ int ioctl(int fd, unsigned long int request, ...) throw();
++#else
++int ioctl(int fd, int request, ...) throw();
++#endif
+ }
+ 
+ extern int (*c_open)(const char *pathname, int flags, ...);
diff --git a/srcpkgs/intel-compute-runtime/patches/musl-pthread_yield.patch b/srcpkgs/intel-compute-runtime/patches/musl-pthread_yield.patch
new file mode 100644
index 00000000000..2f609838418
--- /dev/null
+++ b/srcpkgs/intel-compute-runtime/patches/musl-pthread_yield.patch
@@ -0,0 +1,20 @@
+--- opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp.orig	2020-05-12 23:05:41.057419864 +0200
++++ opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp	2020-05-12 23:06:01.992420706 +0200
+@@ -121,7 +121,7 @@
+ 
+     //wait for worker to complete or deadCnt drops
+     while (!worker->isEmpty() && (deadCnt-- > 0))
+-        pthread_yield(); //yield to another threads
++        sched_yield(); //yield to another threads
+ 
+     worker->close(false);
+ 
+@@ -142,7 +142,7 @@
+ 
+     //wait for worker to complete or deadCnt drops
+     while (!worker->isEmpty() && (deadCnt-- > 0))
+-        pthread_yield(); //yield to another threads
++        sched_yield(); //yield to another threads
+ 
+     //and check if GEM was closed
+     EXPECT_EQ(1, this->drmMock->gem_close_cnt.load());
diff --git a/srcpkgs/intel-compute-runtime/patches/musl-rtld-global.patch b/srcpkgs/intel-compute-runtime/patches/musl-rtld-global.patch
new file mode 100644
index 00000000000..745d04d0a26
--- /dev/null
+++ b/srcpkgs/intel-compute-runtime/patches/musl-rtld-global.patch
@@ -0,0 +1,11 @@
+--- shared/source/os_interface/linux/os_library_linux.cpp.orig	2020-05-12 21:02:19.995121993 +0200
++++ shared/source/os_interface/linux/os_library_linux.cpp	2020-05-12 21:03:20.426124425 +0200
+@@ -30,7 +30,7 @@
+         this->handle = dlopen(0, RTLD_LAZY);
+     } else {
+ #ifdef SANITIZER_BUILD
+-        constexpr auto dlopenFlag = RTLD_LAZY;
++        constexpr auto dlopenFlag = RTLD_LAZY | RTLD_GLOBAL;
+ #else
+         constexpr auto dlopenFlag = RTLD_LAZY | RTLD_DEEPBIND;
+ #endif
diff --git a/srcpkgs/intel-compute-runtime/patches/musl-select.patch b/srcpkgs/intel-compute-runtime/patches/musl-select.patch
new file mode 100644
index 00000000000..ce64516df04
--- /dev/null
+++ b/srcpkgs/intel-compute-runtime/patches/musl-select.patch
@@ -0,0 +1,13 @@
+This macro conflicts with the select syscall. Since it isn't actually used, we
+just remove it.
+--- opencl/source/builtin_kernels_simulation/opencl_c.h.orig	2020-04-30 12:24:42.000000000 +0200
++++ opencl/source/builtin_kernels_simulation/opencl_c.h	2020-05-12 22:31:37.166337603 +0200
+@@ -220,8 +220,6 @@
+     (                               \
+         (type)var)
+ 
+-#define select(a, b, c) (c ? b : a)
+-
+ uint get_local_id(int dim);
+ uint get_global_id(int dim);
+ uint get_local_size(int dim);
diff --git a/srcpkgs/intel-compute-runtime/template b/srcpkgs/intel-compute-runtime/template
new file mode 100644
index 00000000000..9ba842ba5ef
--- /dev/null
+++ b/srcpkgs/intel-compute-runtime/template
@@ -0,0 +1,29 @@
+# Template file for 'intel-compute-runtime'
+pkgname=intel-compute-runtime
+version=20.20.16837
+revision=1
+archs="x86_64*"
+wrksrc=compute-runtime-${version}
+build_style=cmake
+hostmakedepends="pkg-config"
+makedepends="intel-gmmlib-devel intel-graphics-compiler-devel"
+depends="intel-graphics-compiler"
+short_desc="Intel Graphics Compute Runtime for OpenCL (Broadwell+)"
+maintainer="Stefano Ragni <st3r4g@protonmail.com>"
+license="MIT"
+homepage="https://github.com/intel/compute-runtime"
+distfiles="https://github.com/intel/compute-runtime/archive/${version}.tar.gz"
+checksum=975787ced1800ea52ece2ca40c23c4cac9267a358957c4a7f5255d22dc6a6d5f
+
+if [ -z "${XBPS_CHECK_PKGS}" ]; then
+	configure_args+=" -DSKIP_UNIT_TESTS=1"
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	makedepends+=" libexecinfo-devel"
+	CXXFLAGS+=" -lexecinfo -DSANITIZER_BUILD"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

  parent reply	other threads:[~2020-05-22 21:05 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 23:48 [PR PATCH] " st3r4g
2020-05-12  6:21 ` [PR PATCH] [Updated] " st3r4g
2020-05-12  7:18 ` st3r4g
2020-05-12  7:26 ` st3r4g
2020-05-12  8:13 ` ericonr
2020-05-12 18:02 ` ericonr
2020-05-12 19:17 ` st3r4g
2020-05-12 20:15 ` [PR PATCH] [Updated] " st3r4g
2020-05-12 21:36 ` st3r4g
2020-05-12 22:22 ` st3r4g
2020-05-12 22:38 ` st3r4g
2020-05-13  9:54 ` [PR PATCH] [Updated] " st3r4g
2020-05-13 10:04 ` st3r4g
2020-05-13 12:25 ` st3r4g
2020-05-14 19:11 ` [PR PATCH] [Updated] " st3r4g
2020-05-14 21:09 ` st3r4g
2020-05-16 14:19 ` st3r4g
2020-05-16 14:23 ` st3r4g
2020-05-18  1:58 ` ericonr
2020-05-18  2:04 ` ericonr
2020-05-18  2:08 ` ericonr
2020-05-18  2:27 ` ericonr
2020-05-18  2:40 ` ericonr
2020-05-18  2:42 ` ericonr
2020-05-18  2:42 ` ericonr
2020-05-18  8:27 ` st3r4g
2020-05-18 21:55 ` [PR PATCH] [Updated] " st3r4g
2020-05-22 20:09 ` ericonr
2020-05-22 21:05 ` st3r4g [this message]
2020-05-22 21:07 ` st3r4g
2020-05-22 21:08 ` ericonr
2020-05-22 21:18 ` st3r4g
2020-05-22 21:21 ` [PR PATCH] [Updated] " st3r4g
2020-05-29 17:55 ` New package: intel-compute-runtime-20.20.16837 ericonr
2020-05-29 18:03 ` ericonr
2020-05-29 18:07 ` ericonr
2020-05-29 20:22 ` ericonr
2020-05-29 20:23 ` ericonr
2020-05-29 20:27 ` [PR PATCH] [Updated] " st3r4g
2020-11-22  5:17 ` New package: intel-compute-runtime-20.21.16886 the-maldridge
2020-11-22 15:02 ` ericonr
2020-11-22 15:02 ` ericonr
2020-11-22 17:45 ` st3r4g
2021-05-19  3:51 ` ericonr
2022-04-16  2:02 ` github-actions
2022-05-01  2:13 ` [PR PATCH] [Closed]: " github-actions

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200522210525.ChS8yq7sqx5OCjd7_SPbyYV7UqNDZypBdztJOa17Upo@z \
    --to=st3r4g@users.noreply.github.com \
    --cc=ml@inbox.vuxu.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.
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 NNTP newsgroup(s).