# Part of ROCM Stack, see rocm-llvm for build order # rocm-cmake # rocm-llvm # rocm-runtime # rocm-core # rocminfo # rocm-amd-opencl #Build Time of this package ~ 0 minutes 25 seconds %global rocm_release 6.4 %global rocm_patch 3 %global rocm_version %{rocm_release}.%{rocm_patch} %global rocmcore_name rocm%{rocm_release}-core %define libname %mklibname %{rocmcore_name} %define develname %mklibname %{rocmcore_name} -d %bcond_with system_tools Name: rocm-core Version: %{rocm_version} Release: %mkrel 1 Summary: AMD ROCm version files Group: Development/Other Url: https://github.com/ROCm/rocm-core License: MIT Source0: %{url}/archive/rocm-%{rocm_version}.tar.gz#/rocm-core-%{rocm_version}.tar.gz #Only the following architectures are useful for ROCm packages: ExclusiveArch: x86_64 aarch64 BuildRequires: cmake %if %{with system_tools} BuildRequires: gcc-c++ %else #squidf version #BuildRequires: rocm%{rocm_release}-llvm #BuildRequires: rocm%{rocm_release}-llvm-static BuildRequires: rocm%{rocm_release}-lld BuildRequires: rocm%{rocm_release}-llvm-devel BuildRequires: rocm%{rocm_release}-clang-devel %endif BuildRequires: rocm%{rocm_release}-macros %description AMD ROCm version files required by PyTorch. %package -n %{libname} Summary: AMD ROCm version files Provides: rocm-core = %{version}-%{release} %description -n %{libname} AMD ROCm version files required by PyTorch. %package -n %{develname} Summary: Libraries and headers for %{name} Requires: %{libname} = %{version}-%{release} Provides: rocm-core-devel = %{version}-%{release} %description -n %{develname} %{summary} %prep %autosetup -p1 -n rocm-core-rocm-%{version} %build %cmake -DROCM_VERSION=%{rocm_version} \ -DCMAKE_INSTALL_LIBDIR=%{rocm_prefix}/lib \ -DCMAKE_INSTALL_INCLUDEDIR=%{rocm_prefix}/include \ %if %{without system_tools} -DLLVM_DIR="%{rocmllvm_cmakedir}" \ -DCMAKE_AR=%rocmllvm_bindir/llvm-ar \ -DCMAKE_C_COMPILER=%rocmllvm_bindir/clang \ -DCMAKE_CXX_COMPILER=%rocmllvm_bindir/clang++ \ -DCMAKE_LINKER=%rocmllvm_bindir/ld.lld \ -DCMAKE_RANLIB=%rocmllvm_bindir/llvm-ranlib \ -DCMAKE_PREFIX_PATH=%{rocmllvm_cmakedir}/.. %endif %if %{without system_tools} CXXFLAGS="$CXXFLAGS -I%{rocm_prefix}/lib" %endif %cmake_build %install %cmake_install rm -rf %{buildroot}/%{_prefix}/.info rm -rf %{buildroot}/%{rocm_prefix}/lib/rocmmod rm -rf %{buildroot}/%{_docdir}/*/LICENSE.txt rm -rf %{buildroot}/%{_libexecdir}/%{name} mv %{buildroot}/%{rocm_prefix}/include/rocm-core/*.h %{buildroot}/%{rocm_prefix}/include/ rm -rf %{buildroot}/%{rocm_prefix}/include/rocm-core find %{buildroot} -type f -name 'runpath_to_rpath.py' -exec rm {} \; %files -n %{libname} %license copyright %{rocm_prefix}/lib/librocm-core.so.* %files -n %{develname} %dir %{rocm_prefix}/lib/cmake/rocm-core %{rocm_prefix}/include/*.h %{rocm_prefix}/lib/librocm-core.so %{rocm_prefix}/lib/cmake/rocm-core/*.cmake