From f6889aff2f9c9695aaa77ddfd1661596f0c296a2 Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Tue, 11 Apr 2023 10:23:12 +0200 Subject: [PATCH] Updated to version 3.1. Fixed FTBFS on Fedora 37+. Performed major SPEC cleanup. Switched to SPDX license tag. --- .gitignore | 5 +- pocl.spec | 141 +++++++++++++++++++++++------------------------------ sources | 2 +- 3 files changed, 64 insertions(+), 84 deletions(-) diff --git a/.gitignore b/.gitignore index 896492c..adc08c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ -*.rpm -*.tar* -results_*/ -/pocl-a0b083a1b47a7389f896036087b4e712b4b14193.xz +/pocl-*.tar.gz diff --git a/pocl.spec b/pocl.spec index 7b426a1..e6e5705 100644 --- a/pocl.spec +++ b/pocl.spec @@ -1,45 +1,38 @@ -%global sover 2 -%global with_tests 1 -#global commit a2d016c84d2034f43062d7f22b4874cfffe5c127 -#global shortcommit %(c=%{commit}; echo ${c:0:7}) -#global candidate RC1 +%global toolchain clang -Name: pocl -%global ver 1.8 -Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(string.lower(ver))} -Release: 3%{?candidate:.%{candidate}}%{?shortcommit:.%{shortcommit}}%{?dist} -Summary: Portable Computing Language - an OpenCL implementation -# The whole code is under MIT -# except include/utlist.h which is under BSD (and unbundled) and -# except lib/kernel/vecmath which is under GPLv3+ or LGPLv3+ (and unbundled in future) -License: MIT and BSD and (GPLv3+ or LGPLv3+) -URL: http://portablecl.org/ +Name: pocl +Version: 3.1 +Release: 1%{?dist} -%if 0%{?shortcommit} -Source0: https://github.com/pocl/pocl/archive/%{commit}/%{name}-%{shortcommit}.tar.gz -%else -Source0: https://github.com/pocl/pocl/archive/refs/tags/v%{version}%{?candidate:-%{candidate}}.tar.gz#/%{name}-%{version}.tar.gz -%endif +# The entire code is under MIT +# include/utlist.h which is under BSD-1-Clause (unbundled) +# lib/kernel/vecmath which is under GPL-3.0-or-later OR LGPL-3.0-or-later +License: MIT AND BSD-1-Clause AND (GPL-3.0-or-later OR LGPL-3.0-or-later) +Summary: Portable Computing Language - an OpenCL implementation +URL: https://github.com/%{name}/%{name} +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: clang +BuildRequires: clang-devel +BuildRequires: compiler-rt +BuildRequires: glew-devel +BuildRequires: hwloc-devel +BuildRequires: libedit-devel +BuildRequires: libtool +BuildRequires: libtool-ltdl-devel +BuildRequires: llvm-devel +BuildRequires: mesa-libGL-devel +BuildRequires: mesa-libEGL-devel +BuildRequires: ocl-icd-devel +BuildRequires: uthash-devel +BuildRequires: zlib-devel +BuildRequires: ninja-build -BuildRequires: cmake -BuildRequires: clang clang-devel -BuildRequires: compiler-rt -BuildRequires: glew-devel -BuildRequires: hwloc-devel -BuildRequires: libedit-devel -BuildRequires: libtool -BuildRequires: libtool-ltdl-devel -BuildRequires: llvm llvm-devel -BuildRequires: mesa-libGL-devel -BuildRequires: mesa-libEGL-devel -BuildRequires: ocl-icd-devel -BuildRequires: uthash-devel -BuildRequires: zlib-devel -#BuildRequires: vecmath-devel # https://bugzilla.redhat.com/show_bug.cgi?id=1082364 -Requires: libstdc++-devel%{?_isa} +Requires: libstdc++-devel%{?_isa} # Runtime dependency, because libm.so is required for kernels -Requires: glibc-devel%{?_isa} +Requires: glibc-devel%{?_isa} %description Pocl's goal is to become an efficient open source (MIT-licensed) implementation @@ -57,84 +50,74 @@ functions are suitable for parallelization in multiple ways (SIMD, VLIW, superscalar,...). %package devel -Summary: Portable Computing Language development files -Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: clang%{?_isa} -Requires: ocl-icd-devel%{?_isa} -Requires: opencl-filesystem -Requires: uthash-devel +Summary: Portable Computing Language development files +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: clang%{?_isa} +Requires: ocl-icd-devel%{?_isa} +Requires: opencl-filesystem +Requires: uthash-devel %description devel Portable Computing Language development files. %prep -%if 0%{?shortcommit} -%autosetup -p1 -n pocl-%{commit} -%else -%autosetup -p1 -n %{name}-%{version}%{?candidate:-%{candidate}} -%endif - +%autosetup -p1 # Unbundle uthash find . -depth -name utlist* -print -delete - %build -# CPU detection fails on ARM, so we need to manually specify the CPU as generic. -%cmake .. \ - -DENABLE_ICD=1 \ +%cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_ICD:BOOL=ON \ + -DENABLE_CUDA:BOOL=OFF \ + -DENABLE_TESTS:BOOL=ON \ + -DENABLE_EXAMPLES:BOOL=OFF \ -DPOCL_INSTALL_ICD_VENDORDIR=%{_sysconfdir}/OpenCL/vendors \ -DEXTRA_KERNEL_CXX_FLAGS="%{optflags}" \ %ifarch %{ix86} x86_64 -DKERNELLIB_HOST_CPU_VARIANTS=distro \ %endif -%ifarch aarch64 %{arm} - -DLLC_HOST_CPU="generic" \ +%ifarch aarch64 + -DLLC_HOST_CPU="cortex-a53" \ %endif - -DPOCL_ICD_ABSOLUTE_PATH=OFF \ - %{nil} - # -DENABLE_TESTSUITES=all Requires clBLAS +%ifarch riscv64 + -DLLC_HOST_CPU="generic-rv64" \ +%endif + -DPOCL_ICD_ABSOLUTE_PATH:BOOL=OFF \ + -DENABLE_POCL_BUILDING:BOOL=ON \ + -DWITH_LLVM_CONFIG:PATH='llvm-config' %cmake_build %install %cmake_install -# Unbundle vecmath -#rm -vf %%{buildroot}/%%{_libdir}/pocl/vecmath/ -#ln -vs %%{_includedir}/vecmath %%{buildroot}/%%{_libdir}/pocl/vecmath -# but you need to run the .py to generate the files under the pocl dir - -%if 0%{?with_tests} %check -# https://github.com/pocl/pocl/issues/602 -# https://github.com/pocl/pocl/issues/603 - ctest -VV \ - %ifarch %{ix86} %{arm} - || : - %else - ; - %endif +# Upstream support running tests only on x86_64 +%ifarch x86_64 +%ctest %endif -%ldconfig_scriptlets - %files +%doc README.md doc/sphinx/source/*.rst %license LICENSE -%doc README doc/sphinx/source/*.rst %{_sysconfdir}/OpenCL/vendors/%{name}.icd -%{_libdir}/lib%{name}.so.%{sover}* +%{_libdir}/lib%{name}.so.2* %{_datadir}/%{name}/ %{_libdir}/%{name}/ -%{_libdir}/%{name}/libpocl-devices-basic.so -%{_libdir}/%{name}/libpocl-devices-pthread.so %files devel %{_bindir}/poclcc %{_libdir}/lib%{name}.so -%{_libdir}/%{name}/libllvmopencl.so %{_libdir}/pkgconfig/%{name}.pc %changelog +* Tue Apr 11 2023 Vitaly Zaitsev - 3.1-1 +- Updated to version 3.1. +- Fixed FTBFS on Fedora 37+. +- Performed major SPEC cleanup. +- Switched to SPDX license tag. + * Fri Jan 20 2023 Fedora Release Engineering - 1.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index 5b8eaf0..e70705c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pocl-1.8.tar.gz) = bcbb3fa3d2234d4c5b0c17863eba0bc4c8f13f863cc58cfd1de49e21fa7bf0aec82b81aec143c81885e3a39274c8ae783b2f03b9a12846e024204d6ed0e59a9d +SHA512 (pocl-3.1.tar.gz) = 40d17e81d715f6897aa1d97fd02834d45227d9d0bd4c70e76d727f9ad4df675c25b7158a862e20e63810182fdad82a3cb1e454668c3a6422a977e59c8325fa0c