Skip to content

[rocsparse] Fix windows compilation errors#1373

Closed
jsandham wants to merge 1 commit into
developfrom
users/jsandham/windows_openmp_fix
Closed

[rocsparse] Fix windows compilation errors#1373
jsandham wants to merge 1 commit into
developfrom
users/jsandham/windows_openmp_fix

Conversation

@jsandham
Copy link
Copy Markdown
Contributor

Motivation

Fix windows compilation errors introduced in #1114

Copilot AI review requested due to automatic review settings August 27, 2025 17:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes Windows compilation errors that were introduced in a previous pull request by addressing library linking issues in the ROCsparse build system.

  • Adds hip::host library linking for ROCsparse tools to resolve Windows compilation errors
  • Modifies OpenMP library linking to use libomp on Windows instead of OpenMP::OpenMP_CXX

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
projects/rocsparse/clients/tools/CMakeLists.txt Adds hip::host library linking for tools
projects/rocsparse/clients/CMakeLists.txt Implements Windows-specific OpenMP library handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

if(NOT WIN32)
set(ROCSPARSE_CLIENT_LIBS "OpenMP::OpenMP_CXX")
else()
set(ROCSPARSE_CLIENT_LIBS libomp)
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

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

Using bare library name 'libomp' without target or path specification may cause linking failures. Consider using 'find_library(LIBOMP_LIB NAMES libomp)' and then '${LIBOMP_LIB}' or verify that this library is available in the default search paths on Windows.

Suggested change
set(ROCSPARSE_CLIENT_LIBS libomp)
find_library(LIBOMP_LIB NAMES libomp)
set(ROCSPARSE_CLIENT_LIBS ${LIBOMP_LIB})

Copilot uses AI. Check for mistakes.
@jsandham jsandham changed the title Fix windows compilation errors [rocsparse] Fix windows compilation errors Aug 27, 2025
# Internal common header
target_include_directories(${app} PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>)

target_link_libraries(${app} PRIVATE hip::host)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

target_link_libraries(${app} PRIVATE --rtlib=compiler-rt) maybe also works

@jsandham jsandham mentioned this pull request Aug 27, 2025
@jsandham jsandham closed this Aug 27, 2025
@jsandham jsandham deleted the users/jsandham/windows_openmp_fix branch December 3, 2025 14:44
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.

3 participants