Skip to content

Enable TheRock to build rocALUTION#5888

Open
jsandham wants to merge 5 commits into
ROCm:mainfrom
jsandham:add-rocalution-build
Open

Enable TheRock to build rocALUTION#5888
jsandham wants to merge 5 commits into
ROCm:mainfrom
jsandham:add-rocalution-build

Conversation

@jsandham

@jsandham jsandham commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

Recently we added rocALUTION to rocm-libraries. This PR adds rocALUTION to the TheRock build system. This PR separates the build portion of #5884 into its own PR.

Technical Details

rocALUTION is a sparse linear algebra library targeting iterative solution of large sparse linear systems on CPUs and AMD GPUs. It provides a unified C++/HIP API across Host, OpenMP, HIP, and MPI backends, with a comprehensive set of iterative solvers (CG, GMRES, BiCGStab, AMG variants, etc.) and preconditioners (ILU, IC, SPAI, FSAI, Chebyshev polynomial, etc.).

This PR does the following:

  • It registers rocALUTION as a new artifact in the math-libs build stage (BUILD_TOPOLOGY.toml)
  • Adds the CMake subproject configuration with its build flags and dependencies on rocBLAS, rocSPARSE, rocPRIM, and rocRAND (math-libs/CMakeLists.txt), and defines how the build output is packaged into library, dev, debug, and test components (math-libs/artifact-rocalution.toml).
  • A --rocalution flag is also added to the artifact install script so users can download rocALUTION artifacts from a CI run.
  • Finally, rocALUTION is documented in the Windows support and artifact installation guides. Test integration will follow in a separate PR. See Add rocALUTION to TheRock #5884

Note: This PR requires that the rocm-libraries commit id used by TheRock CI get bumped to a commit that includes the addition of rocalution.

ROCM-25191

@jsandham jsandham marked this pull request as ready for review June 22, 2026 16:44

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass review just looking through the CI logs: https://github.com/ROCm/TheRock/actions/runs/27967403102?pr=5888

  • some build failures to solve
  • overall build time so far is reasonable (~68 seconds until build failure, we have some components that take 30+ minutes to build and have historically had some that take 5+ hours, so we're on the lookout for anything that will introduce new bottlenecks or strain CI resources)

Comment thread math-libs/CMakeLists.txt
Comment on lines +433 to +436
BUILD_DEPS
rocm-cmake
rocPRIM
therock-googletest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are build errors on Windows:


[rocALUTION] [67/93] Building CXX object src/CMakeFiles/rocalution.dir/solvers/preconditioners/preconditioner_blockjacobi.cpp.obj
[rocALUTION] [68/93] Building CXX object src/CMakeFiles/rocalution.dir/base/backend_manager.cpp.obj
[rocALUTION] FAILED: src/CMakeFiles/rocalution.dir/base/backend_manager.cpp.obj 
[rocALUTION] ccache B:\build\core\clr\dist\lib\llvm\bin\clang++.exe -DSUPPORT_COMPLEX -Drocalution_EXPORTS -IB:/build/math-libs/rocALUTION/build/include -DWIN32 -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX -fms-extensions -fms-compatibility -D_ENABLE_EXTENDED_ALIGNED_STORAGE  -resource-dir B:/build/core/clr/dist/lib/llvm/lib/clang/23 -Wno-documentation-unknown-command -Wno-documentation-pedantic -Wno-unused-command-line-argument -Wno-explicit-specialization-storage-class -Wno-ignored-attributes -Wno-unknown-attributes -Wno-duplicate-decl-specifier --hip-path=B:/build/core/clr/dist --hip-device-lib-path=B:/build/core/clr/dist/lib/llvm/amdgcn/bitcode -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -std=c++17 -fvisibility-inlines-hidden -O3 -fopenmp=libomp -MD -MT src/CMakeFiles/rocalution.dir/base/backend_manager.cpp.obj -MF src\CMakeFiles\rocalution.dir\base\backend_manager.cpp.obj.d -o src/CMakeFiles/rocalution.dir/base/backend_manager.cpp.obj -c C:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/src/base/backend_manager.cpp
[rocALUTION] C:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/src/base/backend_manager.cpp:161:56: error: use of undeclared identifier 'omp_get_max_active_levels'
[rocALUTION]   161 |         _get_backend_descriptor()->OpenMP_def_nested = omp_get_max_active_levels();
[rocALUTION]       |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
[rocALUTION] C:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/src/base/backend_manager.cpp:168:9: error: use of undeclared identifier 'omp_set_max_active_levels'
[rocALUTION]   168 |         omp_set_max_active_levels(0);
[rocALUTION]       |         ^~~~~~~~~~~~~~~~~~~~~~~~~
[rocALUTION] C:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/src/base/backend_manager.cpp:240:9: error: use of undeclared identifier 'omp_set_max_active_levels'
[rocALUTION]   240 |         omp_set_max_active_levels(_get_backend_descriptor()->OpenMP_def_nested);
[rocALUTION]       |         ^~~~~~~~~~~~~~~~~~~~~~~~~

[rocALUTION] 3 errors generated.

[rocALUTION] [69/93] Building CXX object clients/tests/CMakeFiles/rocalution-test.dir/test_preconditioner.cpp.obj
[rocALUTION] FAILED: clients/tests/CMakeFiles/rocalution-test.dir/test_preconditioner.cpp.obj 
[rocALUTION] ccache B:\build\core\clr\dist\lib\llvm\bin\clang++.exe -DGOOGLE_TEST -IC:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/clients/tests/../include -IB:/build/math-libs/rocALUTION/build/include -DWIN32 -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX -fms-extensions -fms-compatibility -D_ENABLE_EXTENDED_ALIGNED_STORAGE  -resource-dir B:/build/core/clr/dist/lib/llvm/lib/clang/23 -Wno-documentation-unknown-command -Wno-documentation-pedantic -Wno-unused-command-line-argument -Wno-explicit-specialization-storage-class -Wno-ignored-attributes -Wno-unknown-attributes -Wno-duplicate-decl-specifier --hip-path=B:/build/core/clr/dist --hip-device-lib-path=B:/build/core/clr/dist/lib/llvm/amdgcn/bitcode -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -std=c++14 -MD -MT clients/tests/CMakeFiles/rocalution-test.dir/test_preconditioner.cpp.obj -MF clients\tests\CMakeFiles\rocalution-test.dir\test_preconditioner.cpp.obj.d -o clients/tests/CMakeFiles/rocalution-test.dir/test_preconditioner.cpp.obj -c C:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/clients/tests/test_preconditioner.cpp
[rocALUTION] In file included from C:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/clients/tests/test_preconditioner.cpp:24:
[rocALUTION] C:/home/runner/_work/TheRock/TheRock/rocm-libraries/projects/rocalution/clients/tests/../include\testing_preconditioner.hpp:28:10: fatal error: 'gtest/gtest.h' file not found

[rocALUTION]    28 | #include <gtest/gtest.h>

[rocALUTION]       |          ^~~~~~~~~~~~~~~

[rocALUTION] 1 error generated.

This therock-googletest build dep seems like it should be correct. OpenMP may be trickier, I'd need to check where that is expected to come from...

We might want to start with rocALUTION only enabled on Linux to start bringup one platform at a time.

Comment thread math-libs/CMakeLists.txt
BUILD_DEPS
rocm-cmake
rocPRIM
therock-googletest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this also fails on Linux:


[rocALUTION] [116/116] Linking CXX executable clients/staging/rocalution-test
[rocALUTION] FAILED: clients/staging/rocalution-test 
[rocALUTION] : && /__w/TheRock/TheRock/build/core/clr/dist/lib/llvm/bin/clang++ -resource-dir /__w/TheRock/TheRock/build/core/clr/dist/lib/llvm/lib/clang/23 -Wno-documentation-unknown-command -Wno-documentation-pedantic -Wno-unused-command-line-argument -Wno-explicit-specialization-storage-class --hip-path=/__w/TheRock/TheRock/build/core/clr/dist --hip-device-lib-path=/__w/TheRock/TheRock/build/core/clr/dist/lib/llvm/amdgcn/bitcode -O3 -DNDEBUG -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/zlib/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/zlib/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/zstd/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/zstd/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/numactl/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/numactl/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/bzip2/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/bzip2/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/liblzma/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/liblzma/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/elfutils/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/elfutils/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/libdrm/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/libdrm/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/compiler/amd-llvm/stage/lib/llvm/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/compiler/amd-llvm/stage/lib/llvm/lib -L/__w/TheRock/TheRock/build/compiler/amd-comgr/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/compiler/amd-comgr/stage/lib -L/__w/TheRock/TheRock/build/core/rocm-kpack/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/core/rocm-kpack/stage/lib -L/__w/TheRock/TheRock/build/base/rocprofiler-register/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/base/rocprofiler-register/stage/lib -L/__w/TheRock/TheRock/build/core/ROCR-Runtime/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/core/ROCR-Runtime/stage/lib -L/__w/TheRock/TheRock/build/core/clr/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/core/clr/stage/lib -L/__w/TheRock/TheRock/build/third-party/host-blas/host-blas/stage/lib/host-math/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/host-blas/host-blas/stage/lib/host-math/lib -L/__w/TheRock/TheRock/build/profiler/roctracer/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/profiler/roctracer/stage/lib -L/__w/TheRock/TheRock/build/profiler/aqlprofile/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/profiler/aqlprofile/stage/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/sqlite3/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/sqlite3/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/profiler/rocprofiler-sdk/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/profiler/rocprofiler-sdk/stage/lib -L/__w/TheRock/TheRock/build/profiler/rocprofiler-sdk/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/profiler/rocprofiler-sdk/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/libmnl/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/libmnl/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/third-party/sysdeps/linux/libnl/build/stage/lib/rocm_sysdeps/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/sysdeps/linux/libnl/build/stage/lib/rocm_sysdeps/lib -L/__w/TheRock/TheRock/build/base/rocm_smi_lib/stage/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/base/rocm_smi_lib/stage/lib -L/__w/TheRock/TheRock/build/third-party/host-blas/host-blas64/stage/lib/host-math/lib -Wl,-rpath-link,/__w/TheRock/TheRock/build/third-party/host-blas/host-blas64/stage/lib/host-math/lib clients/tests/CMakeFiles/rocalution-test.dir/rocalution_host_gtest_main.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_qr.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_lu.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_inversion.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_backend.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_bicgstab.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_bicgstabl.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_cg.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_cr.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_fcg.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_fgmres.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_gmres.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_idr.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_qmrcgstab.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_pairwise_amg.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_ruge_stueben_amg.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_saamg.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_uaamg.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_preconditioner.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_itersolver.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_chebyshev.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_mixed_precision.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_local_matrix.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_local_matrix_multicoloring.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_local_matrix_itsolve.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_local_matrix_solve.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_local_stencil.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/test_local_vector.cpp.o clients/tests/CMakeFiles/rocalution-test.dir/__/include/random.cpp.o -o clients/staging/rocalution-test  -Wl,-rpath,"\$ORIGIN/../lib/rocm_sysdeps/lib:\$ORIGIN/../lib/llvm/lib:\$ORIGIN/../lib:\$ORIGIN/../lib/host-math/lib"  src/librocalution.so.1.0  -lpthread  -Wl,-rpath-link,/__w/TheRock/TheRock/build/math-libs/rocALUTION/build/src:/__w/TheRock/TheRock/build/math-libs/BLAS/rocSPARSE/dist/lib:/__w/TheRock/TheRock/build/math-libs/BLAS/rocBLAS/dist/lib:/__w/TheRock/TheRock/build/math-libs/rocRAND/dist/lib:/__w/TheRock/TheRock/build/core/clr/dist/lib && :
[rocALUTION] ld.lld: error: undefined symbol: testing::InitGoogleTest(int*, char**)
[rocALUTION] >>> referenced by rocalution_host_gtest_main.cpp
[rocALUTION] >>>               clients/tests/CMakeFiles/rocalution-test.dir/rocalution_host_gtest_main.cpp.o:(main)
[rocALUTION] 
[rocALUTION] ld.lld: error: undefined symbol: testing::FLAGS_gtest_death_test_style[abi:cxx11]
[rocALUTION] >>> referenced by rocalution_host_gtest_main.cpp
[rocALUTION] >>>               clients/tests/CMakeFiles/rocalution-test.dir/rocalution_host_gtest_main.cpp.o:(main)
[rocALUTION] 
[rocALUTION] ld.lld: error: undefined symbol: testing::UnitTest::GetInstance()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

2 participants