From ae50c4de94834d8e55f944bedd054fecac95653c Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 15 May 2024 07:41:51 +0000 Subject: [PATCH] Import from AlmaLinux stable repository --- .gitignore | 6 +- .libomp.metadata | 6 +- SOURCES/lit.fedora.cfg.py | 15 ----- SOURCES/run-lit-tests | 59 ---------------- SPECS/libomp.spec | 137 ++++++++++++++++++-------------------- 5 files changed, 67 insertions(+), 156 deletions(-) delete mode 100644 SOURCES/lit.fedora.cfg.py delete mode 100644 SOURCES/run-lit-tests diff --git a/.gitignore b/.gitignore index b828d17..0cbf1e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -SOURCES/cmake-16.0.6.src.tar.xz -SOURCES/cmake-16.0.6.src.tar.xz.sig -SOURCES/openmp-16.0.6.src.tar.xz -SOURCES/openmp-16.0.6.src.tar.xz.sig +SOURCES/openmp-17.0.6.src.tar.xz +SOURCES/openmp-17.0.6.src.tar.xz.sig diff --git a/.libomp.metadata b/.libomp.metadata index 1961882..4b08490 100644 --- a/.libomp.metadata +++ b/.libomp.metadata @@ -1,4 +1,2 @@ -0de534cfef38697e115c3ae80634765f05e78e5b SOURCES/cmake-16.0.6.src.tar.xz -2db5c88fe9277bb0fa85f49b58e946e49ff235c2 SOURCES/cmake-16.0.6.src.tar.xz.sig -245926aec76c80db47bed9c1a0c046df3d43ccdf SOURCES/openmp-16.0.6.src.tar.xz -b70bc22476df13ca634d73bc20e783e7c0c19997 SOURCES/openmp-16.0.6.src.tar.xz.sig +d633a8e324689c7bf20528c99b3130ba1796fe1d SOURCES/openmp-17.0.6.src.tar.xz +8354a371042267a121f2b4e27c03f74f9eeff994 SOURCES/openmp-17.0.6.src.tar.xz.sig diff --git a/SOURCES/lit.fedora.cfg.py b/SOURCES/lit.fedora.cfg.py deleted file mode 100644 index 10d1f1f..0000000 --- a/SOURCES/lit.fedora.cfg.py +++ /dev/null @@ -1,15 +0,0 @@ -import tempfile - -compiler = '%(libomp_compiler)s' % lit_config.params -config.test_filecheck = '%(bindir)s/FileCheck' % lit_config.params -config.omp_header_directory = '%(includedir)s' % lit_config.params -config.libomp_obj_root = tempfile.mkdtemp() -config.library_dir = '%(libdir)s' % lit_config.params -test_root = '%(libomp_test_root)s' % lit_config.params - -# Lit will default to the compiler used to build openmp, which is gcc, but we -# want to run the tests using clang. -config.test_compiler_features = ['clang'] -config.test_c_compiler = 'clang' -config.test_cxx_compiler = 'clang++' -lit_config.load_config(config, '%(libomp_test_root)s/lit.cfg' % lit_config.params) diff --git a/SOURCES/run-lit-tests b/SOURCES/run-lit-tests deleted file mode 100644 index 18dbec5..0000000 --- a/SOURCES/run-lit-tests +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/bash - -usage() { - echo "usage: `basename $0` [OPTIONS]" - echo " --threads NUM The number of threads to use for running tests." -} - - -threads_arg='' - -while [ $# -gt 0 ]; do - case $1 in - --threads) - shift - threads_arg="--threads $1" - ;; - --multilib-arch) - shift - ARCH=$1 - ;; - * ) - echo "unknown option: $1" - echo "" - usage - exit 1 - ;; - esac - shift -done - - -set -xe - -if [ -z "$ARCH" ]; then - ARCH=`rpm --eval '%_arch'` -fi - -case $ARCH in - arm) - ;& - i686) - LIB_DIR="/usr/lib/" - ;; - *) - LIB_DIR="/usr/lib64/" - ;; -esac - -BIN_DIR="/usr/bin/" -INCLUDE_DIR="/usr/include/" - -lit $threads_arg -v \ - --config-prefix $ARCH \ - -Dlibomp_compiler=clang \ - -Dbindir=$BIN_DIR \ - -Dlibdir=$LIB_DIR \ - -Dincludedir=$INCLUDE_DIR \ - -Dlibomp_test_root=/usr/share/libomp/src/runtime/test \ - /usr/share/libomp/src/runtime/test diff --git a/SPECS/libomp.spec b/SPECS/libomp.spec index aaffd7a..8986aa9 100644 --- a/SPECS/libomp.spec +++ b/SPECS/libomp.spec @@ -1,10 +1,29 @@ +%bcond_with snapshot_build + +%if %{with snapshot_build} +# Unlock LLVM Snapshot LUA functions +%{llvm_sb} +%endif + %global toolchain gcc -%global maj_ver 16 +%global maj_ver 17 %global libomp_version %{maj_ver}.0.6 +#global rc_ver 4 %global libomp_srcdir openmp-%{libomp_version}%{?rc_ver:rc%{rc_ver}}.src -%global cmake_srcdir cmake-%{libomp_version}%{?rc_ver:rc%{rc_ver}}.src +%global so_suffix %{maj_ver} +%if %{with snapshot_build} +%undefine rc_ver +%global maj_ver %{llvm_snapshot_version_major} +%global libomp_version %{llvm_snapshot_version} +%global so_suffix %{maj_ver}%{llvm_snapshot_version_suffix} +%endif + + +# Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer +# https://bugzilla.redhat.com/show_bug.cgi?id=2158587 +%undefine _include_frame_pointers %ifarch ppc64le %global libomp_arch ppc64 @@ -13,21 +32,22 @@ %endif Name: libomp -Version: %{libomp_version} +Version: %{libomp_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} Release: 1%{?dist} Summary: OpenMP runtime for clang -License: NCSA +License: Apache-2.0 WITH LLVM-exception OR NCSA URL: http://openmp.llvm.org -Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}/%{libomp_srcdir}.tar.xz -Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}/%{libomp_srcdir}.tar.xz.sig +%if %{with snapshot_build} +Source0: %{llvm_snapshot_source_prefix}openmp-%{llvm_snapshot_yyyymmdd}.src.tar.xz +%{llvm_snapshot_extra_source_tags} +%else +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{libomp_srcdir}.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{libomp_srcdir}.tar.xz.sig Source2: release-keys.asc -Source3: run-lit-tests -Source4: lit.fedora.cfg.py -Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz -Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig +%endif -BuildRequires: clang +BuildRequires: clang >= %{maj_ver} # For clang-offload-packager BuildRequires: clang-tools-extra BuildRequires: cmake @@ -43,9 +63,12 @@ BuildRequires: gnupg2 # libomptarget needs the llvm cmake files BuildRequires: llvm-devel +BuildRequires: llvm-cmake-utils Requires: elfutils-libelf%{?isa} +Obsoletes: libomp-test < 17.0.2 + # libomp does not support s390x. ExcludeArch: s390x @@ -60,25 +83,10 @@ Requires: clang-resource-filesystem%{?isa} = %{version} %description devel OpenMP header files. -%package test -Summary: OpenMP regression tests -Requires: %{name}%{?isa} = %{version}-%{release} -Requires: %{name}-devel%{?isa} = %{version}-%{release} -Requires: clang -Requires: llvm -Requires: python3-lit - -%description test -OpenMP regression tests - %prep +%if %{without snapshot_build} %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE6}' --data='%{SOURCE5}' -%setup -T -q -b 5 -n %{cmake_srcdir} -# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir}, -# but this is not a CACHED variable, so we can't actually set it externally :( -cd .. -mv %{cmake_srcdir} cmake +%endif %autosetup -n %{libomp_srcdir} -p2 %build @@ -87,16 +95,18 @@ mv %{cmake_srcdir} cmake # Building openmp with LTO fails with GCC but works with Clang %define _lto_cflags %{nil} %endif - %cmake -GNinja \ -DLIBOMP_INSTALL_ALIASES=OFF \ - -DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \ + -DCMAKE_MODULE_PATH=%{_datadir}/llvm/cmake/Modules \ -DLLVM_DIR=%{_libdir}/cmake/llvm \ - -DCMAKE_INSTALL_INCLUDEDIR=%{_libdir}/clang/%{maj_ver}/include \ + -DCMAKE_INSTALL_INCLUDEDIR=%{_prefix}/lib/clang/%{maj_ver}/include \ %if 0%{?__isa_bits} == 64 -DOPENMP_LIBDIR_SUFFIX=64 \ %else -DOPENMP_LIBDIR_SUFFIX= \ +%endif +%if %{with snapshot_build} + -DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \ %endif -DCMAKE_SKIP_RPATH:BOOL=ON @@ -106,30 +116,6 @@ mv %{cmake_srcdir} cmake %install %cmake_install -# Test package setup -%global libomp_srcdir %{_datadir}/libomp/src/ -%global libomp_testdir %{libomp_srcdir}/runtime/test/ -%global lit_cfg %{libomp_testdir}/%{_arch}.site.cfg.py -%global lit_fedora_cfg %{_datadir}/libomp/lit.fedora.cfg.py - -install -d %{buildroot}%{libomp_srcdir}/runtime -cp -R runtime/test %{buildroot}%{libomp_srcdir}/runtime -cp -R runtime/src %{buildroot}%{libomp_srcdir}/runtime - -# Generate lit config files. Strip off the last line that initiates the -# test run, so we can customize the configuration. -head -n -1 %{_vpath_builddir}/runtime/test/lit.site.cfg >> %{buildroot}%{lit_cfg} - -# Install custom fedora config file -cp %{SOURCE4} %{buildroot}%{lit_fedora_cfg} - -# Patch lit config files to load custom fedora config -echo "lit_config.load_config(config, '%{lit_fedora_cfg}')" >> %{buildroot}%{lit_cfg} - -# Install test script -install -d %{buildroot}%{_libexecdir}/tests/libomp -install -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/tests/libomp - # Remove static libraries with equivalent shared libraries rm -rf %{buildroot}%{_libdir}/libarcher_static.a @@ -144,41 +130,44 @@ rm -rf %{buildroot}%{_libdir}/libarcher_static.a %{_libdir}/libarcher.so %endif %ifnarch %{ix86} %{arm} -%{_libdir}/libomptarget.rtl.amdgpu.so.%{maj_ver} -%{_libdir}/libomptarget.rtl.amdgpu.nextgen.so.%{maj_ver} -%{_libdir}/libomptarget.rtl.cuda.so.%{maj_ver} -%{_libdir}/libomptarget.rtl.cuda.nextgen.so.%{maj_ver} -%{_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{maj_ver} -%{_libdir}/libomptarget.rtl.%{libomp_arch}.nextgen.so.%{maj_ver} -%{_libdir}/libomptarget.so.%{maj_ver} +# libomptarget is not supported on 32-bit systems. +%{_libdir}/libomptarget.rtl.amdgpu.so.%{so_suffix} +%{_libdir}/libomptarget.rtl.cuda.so.%{so_suffix} +%{_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{so_suffix} +%{_libdir}/libomptarget.so.%{so_suffix} %endif %files devel -%{_libdir}/clang/%{maj_ver}/include/omp.h -%{_libdir}/cmake/openmp/FindOpenMPTarget.cmake +%{_prefix}/lib/clang/%{maj_ver}/include/omp.h %ifnarch %{arm} -%{_libdir}/clang/%{maj_ver}/include/omp-tools.h -%{_libdir}/clang/%{maj_ver}/include/ompt.h -%{_libdir}/clang/%{maj_ver}/include/ompt-multiplex.h +%{_prefix}/lib/clang/%{maj_ver}/include/omp-tools.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompt.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompt-multiplex.h %endif +%{_libdir}/cmake/openmp/FindOpenMPTarget.cmake %ifnarch %{ix86} %{arm} +# libomptarget is not supported on 32-bit systems. %{_libdir}/libomptarget.rtl.amdgpu.so -%{_libdir}/libomptarget.rtl.amdgpu.nextgen.so %{_libdir}/libomptarget.rtl.cuda.so -%{_libdir}/libomptarget.rtl.cuda.nextgen.so %{_libdir}/libomptarget.rtl.%{libomp_arch}.so -%{_libdir}/libomptarget.rtl.%{libomp_arch}.nextgen.so %{_libdir}/libomptarget.devicertl.a %{_libdir}/libomptarget-amdgpu-*.bc %{_libdir}/libomptarget-nvptx-*.bc %{_libdir}/libomptarget.so %endif -%files test -%{_datadir}/libomp -%{_libexecdir}/tests/libomp/ - %changelog +%{?llvm_snapshot_changelog_entry} + +* Mon Dec 11 2023 Timm Bäder - 17.0.6-1 +- Update to 17.0.6 + +* Fri Oct 20 2023 Timm Bäder - 17.0.1-2 +- Add obsoletes for libomp-test package. + +* Fri Sep 29 2023 Timm Bäder - 17.0.1-1 +- Update to 17.0.1 + * Wed Jul 05 2023 Nikita Popov - 16.0.6-1 - Update to LLVM 16.0.6