2023-12-04 10:40:04 +08:00
|
|
|
%bcond_without sys_llvm
|
2023-07-20 21:03:02 +08:00
|
|
|
%bcond_with check
|
2024-07-05 17:29:56 +08:00
|
|
|
%bcond_without toolchain_clang
|
2024-08-20 20:29:23 +08:00
|
|
|
%bcond_without bisheng_autotuner
|
2024-07-05 17:29:56 +08:00
|
|
|
|
|
|
|
|
%if %{with toolchain_clang}
|
|
|
|
|
%global toolchain clang
|
|
|
|
|
%endif
|
2023-07-20 21:03:02 +08:00
|
|
|
|
2023-12-04 10:40:04 +08:00
|
|
|
%global toolchain clang
|
|
|
|
|
|
|
|
|
|
%global maj_ver 17
|
2023-07-20 21:03:02 +08:00
|
|
|
%global min_ver 0
|
2023-12-04 10:40:04 +08:00
|
|
|
%global patch_ver 6
|
2023-07-20 21:03:02 +08:00
|
|
|
%global openmp_version %{maj_ver}.%{min_ver}.%{patch_ver}
|
|
|
|
|
%global openmp_srcdir openmp-%{openmp_version}.src
|
|
|
|
|
|
|
|
|
|
%if %{with sys_llvm}
|
|
|
|
|
%global pkg_name libomp
|
|
|
|
|
%global install_prefix %{_prefix}
|
2023-12-04 10:40:04 +08:00
|
|
|
%global install_datadir %{_datadir}
|
2023-07-20 21:03:02 +08:00
|
|
|
%else
|
|
|
|
|
%global pkg_name libomp%{maj_ver}
|
|
|
|
|
%global install_prefix %{_libdir}/llvm%{maj_ver}
|
2023-12-04 10:40:04 +08:00
|
|
|
%global install_datadir %{install_prefix}/share
|
2023-07-20 21:03:02 +08:00
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%global install_includedir %{install_prefix}/include
|
|
|
|
|
%global install_libdir %{install_prefix}/%{_lib}
|
|
|
|
|
%global install_libexecdir %{install_prefix}/libexec
|
|
|
|
|
%global install_sharedir %{install_prefix}/share
|
|
|
|
|
|
|
|
|
|
%ifarch ppc64le
|
|
|
|
|
%global libomp_arch ppc64
|
|
|
|
|
%else
|
|
|
|
|
%global libomp_arch %{_arch}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
Name: %{pkg_name}
|
|
|
|
|
Version: %{openmp_version}
|
2024-09-04 07:55:15 +00:00
|
|
|
Release: 4
|
2023-07-20 21:03:02 +08:00
|
|
|
Summary: OpenMP runtime for clang
|
|
|
|
|
|
|
|
|
|
License: Apache License 2.0
|
|
|
|
|
URL: http://openmp.llvm.org
|
|
|
|
|
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{openmp_version}/%{openmp_srcdir}.tar.xz
|
|
|
|
|
|
|
|
|
|
BuildRequires: gcc gcc-c++
|
|
|
|
|
BuildRequires: cmake
|
|
|
|
|
BuildRequires: ninja-build
|
|
|
|
|
BuildRequires: elfutils-libelf-devel
|
|
|
|
|
BuildRequires: perl
|
|
|
|
|
BuildRequires: perl-Data-Dumper
|
|
|
|
|
BuildRequires: perl-Encode
|
|
|
|
|
BuildRequires: libffi-devel
|
|
|
|
|
%if "%toolchain" == "clang"
|
|
|
|
|
BuildRequires: clang
|
|
|
|
|
BuildRequires: clang-tools-extra
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with sys_llvm}
|
|
|
|
|
BuildRequires: llvm-devel llvm-test
|
2023-12-04 10:40:04 +08:00
|
|
|
BuildRequires: llvm-cmake-utils = %{version}
|
2023-07-20 21:03:02 +08:00
|
|
|
%else
|
|
|
|
|
BuildRequires: llvm%{maj_ver}-devel
|
|
|
|
|
BuildRequires: llvm%{maj_ver}-test
|
2023-12-04 10:40:04 +08:00
|
|
|
BuildRequires: llvm%{maj_ver}-cmake-utils = %{version}
|
2023-07-20 21:03:02 +08:00
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
Requires: elfutils-libelf%{?isa}
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
OpenMP runtime for clang.
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
|
Summary: OpenMP header files
|
|
|
|
|
Requires: %{name}%{?isa} = %{version}-%{release}
|
|
|
|
|
%if %{with sys_llvm}
|
|
|
|
|
Requires: clang-resource-filesystem%{?isa} = %{version}
|
|
|
|
|
%else
|
|
|
|
|
Requires: clang%{maj_ver}-resource-filesystem%{?isa} = %{version}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
|
OpenMP header files.
|
2023-12-04 10:40:04 +08:00
|
|
|
|
2023-07-20 21:03:02 +08:00
|
|
|
%prep
|
|
|
|
|
%autosetup -n %{openmp_srcdir} -p2
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
|
|
%cmake -GNinja \
|
|
|
|
|
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
|
|
|
|
|
-DLIBOMP_INSTALL_ALIASES=OFF \
|
2023-12-04 10:40:04 +08:00
|
|
|
-DCMAKE_MODULE_PATH=%{install_datadir}/llvm/cmake/Modules \
|
2023-07-20 21:03:02 +08:00
|
|
|
-DLLVM_DIR=%{install_libdir}/cmake/llvm \
|
2023-12-04 10:40:04 +08:00
|
|
|
-DCMAKE_INSTALL_INCLUDEDIR=%{install_libdir}/clang/%{maj_ver}/include \
|
2023-07-20 21:03:02 +08:00
|
|
|
%if 0%{?__isa_bits} == 64
|
|
|
|
|
-DOPENMP_LIBDIR_SUFFIX=64 \
|
|
|
|
|
%else
|
|
|
|
|
-DOPENMP_LIBDIR_SUFFIX= \
|
2024-07-05 17:29:56 +08:00
|
|
|
%endif
|
|
|
|
|
%if "%{toolchain}" == "clang"
|
|
|
|
|
-DCMAKE_C_COMPILER=clang \
|
|
|
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
2024-08-20 20:29:23 +08:00
|
|
|
%endif
|
|
|
|
|
%if %{with bisheng_autotuner}
|
|
|
|
|
-DLLVM_ENABLE_AUTOTUNER=ON \
|
2023-07-20 21:03:02 +08:00
|
|
|
%endif
|
|
|
|
|
-DCMAKE_SKIP_RPATH:BOOL=ON
|
|
|
|
|
|
|
|
|
|
%ninja_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%ninja_install
|
|
|
|
|
rm -rf %{buildroot}%{install_libdir}/libarcher_static.a
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
|
|
|
|
|
%files
|
2023-12-04 10:40:04 +08:00
|
|
|
%license LICENSE.TXT
|
2023-07-20 21:03:02 +08:00
|
|
|
%{install_libdir}/libomp.so
|
2023-12-04 10:40:04 +08:00
|
|
|
%{install_libdir}/libompd.so
|
2023-07-20 21:03:02 +08:00
|
|
|
%ifnarch %{arm}
|
|
|
|
|
%{install_libdir}/libarcher.so
|
|
|
|
|
%endif
|
2024-06-05 02:28:20 +00:00
|
|
|
%ifnarch %{ix86} %{arm} riscv64 loongarch64
|
2023-12-04 10:40:04 +08:00
|
|
|
%{install_libdir}/libomptarget.rtl.amdgpu.so.%{maj_ver}
|
|
|
|
|
%{install_libdir}/libomptarget.rtl.cuda.so.%{maj_ver}
|
|
|
|
|
%{install_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{maj_ver}
|
|
|
|
|
%endif
|
|
|
|
|
%{install_libdir}/libomptarget.so.%{maj_ver}
|
2023-07-20 21:03:02 +08:00
|
|
|
|
|
|
|
|
%files devel
|
2023-12-04 10:40:04 +08:00
|
|
|
%{install_libdir}/clang/%{maj_ver}/include/omp.h
|
|
|
|
|
%{install_libdir}/cmake/openmp/FindOpenMPTarget.cmake
|
2023-07-20 21:03:02 +08:00
|
|
|
%ifnarch %{arm}
|
2023-12-04 10:40:04 +08:00
|
|
|
%{install_libdir}/clang/%{maj_ver}/include/omp-tools.h
|
|
|
|
|
%{install_libdir}/clang/%{maj_ver}/include/ompt.h
|
|
|
|
|
%{install_libdir}/clang/%{maj_ver}/include/ompt-multiplex.h
|
2023-07-20 21:03:02 +08:00
|
|
|
%endif
|
2023-12-04 10:40:04 +08:00
|
|
|
%ifnarch %{ix86} %{arm}
|
2024-06-05 02:28:20 +00:00
|
|
|
%ifnarch riscv64 loongarch64
|
2023-12-04 10:40:04 +08:00
|
|
|
%{install_libdir}/libomptarget.rtl.amdgpu.so
|
|
|
|
|
%{install_libdir}/libomptarget.rtl.cuda.so
|
|
|
|
|
%{install_libdir}/libomptarget.rtl.%{libomp_arch}.so
|
|
|
|
|
%endif
|
|
|
|
|
%{install_libdir}/libomptarget.devicertl.a
|
|
|
|
|
%{install_libdir}/libomptarget-amdgpu-*.bc
|
|
|
|
|
%{install_libdir}/libomptarget-nvptx-*.bc
|
|
|
|
|
%endif
|
|
|
|
|
%{install_libdir}/libomptarget.so
|
2023-07-20 21:03:02 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2024-09-04 07:55:15 +00:00
|
|
|
* Tue Aug 20 2024 liyunfei <liyunfei33@huawei.com> - 17.0.6-4
|
2024-08-20 20:29:23 +08:00
|
|
|
- Add BiSheng Autotuner support.
|
|
|
|
|
|
2024-09-04 07:55:15 +00:00
|
|
|
* Fri Jul 5 2024 liyunfei <liyunfei33@huawei.com> - 17.0.6-3
|
2024-07-05 17:29:56 +08:00
|
|
|
- Add toolchain_clang build support
|
|
|
|
|
|
2024-06-05 02:28:20 +00:00
|
|
|
* Wed Jun 05 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 17.0.6-2
|
|
|
|
|
- fix build error for loongarch64
|
|
|
|
|
|
2023-12-04 10:40:04 +08:00
|
|
|
* Mon Dec 4 2023 zhoujing <zhoujing106@huawei.com> - 17.0.6-1
|
|
|
|
|
- Update to 17.0.6
|
|
|
|
|
|
2023-07-20 21:03:02 +08:00
|
|
|
* Sat Aug 26 2023 cf-zhao <zhaochuanfeng@huawei.com> - 12.0.1-1
|
|
|
|
|
- Initial version to 12.0.1
|