libomp/libomp.spec

102 lines
2.3 KiB
RPMSpec
Raw Normal View History

2023-06-08 11:06:54 +08:00
%global toolchain clang
%global maj_ver 12
%global libomp_version %{maj_ver}.0.1
%global libomp_srcdir openmp-%{libomp_version}.src
%ifarch ppc64le
%global libomp_arch ppc64
%else
%global libomp_arch %{_arch}
%endif
Name: libomp
Version: %{libomp_version}
2024-04-18 11:01:44 +08:00
Release: 2
2023-06-08 11:06:54 +08:00
Summary: OpenMP runtime for clang
License: Apache-2.0 WITH LLVM-exception OR NCSA
URL: http://openmp.llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/%{libomp_srcdir}.tar.xz
2024-04-18 11:01:44 +08:00
Patch0: 0001-libomp-add-support-for-loongarch64.patch
2023-06-08 11:06:54 +08:00
BuildRequires: clang
# For clang-offload-packager
BuildRequires: clang-tools-extra
BuildRequires: cmake
BuildRequires: elfutils-libelf-devel
BuildRequires: perl
BuildRequires: perl-Data-Dumper
BuildRequires: perl-Encode
BuildRequires: libffi-devel
#BuildRequires: ninja-build
# libomptarget needs the llvm cmake files
BuildRequires: llvm-devel
Requires: elfutils-libelf%{?isa}
%description
OpenMP runtime for clang.
%package devel
Summary: OpenMP header files
Requires: %{name}%{?isa} = %{version}-%{release}
2024-08-24 09:06:16 +08:00
Requires: clang-resource-filesystem
2023-06-08 11:06:54 +08:00
%description devel
OpenMP header files.
%prep
2024-04-18 11:01:44 +08:00
%autosetup -n %{libomp_srcdir} -p1
2023-06-08 11:06:54 +08:00
%build
mkdir build && cd build
# TODO: LIBOMP_HAVE_VERSION_SCRIPT_FLAG should be set automatically.
%cmake \
-DOPENMP_ENABLE_LIBOMPTARGET:BOOL=ON \
-DLIBOMP_INSTALL_ALIASES=OFF \
-DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
-DLLVM_DIR=%{_libdir}/cmake/llvm \
-DLIBOMPTARGET_LLVM_INCLUDE_DIRS=%{_includedir}/llvm \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_DATADIR="%{_libdir}" \
%if 0%{?__isa_bits} == 64
-DOPENMP_LIBDIR_SUFFIX=64 \
%else
-DOPENMP_LIBDIR_SUFFIX= \
%endif
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DLIBOMP_HAVE_VERSION_SCRIPT_FLAG:BOOL=ON \
..
%make_build
%install
%make_install -C build
mkdir -p %{buildroot}%{_datadir}/licenses/libomp/
cp LICENSE.txt %{buildroot}%{_datadir}/licenses/libomp/
%check
%make_build -C build check-openmp || echo "CHECK FAIL"
%files
%license LICENSE.txt
%{_libdir}/*.so
%files devel
%{_includedir}/omp.h
%{_includedir}/omp-tools.h
%{_includedir}/ompt.h
%{_includedir}/ompt-multiplex.h
%{_libdir}/*.a
%changelog
2024-04-18 11:01:44 +08:00
* Thu Apr 18 2024 Pengda Dou <doupengda@loongson.cn> - 12.0.1-2
- add support for loongarch64
* Tue May 9 2023 will_niutao <niutao2@huawei.com> - 12.0.1-1
2023-06-08 11:06:54 +08:00
- Init for openEuler