%undefine _auto_set_build_flags %define _build_id_links none %define _unpackaged_files_terminate_build 0 %global ROCM_MAJOR_VERSION 5 %global ROCM_MINOR_VERSION 2 %global ROCM_PATCH_VERSION 3 %global ROCM_MAGIC_VERSION 109 %global ROCM_INSTALL_DIR /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION} %global ROCM_LIBPATCH_VERSION 50203 %global ROCM_GIT_DIR %{buildroot}/src/rocm-build/git %global ROCM_GIT_TAG rocm-5.2.x %global ROCM_BUILD_DIR %{buildroot}/src/rocm-build/build %global ROCM_PATCH_DIR %{buildroot}/src/rocm-build/patch %global ROCCLR_GIT https://github.com/ROCm-Developer-Tools/ROCclr.git %global ROCM_OCL_GIT https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git #%global ROCM_PATCH_1 rocclr-gfx803.patch %global toolchain clang BuildRequires: wget BuildRequires: libstdc++-devel BuildRequires: rocm-llvm BuildRequires: rocm-cmake BuildRequires: ninja-build BuildRequires: clang BuildRequires: cmake BuildRequires: numactl-devel BuildRequires: numactl BuildRequires: ncurses-devel BuildRequires: pciutils-devel BuildRequires: python3 BuildRequires: git BuildRequires: python3-devel BuildRequires: hsa-rocr-devel BuildRequires: elfutils-libelf BuildRequires: elfutils-libelf-devel BuildRequires: hsakmt-roct-devel BuildRequires: rocm-device-libs BuildRequires: libdrm-devel BuildRequires: libdrm BuildRequires: libglvnd-devel BuildRequires: doxygen BuildRequires: perl BuildRequires: gcc-plugin-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: clang BuildRequires: libstdc++-devel BuildRequires: clang BuildRequires: ninja-build BuildRequires: cmake BuildRequires: python3 BuildRequires: git BuildRequires: python3-devel BuildRequires: rocm-llvm BuildRequires: rocm-cmake BuildRequires: clang BuildRequires: ninja-build BuildRequires: cmake BuildRequires: libglvnd-devel BuildRequires: numactl-devel BuildRequires: numactl BuildRequires: python3 BuildRequires: git BuildRequires: python3-devel BuildRequires: wget BuildRequires: gcc-plugin-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: clang BuildRequires: cmake BuildRequires: ninja-build BuildRequires: zlib-devel BuildRequires: libffi-devel BuildRequires: ncurses-devel BuildRequires: python3-psutil BuildRequires: valgrind-devel BuildRequires: libedit-devel BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: gnupg2 BuildRequires: comgr BuildRequires: clang BuildRequires: ninja-build BuildRequires: cmake BuildRequires: libglvnd-devel BuildRequires: numactl-devel BuildRequires: numactl BuildRequires: python3 BuildRequires: git BuildRequires: python3-devel BuildRequires: wget BuildRequires: gcc-plugin-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: clang BuildRequires: cmake BuildRequires: ninja-build BuildRequires: zlib-devel BuildRequires: libffi-devel BuildRequires: ncurses-devel BuildRequires: python3-psutil BuildRequires: python3-sphinx BuildRequires: python3-recommonmark BuildRequires: multilib-rpm-config BuildRequires: binutils-devel BuildRequires: valgrind-devel BuildRequires: libedit-devel BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: llvm-devel Requires: comgr Requires: rocm-core Requires: rocminfo Requires: rocm-opencl-runtime Provides: rocm-opencl-sdk Provides: rocm-opencl-devel Provides: rocm-opencl-sdk(x86-64) Provides: rocm-opencl-devel(x86-64) Provides: rocm-opencl-runtime-devel Provides: rocm-opencl-runtime-devel(x86-64) Obsoletes: rocm-opencl-devel Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig BuildArch: x86_64 Name: rocm-opencl-runtime-devel Version: %{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}.%{ROCM_LIBPATCH_VERSION} Release: copr%{dist} License: MIT Group: System Environment/Libraries Summary: Radeon Open Compute - OpenCL runtime development kit %description Radeon Open Compute - OpenCL runtime development kit %build # Make basic structure mkdir -p %{ROCM_GIT_DIR} mkdir -p %{ROCM_BUILD_DIR} mkdir -p %{ROCM_PATCH_DIR} # Level 1 : GIT Clone cd %{ROCM_GIT_DIR} git clone -b "%{ROCM_GIT_TAG}" "%{ROCCLR_GIT}" git clone -b "%{ROCM_GIT_TAG}" "%{ROCM_OCL_GIT}" mkdir -p %{ROCM_BUILD_DIR}/rocm-opencl-runtime cd %{ROCM_BUILD_DIR}/rocm-opencl-runtime pushd . # Level 2 : Build cd %{ROCM_BUILD_DIR}/rocm-opencl-runtime CC=clang CXX=clang++ \ cmake -Wno-dev -GNinja -S %{ROCM_GIT_DIR}/ROCm-OpenCL-Runtime \ -DCMAKE_INSTALL_PREFIX="%{ROCM_INSTALL_DIR}" \ -DCMAKE_BUILD_TYPE=Release DESTDIR="%{buildroot}" ninja -j$(nproc) install # Level 4 : Package DESTDIR=%{buildroot} ninja install mkdir -p %{buildroot}/opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/.info touch %{buildroot}/opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/.info/version-ocl-sdk echo "%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}-%{ROCM_MAGIC_VERSION}" > %{buildroot}/opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/.info/version-ocl-sdk %files # rocm-opencl-devel /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl.hpp /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl2.hpp /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_dx9_media_sharing_intel.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_ext.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_ext_intel.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_gl.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_gl_ext.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_icd.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_platform.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_va_api_media_sharing_intel.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/cl_version.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/include/CL/opencl.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl.hpp /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl2.hpp /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_dx9_media_sharing_intel.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_ext.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_ext_intel.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_gl.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_gl_ext.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_icd.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_platform.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_va_api_media_sharing_intel.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/cl_version.h /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/opencl/include/CL/opencl.h # rocm-opencl-sdk /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}/.info/version-ocl-sdk # system %exclude /src %post /sbin/ldconfig %postun