%global commit 8c386c94749a78392fd763f8449ca3e55f030ffd %global shortcommit %(c=%{commit}; echo ${c:0:9}) %ifarch ppc64le %global libomp_arch ppc64 %else %global libomp_arch %{_arch} %endif Name: libomp Version: 12.0.0 Release: 0.17.git%{shortcommit}%{?dist} Summary: OpenMP runtime for clang License: NCSA URL: http://openmp.llvm.org Source0: openmp-%{shortcommit}.tar.xz Source1: run-lit-tests Source2: lit.fedora.cfg.py Patch0: 0001-CMake-Make-LIBOMP_HEADERS_INSTALL_PATH-a-cache-varia.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: elfutils-libelf-devel BuildRequires: perl BuildRequires: perl-Data-Dumper BuildRequires: perl-Encode BuildRequires: libffi-devel # For gpg source verification BuildRequires: gnupg2 Requires: elfutils-libelf%{?isa} # libomp does not support s390x. ExcludeArch: s390x %description OpenMP runtime for clang. %package devel Summary: OpenMP header files Requires: clang-devel%{?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: gcc Requires: gcc-c++ Requires: python3-lit %description test OpenMP regression tests %prep %autosetup -n openmp-%{shortcommit} -p1 %build # LTO causes build failures in this package. Disable LTO for now %define _lto_cflags %{nil} %cmake -B "%{_vpath_builddir}" \ -GNinja \ -DLIBOMP_INSTALL_ALIASES=OFF \ -DLIBOMP_HEADERS_INSTALL_PATH:PATH=%{_libdir}/clang/%{version}/include \ %if 0%{?__isa_bits} == 64 -DOPENMP_LIBDIR_SUFFIX=64 \ %else -DOPENMP_LIBDIR_SUFFIX= \ %endif %ninja_build -C "%{_vpath_builddir}" %install %ninja_install -C "%{_vpath_builddir}" # 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 %{SOURCE2} %{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 %{SOURCE1} %{buildroot}%{_libexecdir}/tests/libomp # Remove static libraries with equivalent shared libraries rm -rf %{buildroot}%{_libdir}/libarcher_static.a %check %ninja_build -C "%{_vpath_builddir}" check-openmp %files %license LICENSE.txt %{_libdir}/libomp.so %{_libdir}/libomptarget.so %ifnarch %{arm} %{_libdir}/libarcher.so %endif %ifnarch %{arm} %{ix86} %{_libdir}/libomptarget.rtl.%{libomp_arch}.so %endif %files devel %{_libdir}/clang/%{version}/include/omp.h %ifnarch %{arm} %{_libdir}/clang/%{version}/include/omp-tools.h %{_libdir}/clang/%{version}/include/ompt.h # FIXME: This is probably wrong. Seems like LIBOMP_HEADERS_INSTALL may # not be respected. %{_includedir}/ompt-multiplex.h %endif %files test %{_datadir}/libomp %{_libexecdir}/tests/libomp/ %changelog