mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-16 10:59:55 +00:00
Build CK on Windows (#3458)
* CMakeLists.txt hack for Windows.
* Add Windows build instructions.
* Fix type issue with variadic min function.
* Use std::common_type to fix the variadic min/max functions.
* Enable CPU guard compilation on Windows.
* Suppress warnings related to std::getenv on Windows platform.
* Git ignore the output directory on Windows platform.
* Powershell script for running tests and generating reports.
* Improve test logging.
* Disable non-conv tests.
* Fix Debug build on Windows.
* More debug build changes.
* Update Windows build instructions.
* Enable all tests.
* Test fixes.
* Suppress not found linker options warning.
* Update unsigned long literals and format specifiers to work correctly in Windows
* Fix conv 3D bwd weight bilinear tests on Windows.
* Revert changes on .gitignore.
* Clean-up CMake project file for Windows builds.
* clang-format
* Fix definition of CMAKE_PREFIX_PATH on both Linux and Windows platforms.
* Fix building examples on Windows.
* Update Readme.
* Remove the suppression of the deprecated warnings.
* Remove Windows specific min/max implementations from CK Tile math core.
* Remove unnecessary no-op on Windows.
---------
Co-authored-by: User <user@example.com>
Co-authored-by: Ville Pietilä <none>
Co-authored-by: John Afaganis <john.afaganis@amd.com>
Co-authored-by: Ville Pietilä <>
[ROCm/composable_kernel commit: 1fc5a3f3ac]
This commit is contained in:
@@ -6,6 +6,35 @@ include_directories(BEFORE
|
||||
${PROJECT_SOURCE_DIR}/library/include
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
# On Windows, HIP uses -nostdlib which prevents C runtime linking
|
||||
# We need legacy_stdio_definitions.lib to provide vfprintf and other legacy C functions
|
||||
# This is mainly needed for the getopt library.
|
||||
set(LEGACY_STDIO_SEARCH_PATHS)
|
||||
|
||||
# Try to use Visual C++ Tools environment variable (if build executes from Visual Studio Developer Command Prompt)
|
||||
if(DEFINED ENV{VCToolsInstallDir})
|
||||
list(APPEND LEGACY_STDIO_SEARCH_PATHS "$ENV{VCToolsInstallDir}/lib/x64")
|
||||
endif()
|
||||
|
||||
# Fallback: Search common Visual Studio installation locations
|
||||
file(GLOB MSVC_LIB_PATHS "C:/Program Files/Microsoft Visual Studio/*/*/VC/Tools/MSVC/*/lib/x64")
|
||||
list(APPEND LEGACY_STDIO_SEARCH_PATHS ${MSVC_LIB_PATHS})
|
||||
|
||||
# Use find_library to locate the library
|
||||
find_library(LEGACY_STDIO_LIB legacy_stdio_definitions
|
||||
PATHS ${LEGACY_STDIO_SEARCH_PATHS}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(LEGACY_STDIO_LIB)
|
||||
message(STATUS "Found legacy_stdio_definitions.lib: ${LEGACY_STDIO_LIB}")
|
||||
add_link_options("SHELL:-Xlinker \"${LEGACY_STDIO_LIB}\"")
|
||||
else()
|
||||
message(WARNING "Could not find legacy_stdio_definitions.lib - examples may fail to link.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_custom_target(examples)
|
||||
|
||||
|
||||
@@ -216,6 +245,7 @@ function(add_example_executable_no_testing EXAMPLE_NAME FILE_NAME)
|
||||
set_source_files_properties(${FILE_NAME} PROPERTIES LANGUAGE HIP)
|
||||
add_executable(${EXAMPLE_NAME} ${FILE_NAME})
|
||||
target_link_libraries(${EXAMPLE_NAME} PRIVATE utility)
|
||||
target_link_libraries(${EXAMPLE_NAME} PRIVATE getopt::getopt)
|
||||
add_dependencies(examples ${EXAMPLE_NAME})
|
||||
set_property(TARGET ${EXAMPLE_NAME} PROPERTY HIP_ARCHITECTURES ${EX_TARGETS})
|
||||
rocm_install(TARGETS ${EXAMPLE_NAME} COMPONENT examples)
|
||||
|
||||
Reference in New Issue
Block a user