Skip to content

Fix OpenMP and link tools against hip::host#1352

Merged
marbre merged 1 commit into
developfrom
users/marbre/rocsparse-openmp
Aug 27, 2025
Merged

Fix OpenMP and link tools against hip::host#1352
marbre merged 1 commit into
developfrom
users/marbre/rocsparse-openmp

Conversation

@marbre
Copy link
Copy Markdown
Member

@marbre marbre commented Aug 26, 2025

Building rocSPARSE was broken with commit 1171304 as it is links amd-llvm's OpenMP which is not available on Windows instead of libomp. Furthermore, re-adds to link hip::host.

Fixes #1173.

Building rocSPARSE was broken with commit 1171304 as it is links
amd-llvm's OpenMP which is not available on Windows instead of libomp.
Furthermore, re-adds to link `hip::host`.

Fixes #1173.

Co-authored-by: David Dixon <david.dixon@amd.com>
set_target_properties( ${lib_target_} PROPERTIES
INSTALL_RPATH "$ORIGIN/../llvm/${openmp_LIB_DIR}"
)
if(NOT WIN32)
Copy link
Copy Markdown
Contributor

@jsandham jsandham Aug 27, 2025

Choose a reason for hiding this comment

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

The if(NOT WIN32) and if(WIN32) changes should probably be propagated to rocblas etc as they do the same thing I think. Doesn't have to be done here, just mentioning it so other reviewers might see.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

rocBLAS will switch to next-cmake rather sooner than later which re-implements the current build logic. I am confident they have taken care and we didn't had similar build issues even with the old config so far.

if (TARGET OpenMP::OpenMP_CXX)
set(ROCSPARSE_CLIENT_LIBS "OpenMP::OpenMP_CXX")
if(OPENMP_FOUND)
set(ROCSPARSE_CLIENT_LIBS "libomp")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we know why this doesn't seem to be required in rocblas?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I haven't looked closely to the logic applied in rocBLAS and rather compared with the changes that broke the Windows build. Before that problematic patch, Windows was linking to libomp if OpenMP was found which I re-introduced here.

@marbre
Copy link
Copy Markdown
Member Author

marbre commented Aug 27, 2025

Previous Windows CI failure seems unrelated.

@marbre marbre merged commit 1c108c0 into develop Aug 27, 2025
14 of 15 checks passed
@marbre marbre deleted the users/marbre/rocsparse-openmp branch August 27, 2025 21:03
assistant-librarian Bot pushed a commit to ROCm/rocSPARSE that referenced this pull request Aug 27, 2025
Fix OpenMP and link tools against hip::host

Building rocSPARSE was broken with commit 1171304 as it is links
amd-llvm's OpenMP which is not available on Windows instead of libomp.
Furthermore, re-adds to link `hip::host`.

Fixes #1173.

Co-authored-by: David Dixon <david.dixon@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rocSPARSE] Linking tools on Windows fail due to missing symbols

3 participants