[rocsparse] Fix windows compilation errors#1373
Conversation
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
| set(ROCSPARSE_CLIENT_LIBS libomp) | |
| find_library(LIBOMP_LIB NAMES libomp) | |
| set(ROCSPARSE_CLIENT_LIBS ${LIBOMP_LIB}) |
| # 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) |
There was a problem hiding this comment.
target_link_libraries(${app} PRIVATE --rtlib=compiler-rt) maybe also works
Motivation
Fix windows compilation errors introduced in #1114