diff --git a/libomp18.spec b/libomp18.spec index 2e9a38f..1ecdd40 100644 --- a/libomp18.spec +++ b/libomp18.spec @@ -37,13 +37,21 @@ %if %{with compat_build} %global pkg_name libomp%{maj_ver} +%global llvm_pkg_name llvm%{maj_ver} +%global install_prefix %{_libdir}/llvm%{maj_ver} +%global install_libdir %{install_prefix}/lib +%global pkg_datadir %{install_prefix}/share %else %global pkg_name libomp +%global llvm_pkg_name llvm +%global install_prefix %{_prefix} +%global install_libdir %{_libdir} +%global pkg_datadir %{_datadir} %endif Name: %{pkg_name} Version: %{libomp_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} -Release: 3%{?dist} +Release: 4%{?dist} Summary: OpenMP runtime for clang License: Apache-2.0 WITH LLVM-exception OR NCSA @@ -57,9 +65,18 @@ Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp Source2: release-keys.asc %endif +BuildRequires: %{llvm_pkg_name}-devel = %{version} +BuildRequires: %{llvm_pkg_name}-cmake-utils = %{version} + +%if %{with compat_build} +BuildRequires: clang%{maj_ver} +BuildRequires: clang%{maj_ver}-tools-extra +%else BuildRequires: clang >= %{maj_ver} # For clang-offload-packager BuildRequires: clang-tools-extra +%endif + BuildRequires: cmake BuildRequires: ninja-build BuildRequires: elfutils-libelf-devel @@ -72,8 +89,7 @@ BuildRequires: libffi-devel BuildRequires: gnupg2 # libomptarget needs the llvm cmake files -BuildRequires: llvm-devel -BuildRequires: llvm-cmake-utils +BuildRequires: %{llvm_pkg_name}-devel = %{version} Requires: elfutils-libelf%{?isa} @@ -83,7 +99,11 @@ OpenMP runtime for clang. %package devel Summary: OpenMP header files Requires: %{name}%{?isa} = %{version}-%{release} +%if %{with compat_build} +Requires: clang%{maj_ver}-resource-filesystem%{?isa} = %{version} +%else Requires: clang-resource-filesystem%{?isa} = %{version} +%endif %description devel OpenMP header files. @@ -97,14 +117,21 @@ OpenMP header files. %build %cmake -GNinja \ -DLIBOMP_INSTALL_ALIASES=OFF \ - -DCMAKE_MODULE_PATH=%{_datadir}/llvm/cmake/Modules \ - -DLLVM_DIR=%{_libdir}/cmake/llvm \ - -DCMAKE_INSTALL_INCLUDEDIR=%{_prefix}/lib/clang/%{maj_ver}/include \ + -DCMAKE_MODULE_PATH=%{pkg_datadir}/llvm/cmake/Modules \ +%if %{with compat_build} + -DLLVM_CMAKE_DIR=%{install_libdir}/cmake/llvm \ + -DCMAKE_CXX_COMPILER=%{_bindir}/clang++-%{maj_ver} \ + -DCMAKE_C_COMPILER=%{_bindir}/clang-%{maj_ver} \ + -DCMAKE_INSTALL_PREFIX=%{install_prefix} \ +%else %if 0%{?__isa_bits} == 64 -DOPENMP_LIBDIR_SUFFIX=64 \ %else -DOPENMP_LIBDIR_SUFFIX= \ %endif +%endif + -DLLVM_DIR=%{install_libdir}/cmake/llvm \ + -DCMAKE_INSTALL_INCLUDEDIR=%{_prefix}/lib/clang/%{maj_ver}/include \ %if %{with snapshot_build} -DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \ %endif @@ -117,27 +144,27 @@ OpenMP header files. %cmake_install # Remove static libraries with equivalent shared libraries -rm -rf %{buildroot}%{_libdir}/libarcher_static.a +rm -rf %{buildroot}%{install_libdir}/libarcher_static.a %check %cmake_build --target check-openmp %files %license LICENSE.TXT -%{_libdir}/libomp.so -%{_libdir}/libompd.so +%{install_libdir}/libomp.so +%{install_libdir}/libompd.so %ifnarch %{arm} -%{_libdir}/libarcher.so +%{install_libdir}/libarcher.so %endif %ifnarch %{ix86} %{arm} # libomptarget is not supported on 32-bit systems. # s390x does not support the offloading plugins. %ifnarch s390x -%{_libdir}/libomptarget.rtl.amdgpu.so.%{so_suffix} -%{_libdir}/libomptarget.rtl.cuda.so.%{so_suffix} -%{_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{so_suffix} +%{install_libdir}/libomptarget.rtl.amdgpu.so.%{so_suffix} +%{install_libdir}/libomptarget.rtl.cuda.so.%{so_suffix} +%{install_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{so_suffix} %endif -%{_libdir}/libomptarget.so.%{so_suffix} +%{install_libdir}/libomptarget.so.%{so_suffix} %endif %files devel @@ -148,19 +175,19 @@ rm -rf %{buildroot}%{_libdir}/libarcher_static.a %{_prefix}/lib/clang/%{maj_ver}/include/ompt.h %{_prefix}/lib/clang/%{maj_ver}/include/ompt-multiplex.h %endif -%{_libdir}/cmake/openmp/ +%{install_libdir}/cmake/openmp/ %ifnarch %{ix86} %{arm} # libomptarget is not supported on 32-bit systems. # s390x does not support the offloading plugins. %ifnarch s390x -%{_libdir}/libomptarget.rtl.amdgpu.so -%{_libdir}/libomptarget.rtl.cuda.so -%{_libdir}/libomptarget.rtl.%{libomp_arch}.so +%{install_libdir}/libomptarget.rtl.amdgpu.so +%{install_libdir}/libomptarget.rtl.cuda.so +%{install_libdir}/libomptarget.rtl.%{libomp_arch}.so %endif -%{_libdir}/libomptarget.devicertl.a -%{_libdir}/libomptarget-amdgpu-*.bc -%{_libdir}/libomptarget-nvptx-*.bc -%{_libdir}/libomptarget.so +%{install_libdir}/libomptarget.devicertl.a +%{install_libdir}/libomptarget-amdgpu-*.bc +%{install_libdir}/libomptarget-nvptx-*.bc +%{install_libdir}/libomptarget.so %endif %changelog diff --git a/tests/build-gating.fmf b/tests/build-gating.fmf index 61a3bf4..f2158b1 100644 --- a/tests/build-gating.fmf +++ b/tests/build-gating.fmf @@ -11,6 +11,8 @@ # summary: libomp tests for build/PR gating +context: + compat: llvm18 adjust: - because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR." when: >- @@ -32,11 +34,11 @@ discover: - name: libomp-tests how: fmf url: https://src.fedoraproject.org/tests/libomp.git - ref: main + ref: compat18 - name: upstream-llvm-integration-testsuite how: fmf url: https://src.fedoraproject.org/tests/llvm.git - ref: main + ref: compat18 test: integration-test-suite execute: how: tmt