File intel-opencl-clang.spec of Package intel-opencl-clang

Name:           intel-opencl-clang
Version:        15.0.1
Release:        0
Summary:        Intel OpenCL Clang compiler
License:        Apache-2.0 WITH LLVM-exception
Group:          Development/Languages/C and C++
Url:            https://github.com/intel/opencl-clang
Source0:        intel-opencl-clang-5824297.tar.gz
Source1:        SPIRV-LLVM-Translator-15.0.13.tar.gz
BuildRequires:  cmake >= 3.20
BuildRequires:  gcc-c++
BuildRequires:  llvm15-devel >= 15.0.0
BuildRequires:  clang15-devel >= 15.0.0
BuildRequires:  python3
BuildRequires:  ninja
BuildRequires:  pkgconfig
BuildRequires:  zlib-devel
BuildRequires:  ncurses-devel
BuildRequires:  libxml2-devel
BuildRequires:  libffi-devel
BuildRequires:  openssl-devel

%description
Intel OpenCL Clang is a wrapper for Clang compiler supporting OpenCL
kernel compilation with SPIR-V target.

%package devel
Summary:        Development files for intel-opencl-clang
Group:          Development/Libraries
Requires:       %{name} = %{version}

%description devel
Development files for Intel OpenCL Clang compiler.

%prep
%setup -q -n opencl-clang-5824297 -a 1

%build
mkdir -p build
cd build

%cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
    -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF \
    -DSPIRV_TRANSLATOR_DIR=%{_builddir}/opencl-clang-5824297/SPIRV-LLVM-Translator-15.0.13 \
    -DLLVM_DIR=%{_libdir}/cmake/llvm \
    -DCLANG_DIR=%{_libdir}/cmake/clang \
    -DPREFERRED_LLVM_VERSION=15.0 \
    -DCMAKE_CXX_STANDARD=17 \
    -DCMAKE_CXX_STANDARD_REQUIRED=ON \
    -DCMAKE_C_STANDARD=11 \
    -DCMAKE_C_STANDARD_REQUIRED=ON \
    ..

%make_build

%install
%cmake_install

%files
%{_libdir}/libopencl-clang.so.*
%{_libdir}/libopencl-clang.a

%files devel
%{_includedir}/opencl-clang/
%{_libdir}/cmake/opencl-clang/
%{_libdir}/libopencl-clang.so
%{_libdir}/pkgconfig/opencl-clang.pc

%changelog
* Sun Sep 21 2025 Build Service <buildservice@opensuse.org> - 15.0.1-0
- Initial package for openSUSE Tumbleweed 2025
- Version 15.0.1 with LLVM 15 compatibility
openSUSE Build Service is sponsored by