Blame intel-cm-compiler.spec

b02f78d
# Memory requirements are insane otherwise
b02f78d
%define _lto_cflags %{nil}
b02f78d
9b94df2
%global commit cc4f5b62a39543e78df13008c5ab3f8256e01a5f
9b94df2
%global shortcommit %(c=%{commit}; echo ${c:0:7})
9b94df2
%global vc_date 20240131
9b94df2
%global vc_rev .%{vc_date}git%(c=%{commit}; echo ${c:0:7})
9b94df2
9b94df2
# The package will have to be adjusted if we ever stop needing compat, but I don't expect that
9b94df2
%global llvm_compat 11
9b94df2
b02f78d
Name: intel-cm-compiler
6a07f1b
Version: 1.0.144
9b94df2
Release: 7%{?vc_rev}%{?dist}
b02f78d
Summary: Intel C for Metal compiler
b02f78d
b02f78d
License: MIT
b02f78d
URL: https://github.com/intel/cm-compiler
9b94df2
Source0: %{url}/archive/%{commit}/cm-compiler-%{shortcommit}.tar.gz
b02f78d
Patch01: 0001-Include-LLVMSPIRVLib.h-from-subdir-link-to-LLVMGenXI.patch
b02f78d
27c0206
# This is Intel-only compiler
27c0206
ExclusiveArch:  i686 x86_64
27c0206
b02f78d
BuildRequires: cmake
b02f78d
BuildRequires: make
b02f78d
BuildRequires: gcc
b02f78d
BuildRequires: gcc-c++
b02f78d
BuildRequires: ninja-build
9b94df2
BuildRequires: intel-llvm-vc-intrinsics%{?llvm_compat}-devel
9b94df2
BuildRequires: spirv-llvm-translator%{?llvm_compat}-devel
9b94df2
BuildRequires: llvm%{?llvm_compat}-devel
9b94df2
BuildRequires: llvm%{?llvm_compat}-static
b02f78d
BuildRequires: zlib-devel
b02f78d
b02f78d
# For pathfix.py
b02f78d
BuildRequires: python3-devel
b02f78d
b02f78d
# The compiler itself just requires everything...
b02f78d
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
b02f78d
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
b02f78d
b02f78d
%description
b02f78d
The Intel C for Metal compiler is a open source compiler that implements C for Metal programming language.
b02f78d
C for Metal is a new GPU kernel programming language for Intel HD Graphics.
b02f78d
b02f78d
%package libs
b02f78d
Summary: Libraries for %{summary}
b02f78d
b02f78d
%description libs
b02f78d
This package contains libraries applications built by %{summary}
b02f78d
b02f78d
%package devel
b02f78d
Summary: Development files for %{summary}
b02f78d
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
b02f78d
b02f78d
%description devel
b02f78d
This package contains libraries and header files for
b02f78d
developing against %{summary}
b02f78d
b02f78d
%prep
9b94df2
%autosetup -p1 -n cm-compiler-%{commit}
b02f78d
9b94df2
cd clang/
2eb9dc8
%{__python3} %{_rpmconfigdir}/redhat/pathfix.py -i %{__python3} -pn \
81cbe8e
    tools/clang-format/*.py \
81cbe8e
    tools/clang-format/git-clang-format \
81cbe8e
    utils/hmaptool/hmaptool \
81cbe8e
    tools/scan-view/bin/scan-view
b02f78d
b02f78d
%build
6a07f1b
cd clang/
b02f78d
%cmake \
9b94df2
    -DLLVM_CMAKE_PATH=%{_libdir}/llvm%{?llvm_compat} \
b02f78d
    -DLLVMGenXIntrinsics_DIR="/usr/include/llvm/GenXIntrinsics/" \
b02f78d
    -DBUILD_SHARED_LIBS:BOOL=OFF \
b02f78d
    -DCMAKE_SKIP_RPATH:BOOL=ON \
b02f78d
    -DCMAKE_BUILD_TYPE=Release \
b02f78d
    -DLLVM_INCLUDE_TESTS=OFF \
b02f78d
%if 0%{?__isa_bits} == 64
81cbe8e
    -DLLVM_LIBDIR_SUFFIX=64 \
b02f78d
%else
81cbe8e
    -DLLVM_LIBDIR_SUFFIX= \
b02f78d
%endif
b02f78d
    -G Ninja
b02f78d
b02f78d
%cmake_build
b02f78d
b02f78d
%install
6a07f1b
cd clang/
b02f78d
%cmake_install
b02f78d
b02f78d
# Clean up
b02f78d
find %{buildroot}/usr/bin ! -name 'cmc' -type f -delete
b02f78d
find %{buildroot}/usr/bin ! -name 'cmc' -type l -delete
9b94df2
find %{buildroot}%{_libdir} ! -name 'libclangFEWrapper.so.%{?llvm_compat}' -type f -delete
81cbe8e
find %{buildroot}%{_libdir} ! -name 'libclangFEWrapper.so' -type l -delete
b02f78d
rm -rf %{buildroot}/usr/include/clang
81cbe8e
rm -rf %{buildroot}%{_libdir}/clang
81cbe8e
rm -rf %{buildroot}%{_libdir}/cmake
b02f78d
rm -rf %{buildroot}/usr/include/clang
b02f78d
rm -rf %{buildroot}/usr/include/clang-c
b02f78d
rm -rf %{buildroot}/usr/share/clang
b02f78d
rm -rf %{buildroot}/usr/share/scan-view
b02f78d
rm -rf %{buildroot}/usr/share/scan-build
b02f78d
rm -f %{buildroot}/usr/libexec/c++-analyzer
b02f78d
rm -f %{buildroot}/usr/libexec/ccc-analyzer
b02f78d
rm -f %{buildroot}/usr/share/man/man1/scan-build.1
b02f78d
b02f78d
%files
6a07f1b
%license clang/LICENSE.TXT
b02f78d
%{_bindir}/cmc
b02f78d
b02f78d
%files libs
6a07f1b
%license clang/LICENSE.TXT
9b94df2
%{_libdir}/libclangFEWrapper.so.%{?llvm_compat}
b02f78d
b02f78d
%files devel
b02f78d
%{_includedir}/cm
b02f78d
%{_includedir}/opencl-c-common.h
b02f78d
%{_libdir}/libclangFEWrapper.so
b02f78d
b02f78d
%changelog
9b94df2
* Mon Feb 12 2024 Frantisek Zatloukal <fzatlouk@redhat.com> - 1.0.144-7.20240131gitcc4f5b6
9b94df2
- cm-compiler rebase to LLVM 11
9b94df2
3cd47de
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.144-6
3cd47de
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
3cd47de
c002dbc
* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.144-5
c002dbc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
c002dbc
be967ae
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.144-4
be967ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
be967ae
3a6905f
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.144-3
3a6905f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
3a6905f
e844f9a
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.144-2
e844f9a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
e844f9a
6a07f1b
* Wed May 11 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 1.0.144-1
6a07f1b
- cm-compiler-1.0.144
6a07f1b
87f48d9
* Thu Jan 27 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 1.0.119-2
87f48d9
- Address some packaging issues for packaging guidelines compliance
87f48d9
b02f78d
* Mon Dec 27 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 1.0.119-1
b02f78d
- Initial package