From 37033eba51e495b192d812e5453273a51822c06f Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Sun, 7 Nov 2021 20:25:11 +0100 Subject: [PATCH 01/12] up to 13.0.0 --- opencl-clang.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index e694d8d..d745779 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -1,17 +1,17 @@ # requires the OpenCL patches -%define llvm_version 12.0.0 +%define llvm_version 13.0.0 -%define spirv_llvm_translator_version 12.0.0 +%define spirv_llvm_translator_version 13.0.0 Summary: Intel Graphics Compute Runtime for OpenCL Name: opencl-clang -Version: 12.0.0 -Release: 2 +Version: 13.0.0 +Release: 1 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -# Source0-md5: e8abbdba2d39f3f090d949dd8fc4737b +# Source0-md5: 6e719b1a8067ac23d2a640f43feb046e URL: https://01.org/compute-runtime BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version} BuildRequires: clang >= %{llvm_rpm_version} @@ -63,8 +63,8 @@ rm -rf $RPM_BUILD_ROOT %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.12 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} -ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.12 +mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.13 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} +ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.13 ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so %post -p /sbin/ldconfig @@ -77,7 +77,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc README.md %attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version} -%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.12 +%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.13 %files devel %defattr(644,root,root,755) -- 2.43.0 From d1a964b74851f7d8c67fcb9cb56b82bff9624834 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Fri, 25 Feb 2022 00:17:58 +0100 Subject: [PATCH 02/12] llvm rebuild Release 2 (by relup.sh) --- opencl-clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index d745779..8843dca 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -7,7 +7,7 @@ Summary: Intel Graphics Compute Runtime for OpenCL Name: opencl-clang Version: 13.0.0 -Release: 1 +Release: 2 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -- 2.43.0 From 94ecc3578ada7ed9329deedb69c2195fe2fe8d4e Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Tue, 31 May 2022 23:31:40 +0200 Subject: [PATCH 03/12] up to 14.0.0 --- opencl-clang.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index 8843dca..ad8f528 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -1,17 +1,17 @@ # requires the OpenCL patches -%define llvm_version 13.0.0 +%define llvm_version 14.0.0 -%define spirv_llvm_translator_version 13.0.0 +%define spirv_llvm_translator_version 14.0.0 Summary: Intel Graphics Compute Runtime for OpenCL Name: opencl-clang -Version: 13.0.0 -Release: 2 +Version: 14.0.0 +Release: 1 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -# Source0-md5: 6e719b1a8067ac23d2a640f43feb046e +# Source0-md5: c12fe86fd498c1c5a2e2be2129339584 URL: https://01.org/compute-runtime BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version} BuildRequires: clang >= %{llvm_rpm_version} @@ -63,8 +63,8 @@ rm -rf $RPM_BUILD_ROOT %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.13 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} -ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.13 +mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.14 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} +ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.14 ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so %post -p /sbin/ldconfig @@ -77,7 +77,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc README.md %attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version} -%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.13 +%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.14 %files devel %defattr(644,root,root,755) -- 2.43.0 From 60ea41c6a0a7bc04a5c95b2c959d8fbea7be48a2 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Mon, 27 Jun 2022 22:35:12 +0200 Subject: [PATCH 04/12] - pl, release 2 (rebuild with clang 14.0.6) --- opencl-clang.spec | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index ad8f528..c2a1f68 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -1,13 +1,13 @@ # requires the OpenCL patches -%define llvm_version 14.0.0 - -%define spirv_llvm_translator_version 14.0.0 +%define llvm_version 14.0.0 +%define spirv_llvm_translator_version 14.0.0 Summary: Intel Graphics Compute Runtime for OpenCL +Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang Version: 14.0.0 -Release: 1 +Release: 2 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz @@ -27,6 +27,11 @@ Common clang is a thin wrapper library around clang. Common clang has OpenCL-oriented API and is capable to compile OpenCL C kernels to SPIR-V modules. +%description -l pl.UTF-8 +Common clang to niewielka biblioteka obudowująca clanga. Ma API +zorientowane na OpenCL i potrafi kompilować jądra C OpenCL do modułów +WPIR-V + %package devel Summary: Header files for %{name} library Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name} @@ -63,7 +68,7 @@ rm -rf $RPM_BUILD_ROOT %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.14 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.14 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.14 ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so -- 2.43.0 From 988cfd1bc00a3c4c0c024850ee8728f22febb045 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Tue, 28 Jun 2022 06:15:37 +0200 Subject: [PATCH 05/12] - release 3 (llvm 14.0.6 on x32) --- opencl-clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index c2a1f68..d71a45e 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -7,7 +7,7 @@ Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang Version: 14.0.0 -Release: 2 +Release: 3 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -- 2.43.0 From 4429c6a09dbfd6d094daa33ef49cd93095df2a91 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Sat, 15 Oct 2022 23:34:21 +0200 Subject: [PATCH 06/12] up to 15.0.0 --- opencl-clang.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index d71a45e..3459c89 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -1,17 +1,17 @@ # requires the OpenCL patches -%define llvm_version 14.0.0 -%define spirv_llvm_translator_version 14.0.0 +%define llvm_version 15.0.0 +%define spirv_llvm_translator_version 15.0.0 Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang -Version: 14.0.0 -Release: 3 +Version: 15.0.0 +Release: 1 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -# Source0-md5: c12fe86fd498c1c5a2e2be2129339584 +# Source0-md5: 9c11f058256917e48f1be64fe4dc6666 URL: https://01.org/compute-runtime BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version} BuildRequires: clang >= %{llvm_rpm_version} @@ -68,8 +68,8 @@ rm -rf $RPM_BUILD_ROOT %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.14 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} -ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.14 +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.15 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} +ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.15 ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so %post -p /sbin/ldconfig @@ -82,7 +82,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc README.md %attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version} -%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.14 +%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.15 %files devel %defattr(644,root,root,755) -- 2.43.0 From eb4743a0b53d1963b93fb8ee7a469c7cd95968fb Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Mon, 28 Nov 2022 20:48:39 +0100 Subject: [PATCH 07/12] llvm rebuild Release 2 (by relup.sh) --- opencl-clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index 3459c89..103fa78 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -7,7 +7,7 @@ Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang Version: 15.0.0 -Release: 1 +Release: 2 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -- 2.43.0 From 6656c215dd6921d54809c82351845101979bc212 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Mon, 6 Mar 2023 23:35:51 +0100 Subject: [PATCH 08/12] Release 3 (by relup.sh) --- opencl-clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index 103fa78..8338b5b 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -7,7 +7,7 @@ Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang Version: 15.0.0 -Release: 2 +Release: 3 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -- 2.43.0 From 91f591af16f16a77227c474d5adc8895ce3d448d Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Sat, 20 May 2023 22:24:06 +0200 Subject: [PATCH 09/12] up to 16.0.0 multiple upstream fixes for build failures/missing soname from: https://github.com/intel/opencl-clang/pull/416 https://github.com/intel/opencl-clang/pull/419 https://github.com/intel/opencl-clang/pull/437 https://github.com/intel/opencl-clang/pull/439 --- cxx17.patch | 23 ++++++++++ llvm16.patch | 36 ++++++++++++++++ opencl-clang.spec | 26 +++++++---- soname.patch | 108 ++++++++++++++++++++++++++++++++++++++++++++++ standalone.patch | 28 ++++++++++++ 5 files changed, 212 insertions(+), 9 deletions(-) create mode 100644 cxx17.patch create mode 100644 llvm16.patch create mode 100644 soname.patch create mode 100644 standalone.patch diff --git a/cxx17.patch b/cxx17.patch new file mode 100644 index 0000000..a44624a --- /dev/null +++ b/cxx17.patch @@ -0,0 +1,23 @@ +From 7eed60a0ccefe9354da1ab0e54a045df8b6b06e9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Fri, 14 Apr 2023 12:02:13 +0200 +Subject: [PATCH] Bump CMAKE_CXX_STANDARD to 17 + +Fixes build issues +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d7eff1..efb2adf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + ${CMAKE_MODULE_PATH} + ${LLVM_CMAKE_DIR}) + +- set(CMAKE_CXX_STANDARD 14) ++ set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + + option(LLVMSPIRV_INCLUDED_IN_LLVM diff --git a/llvm16.patch b/llvm16.patch new file mode 100644 index 0000000..b2fd3d2 --- /dev/null +++ b/llvm16.patch @@ -0,0 +1,36 @@ +From 1568bb95cbae480e15ef985ad2e0e695a65516c5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Fri, 14 Apr 2023 19:07:42 +0200 +Subject: [PATCH] Support llvm headers in + ${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/ + +Fedora places llvm include files into that directory instead of assumed +${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/ + +Try both, fail horribly when none of them exist +--- + cl_headers/CMakeLists.txt | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt +index 788adff..70aa321 100644 +--- a/cl_headers/CMakeLists.txt ++++ b/cl_headers/CMakeLists.txt +@@ -15,8 +15,15 @@ add_custom_command( + endfunction(copy_file) + + if(USE_PREBUILT_LLVM) +- set(OPENCL_HEADERS_DIR +- "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/") ++ if(EXISTS "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/") ++ set(OPENCL_HEADERS_DIR ++ "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/") ++ elseif(EXISTS "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/") ++ set(OPENCL_HEADERS_DIR ++ "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/include/") ++ else() ++ message(FATAL_ERROR "[OPENCL-CLANG] Couldn't find prebuilt LLVM include directory.") ++ endif() + else(USE_PREBUILT_LLVM) + set(OPENCL_HEADERS_DIR "${CLANG_SOURCE_DIR}/lib/Headers") + endif(USE_PREBUILT_LLVM) diff --git a/opencl-clang.spec b/opencl-clang.spec index 8338b5b..932f889 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -1,22 +1,26 @@ # requires the OpenCL patches -%define llvm_version 15.0.0 -%define spirv_llvm_translator_version 15.0.0 +%define llvm_version 16.0.0 +%define spirv_llvm_translator_version 16.0.0 Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang -Version: 15.0.0 -Release: 3 +Version: 16.0.0 +Release: 1 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -# Source0-md5: 9c11f058256917e48f1be64fe4dc6666 +# Source0-md5: f2eb3b9f9201349860f0e7ef0eb31d46 +Patch0: cxx17.patch +Patch1: llvm16.patch +Patch2: soname.patch +Patch3: standalone.patch URL: https://01.org/compute-runtime BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version} BuildRequires: clang >= %{llvm_rpm_version} BuildRequires: clang-devel >= %{llvm_version} -BuildRequires: cmake >= 3.4.3 +BuildRequires: cmake >= 3.13.4 BuildRequires: llvm-devel >= %{llvm_version} BuildRequires: pkgconfig BuildRequires: rpmbuild(macros) >= 1.605 @@ -47,6 +51,10 @@ Pliki nagłówkowe biblioteki %{name}. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build install -d build @@ -68,8 +76,8 @@ rm -rf $RPM_BUILD_ROOT %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.15 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} -ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.15 +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.16 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} +ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.16 ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so %post -p /sbin/ldconfig @@ -82,7 +90,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc README.md %attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version} -%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.15 +%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.16 %files devel %defattr(644,root,root,755) diff --git a/soname.patch b/soname.patch new file mode 100644 index 0000000..09b1432 --- /dev/null +++ b/soname.patch @@ -0,0 +1,108 @@ +From 8102ee2f83c3bd87e5b6aa405d04b5c3abc5ef3b Mon Sep 17 00:00:00 2001 +From: Wenju He +Date: Wed, 17 May 2023 08:54:44 +0800 +Subject: [PATCH] Revert to use add_llvm_library and revert linking LLVM + libraries + +Add cmake option EXCLUDE_LIBS_FROM_ALL to remove a specific llvm library +from llvm 'all'. + +This PR partially reverts 743bd15. +This PR addresses #401, #417, #418, #422, and brings back SONAME. +--- + CMakeLists.txt | 73 +++++++++++--------------------------------------- + 1 file changed, 15 insertions(+), 58 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b1bde90..5b3c4b7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -292,21 +292,23 @@ else() + ) + endif() + +-add_library(${TARGET_NAME} SHARED +- ${TARGET_INCLUDE_FILES} +- ${TARGET_SOURCE_FILES} +- $ +-) +- +-# Same CRT compile option are reqiured to avoid link errors on Windows. +-# MD and MDd are choosed by default for release and debug build in LLVM. +-# If users set MT or MTd flags, they also need to add the flags for +-# opencl-clang sources using a custom macro set_msvc_crt_flags. +-if(COMMAND set_msvc_crt_flags) +- set_msvc_crt_flags(${TARGET_NAME}) ++set(EXCLUDE_LIBS_FROM_ALL "" CACHE STRING "Space-separated list of LLVM libraries to exclude from all") ++llvm_map_components_to_libnames(ALL_LLVM_LIBS all) ++if (NOT "${EXCLUDE_LIBS_FROM_ALL}" STREQUAL "") ++ list(REMOVE_ITEM ALL_LLVM_LIBS ${EXCLUDE_LIBS_FROM_ALL}) + endif() ++list(APPEND OPENCL_CLANG_LINK_LIBS ${ALL_LLVM_LIBS}) ++ ++add_llvm_library(${TARGET_NAME} SHARED ++ ${TARGET_INCLUDE_FILES} ++ ${TARGET_SOURCE_FILES} ++ $ + +-add_dependencies(${TARGET_NAME} CClangCompileOptions) ++ DEPENDS CClangCompileOptions ++ ++ LINK_LIBS ++ ${OPENCL_CLANG_LINK_LIBS} ++ ) + + if (WIN32) + # Enable compiler generation of Control Flow Guard security checks. +@@ -322,51 +324,6 @@ elseif(UNIX) + LINK_FLAGS " -Wl,--no-undefined") + endif(WIN32) + +-# Enable new IN_LIST operator. +-cmake_policy(SET CMP0057 NEW) +-set(OTHER_LIBRARIES) +-if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD) +- list(APPEND OTHER_LIBRARIES LLVMNVPTXCodeGen LLVMNVPTXDesc LLVMNVPTXInfo) +-endif() +-if ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD) +- list(APPEND OTHER_LIBRARIES LLVMAMDGPUCodeGen LLVMAMDGPUAsmParser LLVMAMDGPUDesc LLVMAMDGPUInfo) +-endif() +- +-target_link_libraries( ${TARGET_NAME} +- LINK_PRIVATE +- ${OPENCL_CLANG_LINK_LIBS} +- LLVMX86CodeGen +- LLVMX86AsmParser +- LLVMX86Desc +- LLVMX86Info +- LLVMX86Disassembler +- LLVMAnalysis +- LLVMCodeGen +- LLVMCore +- LLVMipo +- LLVMInstCombine +- LLVMInstrumentation +- LLVMMC +- LLVMMCParser +- LLVMObjCARCOpts +- LLVMOption +- LLVMScalarOpts +- LLVMSupport +- LLVMTransformUtils +- LLVMVectorize +- LLVMAsmPrinter +- LLVMSelectionDAG +- LLVMMCDisassembler +- LLVMProfileData +- LLVMObject +- LLVMBitWriter +- LLVMIRReader +- LLVMAsmParser +- LLVMTarget +- LLVMBitReader +- ${OTHER_LIBRARIES} +- ) +- + install(FILES opencl_clang.h + DESTINATION include/cclang + COMPONENT ${TARGET_NAME}) diff --git a/standalone.patch b/standalone.patch new file mode 100644 index 0000000..dba735e --- /dev/null +++ b/standalone.patch @@ -0,0 +1,28 @@ +From 3efa0f5e1770dc082919adc8e8d48b19ecaaabaa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Fri, 21 Apr 2023 04:07:21 +0200 +Subject: [PATCH] Fix standalone build (#415) + +Fixes https://github.com/intel/opencl-clang/issues/406 +Fixes https://github.com/intel/opencl-clang/issues/374 + +(cherry picked from commit 529a9188114bcbd8ed753d2276942384fa50d7a1) +--- + cl_headers/CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt +index 788adff..86df76f 100644 +--- a/cl_headers/CMakeLists.txt ++++ b/cl_headers/CMakeLists.txt +@@ -1,5 +1,9 @@ + set(CL_HEADERS_LIB cl_headers) +-set(CLANG_COMMAND $ ) ++if(USE_PREBUILT_LLVM) ++ find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) ++else() ++ set(CLANG_COMMAND $) ++endif() + if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL) + build_native_tool(clang CLANG_COMMAND) + endif() -- 2.43.0 From f1752e1f8ece66df7b009797968c0224360959a7 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Tue, 6 Jun 2023 20:51:31 +0200 Subject: [PATCH 10/12] llvm rebuild Release 2 (by relup.sh) --- opencl-clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index 932f889..67226b7 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -7,7 +7,7 @@ Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang Version: 16.0.0 -Release: 1 +Release: 2 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -- 2.43.0 From b8e7b4997f528b66359ec79a0f6a55341ea7273c Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Sun, 8 Oct 2023 01:52:58 +0200 Subject: [PATCH 11/12] up to 17.0.0 --- cxx17.patch | 23 ---------- llvm16.patch | 36 ---------------- opencl-clang.spec | 24 ++++------- soname.patch | 108 ---------------------------------------------- standalone.patch | 28 ------------ 5 files changed, 8 insertions(+), 211 deletions(-) delete mode 100644 cxx17.patch delete mode 100644 llvm16.patch delete mode 100644 soname.patch delete mode 100644 standalone.patch diff --git a/cxx17.patch b/cxx17.patch deleted file mode 100644 index a44624a..0000000 --- a/cxx17.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 7eed60a0ccefe9354da1ab0e54a045df8b6b06e9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= -Date: Fri, 14 Apr 2023 12:02:13 +0200 -Subject: [PATCH] Bump CMAKE_CXX_STANDARD to 17 - -Fixes build issues ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3d7eff1..efb2adf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -58,7 +58,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - ${CMAKE_MODULE_PATH} - ${LLVM_CMAKE_DIR}) - -- set(CMAKE_CXX_STANDARD 14) -+ set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - - option(LLVMSPIRV_INCLUDED_IN_LLVM diff --git a/llvm16.patch b/llvm16.patch deleted file mode 100644 index b2fd3d2..0000000 --- a/llvm16.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1568bb95cbae480e15ef985ad2e0e695a65516c5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= -Date: Fri, 14 Apr 2023 19:07:42 +0200 -Subject: [PATCH] Support llvm headers in - ${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/ - -Fedora places llvm include files into that directory instead of assumed -${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/ - -Try both, fail horribly when none of them exist ---- - cl_headers/CMakeLists.txt | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt -index 788adff..70aa321 100644 ---- a/cl_headers/CMakeLists.txt -+++ b/cl_headers/CMakeLists.txt -@@ -15,8 +15,15 @@ add_custom_command( - endfunction(copy_file) - - if(USE_PREBUILT_LLVM) -- set(OPENCL_HEADERS_DIR -- "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/") -+ if(EXISTS "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/") -+ set(OPENCL_HEADERS_DIR -+ "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/") -+ elseif(EXISTS "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/") -+ set(OPENCL_HEADERS_DIR -+ "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/include/") -+ else() -+ message(FATAL_ERROR "[OPENCL-CLANG] Couldn't find prebuilt LLVM include directory.") -+ endif() - else(USE_PREBUILT_LLVM) - set(OPENCL_HEADERS_DIR "${CLANG_SOURCE_DIR}/lib/Headers") - endif(USE_PREBUILT_LLVM) diff --git a/opencl-clang.spec b/opencl-clang.spec index 67226b7..443c55d 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -1,21 +1,17 @@ # requires the OpenCL patches -%define llvm_version 16.0.0 -%define spirv_llvm_translator_version 16.0.0 +%define llvm_version 17.0.0 +%define spirv_llvm_translator_version 17.0.0 Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang -Version: 16.0.0 -Release: 2 +Version: 17.0.0 +Release: 1 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -# Source0-md5: f2eb3b9f9201349860f0e7ef0eb31d46 -Patch0: cxx17.patch -Patch1: llvm16.patch -Patch2: soname.patch -Patch3: standalone.patch +# Source0-md5: a25025d30918dc0e22f00a088a1ed69e URL: https://01.org/compute-runtime BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version} BuildRequires: clang >= %{llvm_rpm_version} @@ -51,10 +47,6 @@ Pliki nagłówkowe biblioteki %{name}. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build install -d build @@ -76,8 +68,8 @@ rm -rf $RPM_BUILD_ROOT %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.16 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} -ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.16 +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.17 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} +ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.17 ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so %post -p /sbin/ldconfig @@ -90,7 +82,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc README.md %attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version} -%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.16 +%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.17 %files devel %defattr(644,root,root,755) diff --git a/soname.patch b/soname.patch deleted file mode 100644 index 09b1432..0000000 --- a/soname.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 8102ee2f83c3bd87e5b6aa405d04b5c3abc5ef3b Mon Sep 17 00:00:00 2001 -From: Wenju He -Date: Wed, 17 May 2023 08:54:44 +0800 -Subject: [PATCH] Revert to use add_llvm_library and revert linking LLVM - libraries - -Add cmake option EXCLUDE_LIBS_FROM_ALL to remove a specific llvm library -from llvm 'all'. - -This PR partially reverts 743bd15. -This PR addresses #401, #417, #418, #422, and brings back SONAME. ---- - CMakeLists.txt | 73 +++++++++++--------------------------------------- - 1 file changed, 15 insertions(+), 58 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b1bde90..5b3c4b7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -292,21 +292,23 @@ else() - ) - endif() - --add_library(${TARGET_NAME} SHARED -- ${TARGET_INCLUDE_FILES} -- ${TARGET_SOURCE_FILES} -- $ --) -- --# Same CRT compile option are reqiured to avoid link errors on Windows. --# MD and MDd are choosed by default for release and debug build in LLVM. --# If users set MT or MTd flags, they also need to add the flags for --# opencl-clang sources using a custom macro set_msvc_crt_flags. --if(COMMAND set_msvc_crt_flags) -- set_msvc_crt_flags(${TARGET_NAME}) -+set(EXCLUDE_LIBS_FROM_ALL "" CACHE STRING "Space-separated list of LLVM libraries to exclude from all") -+llvm_map_components_to_libnames(ALL_LLVM_LIBS all) -+if (NOT "${EXCLUDE_LIBS_FROM_ALL}" STREQUAL "") -+ list(REMOVE_ITEM ALL_LLVM_LIBS ${EXCLUDE_LIBS_FROM_ALL}) - endif() -+list(APPEND OPENCL_CLANG_LINK_LIBS ${ALL_LLVM_LIBS}) -+ -+add_llvm_library(${TARGET_NAME} SHARED -+ ${TARGET_INCLUDE_FILES} -+ ${TARGET_SOURCE_FILES} -+ $ - --add_dependencies(${TARGET_NAME} CClangCompileOptions) -+ DEPENDS CClangCompileOptions -+ -+ LINK_LIBS -+ ${OPENCL_CLANG_LINK_LIBS} -+ ) - - if (WIN32) - # Enable compiler generation of Control Flow Guard security checks. -@@ -322,51 +324,6 @@ elseif(UNIX) - LINK_FLAGS " -Wl,--no-undefined") - endif(WIN32) - --# Enable new IN_LIST operator. --cmake_policy(SET CMP0057 NEW) --set(OTHER_LIBRARIES) --if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD) -- list(APPEND OTHER_LIBRARIES LLVMNVPTXCodeGen LLVMNVPTXDesc LLVMNVPTXInfo) --endif() --if ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD) -- list(APPEND OTHER_LIBRARIES LLVMAMDGPUCodeGen LLVMAMDGPUAsmParser LLVMAMDGPUDesc LLVMAMDGPUInfo) --endif() -- --target_link_libraries( ${TARGET_NAME} -- LINK_PRIVATE -- ${OPENCL_CLANG_LINK_LIBS} -- LLVMX86CodeGen -- LLVMX86AsmParser -- LLVMX86Desc -- LLVMX86Info -- LLVMX86Disassembler -- LLVMAnalysis -- LLVMCodeGen -- LLVMCore -- LLVMipo -- LLVMInstCombine -- LLVMInstrumentation -- LLVMMC -- LLVMMCParser -- LLVMObjCARCOpts -- LLVMOption -- LLVMScalarOpts -- LLVMSupport -- LLVMTransformUtils -- LLVMVectorize -- LLVMAsmPrinter -- LLVMSelectionDAG -- LLVMMCDisassembler -- LLVMProfileData -- LLVMObject -- LLVMBitWriter -- LLVMIRReader -- LLVMAsmParser -- LLVMTarget -- LLVMBitReader -- ${OTHER_LIBRARIES} -- ) -- - install(FILES opencl_clang.h - DESTINATION include/cclang - COMPONENT ${TARGET_NAME}) diff --git a/standalone.patch b/standalone.patch deleted file mode 100644 index dba735e..0000000 --- a/standalone.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 3efa0f5e1770dc082919adc8e8d48b19ecaaabaa Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= -Date: Fri, 21 Apr 2023 04:07:21 +0200 -Subject: [PATCH] Fix standalone build (#415) - -Fixes https://github.com/intel/opencl-clang/issues/406 -Fixes https://github.com/intel/opencl-clang/issues/374 - -(cherry picked from commit 529a9188114bcbd8ed753d2276942384fa50d7a1) ---- - cl_headers/CMakeLists.txt | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt -index 788adff..86df76f 100644 ---- a/cl_headers/CMakeLists.txt -+++ b/cl_headers/CMakeLists.txt -@@ -1,5 +1,9 @@ - set(CL_HEADERS_LIB cl_headers) --set(CLANG_COMMAND $ ) -+if(USE_PREBUILT_LLVM) -+ find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -+else() -+ set(CLANG_COMMAND $) -+endif() - if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL) - build_native_tool(clang CLANG_COMMAND) - endif() -- 2.43.0 From 38b9be4d5d94cdc6754c8eaf48b43e1a611d23a3 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Fri, 5 Apr 2024 10:08:22 +0200 Subject: [PATCH 12/12] up to 18.1.0 --- opencl-clang.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/opencl-clang.spec b/opencl-clang.spec index 443c55d..f431362 100644 --- a/opencl-clang.spec +++ b/opencl-clang.spec @@ -1,17 +1,17 @@ # requires the OpenCL patches -%define llvm_version 17.0.0 -%define spirv_llvm_translator_version 17.0.0 +%define llvm_version 18.1.0 +%define spirv_llvm_translator_version 18.1.0 Summary: Intel Graphics Compute Runtime for OpenCL Summary(pl.UTF-8): Biblioteki uruchomieniowe Intel Graphics Compute dla OpenCL Name: opencl-clang -Version: 17.0.0 +Version: 18.1.0 Release: 1 License: University of Illinois/NCSA Open Source License Group: Libraries Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz -# Source0-md5: a25025d30918dc0e22f00a088a1ed69e +# Source0-md5: bc489b3d1222c1c637fd777bc056b5af URL: https://01.org/compute-runtime BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version} BuildRequires: clang >= %{llvm_rpm_version} @@ -68,8 +68,8 @@ rm -rf $RPM_BUILD_ROOT %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.17 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} -ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.17 +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.18.1 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} +ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.18.1 ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so %post -p /sbin/ldconfig @@ -82,7 +82,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc README.md %attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version} -%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.17 +%ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.18.1 %files devel %defattr(644,root,root,755) -- 2.43.0