Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use fmt from cms externals; set c++std to 20 #2

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions rocm.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### RPM external rocm 6.2.4
## INCLUDE cpp-standard

# AMD repository with RPM packages for RHEL 8 and 9
%define repository repo.radeon.com/rocm/rhel%{rhel}
Expand Down Expand Up @@ -38,10 +39,10 @@ Source19: https://%{repository}/%{repoversion}/main/rocprofiler-plugins-2.0.6020
Source20: https://%{repository}/%{repoversion}/main/amd-smi-lib-24.6.3.60204-139.el%{rhel}.%{_arch}.rpm

# sources for rocprofiler-register
Source21: git+https://github.com/ROCm/rocprofiler-register.git?obj=%{rocprofiler_register_branch}/%{rocprofiler_register_tag}&export=%{rocprofiler_register_pkg}&submodules=1&output=/%{rocprofiler_register_name}.tgz
Source21: git+https://github.com/ROCm/rocprofiler-register.git?obj=%{rocprofiler_register_branch}/%{rocprofiler_register_tag}&export=%{rocprofiler_register_pkg}&submodules=1&output=/%{rocprofiler_register_pkg}.tgz

BuildRequires: gmake cmake
Requires: numactl zstd
Requires: numactl zstd fmt
Requires: python3
AutoReq: no

Expand Down Expand Up @@ -75,10 +76,20 @@ rpm2cpio %{SOURCE19} | cpio -idmv
rpm2cpio %{SOURCE20} | cpio -idmv

# build rocprofiler-register
sed -i -e 's|add_subdirectory(external)|find_package(fmt REQUIRED)\nadd_subdirectory(external)|' src/%{rocprofiler_register_pkg}/CMakeLists.txt
%if %{cms_cxx_standard} != 17
grep -q 'CMAKE_CXX_STANDARD *17' src/%{rocprofiler_register_pkg}/cmake/rocprofiler_register_options.cmake
sed -i -e 's|CMAKE_CXX_STANDARD *17|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' src/%{rocprofiler_register_pkg}/cmake/rocprofiler_register_options.cmake
%endif

mkdir -p build/rocprofiler-register
cd build/rocprofiler-register
cmake ../../src/%{rocprofiler_register_pkg} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%{i}
make all -j %{compiling_processes}
cmake ../../src/%{rocprofiler_register_pkg} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DROCPROFILER_REGISTER_BUILD_FMT=OFF \
-DCMAKE_PREFIX_PATH="${FMT_ROOT}"
make all %{makeprocesses}

%install
rmdir %{i}
Expand Down
3 changes: 2 additions & 1 deletion scram-tools.file/tools/rocm/rocm.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool name="rocm" version="@TOOL_VERSION@" revision="2">
<tool name="rocm" version="@TOOL_VERSION@" revision="3">
<info url="https://docs.amd.com/"/>
<lib name="amdhip64"/>
<lib name="hsa-runtime64"/>
Expand Down Expand Up @@ -28,4 +28,5 @@
<flags SYSTEM_INCLUDE="1"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path" join="1"/>
<runtime name="PATH" value="$ROCM_BASE/bin" type="path"/>
<use name="fmt"/>
</tool>