From 1cab26fc42c23fd2ceb4cc5da8f03358e683bb41 Mon Sep 17 00:00:00 2001 From: Stefano Ragni 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 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 " +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 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 " +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 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 + #include + #include + #include 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 " +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 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 " +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 +}