From e5d0fa78a7751e3792a5b41d0c9d928f4b6ac81e Mon Sep 17 00:00:00 2001 From: Stefano Ragni Date: Tue, 12 May 2020 01:35:04 +0200 Subject: [PATCH 1/2] WIP --- common/shlibs | 2 ++ srcpkgs/SPIRV-LLVM-Translator-devel | 1 + srcpkgs/SPIRV-LLVM-Translator/template | 36 +++++++++++++++++++ srcpkgs/intel-compute-runtime/template | 28 +++++++++++++++ .../patches/musl.patch | 13 +++++++ srcpkgs/intel-graphics-compiler/template | 26 ++++++++++++++ srcpkgs/intel-opencl-clang/template | 22 ++++++++++++ 7 files changed, 128 insertions(+) create mode 120000 srcpkgs/SPIRV-LLVM-Translator-devel create mode 100644 srcpkgs/SPIRV-LLVM-Translator/template create mode 100644 srcpkgs/intel-compute-runtime/template create mode 100644 srcpkgs/intel-graphics-compiler/patches/musl.patch create mode 100644 srcpkgs/intel-graphics-compiler/template create mode 100644 srcpkgs/intel-opencl-clang/template diff --git a/common/shlibs b/common/shlibs index 7693053e46b..3449b1caf3b 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3876,3 +3876,5 @@ libhidrd_opt.so.0 hidrd-0.2.0_1 libhidrd_strm.so.0 hidrd-0.2.0_1 libhidrd_fmt.so.0 hidrd-0.2.0_1 libjcat.so.1 libjcat-0.1.2_1 +libLLVMSPIRVLib.so.10 SPIRV-LLVM-Translator-10.0.0_1 +libopencl-clang.so.10 intel-opencl-clang-10.0.0.1_1 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..1be0ff4278c --- /dev/null +++ b/srcpkgs/SPIRV-LLVM-Translator/template @@ -0,0 +1,36 @@ +# Template file for 'SPIRV-LLVM-Translator' +pkgname=SPIRV-LLVM-Translator +version=10.0.0 +revision=1 +wrksrc=SPIRV-LLVM-Translator-${version} +#create_wrksrc=yes +#archs="i686 x86_64" +build_style=cmake +configure_args="-DBUILD_SHARED_LIBS=ON" +#make_build_args="" +#make_install_args="" +#conf_files="" +#make_dirs="/var/log/dir 0755 root root" +#hostmakedepends="llvm10" +makedepends="clang-tools-extra llvm10" +depends="" +short_desc="library and tool for translation between LLVM IR and SPIR-V" +maintainer="Stefano Ragni " +license="custom:LLVM" +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="${makedepends} ${sourcepkg}-${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/pkgconfig + vmove "usr/lib/*.so" + } +} diff --git a/srcpkgs/intel-compute-runtime/template b/srcpkgs/intel-compute-runtime/template new file mode 100644 index 00000000000..6d31353efd6 --- /dev/null +++ b/srcpkgs/intel-compute-runtime/template @@ -0,0 +1,28 @@ +# Template file for 'intel-compute-runtime' +pkgname=intel-compute-runtime +version=20.18.16699 +revision=1 +wrksrc=compute-runtime-${version} +#create_wrksrc=yes +archs="i686* x86_64*" +build_style=cmake +#configure_args="" +#make_build_args="" +#make_install_args="" +#conf_files="" +#make_dirs="/var/log/dir 0755 root root" +hostmakedepends="pkg-config" +makedepends="intel-gmmlib-devel intel-graphics-compiler libexecinfo-devel" +depends="intel-gmmlib 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=04576130cbb72af19ef6c79092105af7c06df95d7b17769d8fd815fe81c42b12 + +CXXFLAGS+=" -lexecinfo" + +post_install() { + vlicense LICENSE +} diff --git a/srcpkgs/intel-graphics-compiler/patches/musl.patch b/srcpkgs/intel-graphics-compiler/patches/musl.patch new file mode 100644 index 00000000000..f8f50294678 --- /dev/null +++ b/srcpkgs/intel-graphics-compiler/patches/musl.patch @@ -0,0 +1,13 @@ +diff --git inc/common/UFO/portable_compiler.h inc/common/UFO/portable_compiler.h +index 8177776..5e3dabf 100644 +--- inc/common/UFO/portable_compiler.h ++++ inc/common/UFO/portable_compiler.h +@@ -125,7 +125,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + /* 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__ ) + + diff --git a/srcpkgs/intel-graphics-compiler/template b/srcpkgs/intel-graphics-compiler/template new file mode 100644 index 00000000000..573d61e6c8a --- /dev/null +++ b/srcpkgs/intel-graphics-compiler/template @@ -0,0 +1,26 @@ +# Template file for 'intel-graphics-compiler' +pkgname=intel-graphics-compiler +version=1.0.3899 +revision=1 +wrksrc=intel-graphics-compiler-igc-${version} +#create_wrksrc=yes +archs="i686* x86_64*" +build_style=cmake +configure_args="-DIGC_PREFERRED_LLVM_VERSION='10.0.0'" +#make_build_args="" +#make_install_args="" +#conf_files="" +#make_dirs="/var/log/dir 0755 root root" +hostmakedepends="bison flex" +makedepends="clang-tools-extra llvm10 intel-opencl-clang" +depends="" +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=fcb721a40a88e1c9bbd45281ba003cf519eaf648435896071bc1e8a80ef05e71 + +post_install() { + vlicense LICENSE.md +} diff --git a/srcpkgs/intel-opencl-clang/template b/srcpkgs/intel-opencl-clang/template new file mode 100644 index 00000000000..fc4a7cfd5fd --- /dev/null +++ b/srcpkgs/intel-opencl-clang/template @@ -0,0 +1,22 @@ +# Template file for 'intel-opencl-clang' +pkgname=intel-opencl-clang +version=10.0.0.1 +_version=10.0.0-1 +revision=1 +wrksrc=opencl-clang-${_version} +#create_wrksrc=yes +archs="i686* x86_64*" +build_style=cmake +#configure_args="" +#make_build_args="" +#make_install_args="" +#conf_files="" +#make_dirs="/var/log/dir 0755 root root" +makedepends="llvm10 SPIRV-LLVM-Translator-devel" +depends="" +short_desc="wrapper library around clang" +maintainer="Stefano Ragni " +license="custom:LLVM" +homepage="https://github.com/intel/opencl-clang" +distfiles="https://github.com/intel/opencl-clang/archive/v${_version}.tar.gz" +checksum=815005b6fb7fd8fd2f08b9036035d3aa9543f5ce8464e41ef2f2ed08a816f507 From b57759d5fdde339859d492ff9a97848c7ababe47 Mon Sep 17 00:00:00 2001 From: Stefano Ragni Date: Tue, 12 May 2020 08:20:13 +0200 Subject: [PATCH 2/2] igc: tmp libpath patch, neo: rm execinfo for now [skip ci] --- srcpkgs/intel-compute-runtime/template | 5 +++-- .../patches/fix-LLVM-library-path.patch | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/intel-graphics-compiler/patches/fix-LLVM-library-path.patch diff --git a/srcpkgs/intel-compute-runtime/template b/srcpkgs/intel-compute-runtime/template index 6d31353efd6..780d2401488 100644 --- a/srcpkgs/intel-compute-runtime/template +++ b/srcpkgs/intel-compute-runtime/template @@ -12,7 +12,8 @@ build_style=cmake #conf_files="" #make_dirs="/var/log/dir 0755 root root" hostmakedepends="pkg-config" -makedepends="intel-gmmlib-devel intel-graphics-compiler libexecinfo-devel" +#makedepends="intel-gmmlib-devel intel-graphics-compiler libexecinfo-devel" TODO +makedepends="intel-gmmlib-devel intel-graphics-compiler" depends="intel-gmmlib intel-graphics-compiler" short_desc="Intel Graphics Compute Runtime for OpenCL (Broadwell+)" maintainer="Stefano Ragni " @@ -21,7 +22,7 @@ homepage="https://github.com/intel/compute-runtime" distfiles="https://github.com/intel/compute-runtime/archive/${version}.tar.gz" checksum=04576130cbb72af19ef6c79092105af7c06df95d7b17769d8fd815fe81c42b12 -CXXFLAGS+=" -lexecinfo" +#CXXFLAGS+=" -lexecinfo" TODO: see if it helps on musl post_install() { vlicense LICENSE diff --git a/srcpkgs/intel-graphics-compiler/patches/fix-LLVM-library-path.patch b/srcpkgs/intel-graphics-compiler/patches/fix-LLVM-library-path.patch new file mode 100644 index 00000000000..b379245dfee --- /dev/null +++ b/srcpkgs/intel-graphics-compiler/patches/fix-LLVM-library-path.patch @@ -0,0 +1,19 @@ +diff --git a/IGC/CMakeLists.txt b/IGC/CMakeLists.txt +index 8c9a5fcc..3b5e88cf 100644 +--- IGC/CMakeLists.txt ++++ IGC/CMakeLists.txt +@@ -3271,8 +3271,12 @@ endif() + if(LLVM_LINK_LLVM_DYLIB) + # LLVM was built and configured in a way that tools (in our case IGC) should be linked + # against single LLVM dynamic library. +- set(IGC_BUILD__LLVM_LIBS_TO_LINK "/usr/local/lib/libLLVM-${LLVM_VERSION_MAJOR}.so") +- message(STATUS "[IGC] Link against LLVM dylib ${IGC_BUILD__LLVM_LIBS_TO_LINK}") ++ find_library(IGC_BUILD__LLVM_LIBS_TO_LINK "libLLVM-${LLVM_VERSION_MAJOR}.so") ++ if(IGC_BUILD__LLVM_LIBS_TO_LINK) ++ message(STATUS "[IGC] Link against LLVM dylib ${IGC_BUILD__LLVM_LIBS_TO_LINK}") ++ else() ++ message(FATAL_ERROR "[IGC] Could not find the LLVM dylib. Aborting.") ++ endif() + else() + # LLVM was built into multiple libraries (static or shared). + message(STATUS "[IGC] Link against LLVM static or shared component libs")