From 18e78299576ae410465d8a39d972616ae6078349 Mon Sep 17 00:00:00 2001 From: Stanley Tsang Date: Mon, 30 Jan 2023 11:17:49 -0700 Subject: [PATCH] Fix toolchain-windows.cmake for HIP SDK (#227) (#228) * HIP SDK spaces support, plus previous benchmark fixes * Better fix for Windows * Update cmake_path function for rmake.py * Update copyright * Cleanup toolchain-windows.cmake, compatibility with HIP SDK * Take python3 by default --- toolchain-windows.cmake | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/toolchain-windows.cmake b/toolchain-windows.cmake index 6afe6741..b14405ca 100644 --- a/toolchain-windows.cmake +++ b/toolchain-windows.cmake @@ -14,30 +14,21 @@ else() set(rocm_bin "C:/hip/bin") endif() -#set(CMAKE_CXX_COMPILER "${rocm_bin}/hipcc.bat") -#set(CMAKE_C_COMPILER "${rocm_bin}/hipcc.bat") set(CMAKE_CXX_COMPILER "${rocm_bin}/clang++.exe") set(CMAKE_C_COMPILER "${rocm_bin}/clang.exe") -#set(CMAKE_CXX_LINKER "${rocm_bin}/hipcc.bat" ) - -# TODO remove, just to speed up slow cmake -set(CMAKE_C_COMPILER_WORKS 1) -set(CMAKE_CXX_COMPILER_WORKS 1) -# +if (NOT python) + set(python "python3") # take default for windows +endif() -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -IC:/hip/include -IC:/hip/lib/clang/12.0.0 -DWIN32 -D_CRT_SECURE_NO_WARNINGS") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${HIP_DIR}/include -DWIN32 -D_CRT_SECURE_NO_WARNINGS") +# our usage flags +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWIN32 -D_CRT_SECURE_NO_WARNINGS") # flags for clang direct use -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fms-extensions -fms-compatibility") # -Wno-ignored-attributes to avoid warning: __declspec attribute 'dllexport' is not supported [-Wignored-attributes] which is used by msvc compiler set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fms-extensions -fms-compatibility -Wno-ignored-attributes") -# flags for clang direct use with hip -# -x hip causes linker error -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x hip -IC:/hip/include/hip -D__HIP_PLATFORM_AMD__ -D__HIP_ROCclr__ -DHIP_CLANG_HCC_COMPAT_MODE=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${HIP_DIR}/include/hip -D__HIP_PLATFORM_AMD__ -D__HIP_ROCclr__ -DHIP_CLANG_HCC_COMPAT_MODE=1") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__HIP_PLATFORM_AMD__ -D__HIP_ROCclr__ -DHIP_CLANG_HCC_COMPAT_MODE=1") if (DEFINED ENV{VCPKG_PATH}) file(TO_CMAKE_PATH "$ENV{VCPKG_PATH}" VCPKG_PATH) @@ -45,8 +36,3 @@ else() set(VCPKG_PATH "C:/github/vcpkg") endif() include("${VCPKG_PATH}/scripts/buildsystems/vcpkg.cmake") -# set(GTEST_DIR "C:/rocm/Utils/GTestMSVC") -# set(GTEST_INCLUDE_DIR "${GTEST_DIR}/include") -# set(GTEST_LIBRARY "${GTEST_DIR}/lib/Release/gtest.lib") -# set(GTEST_MAIN_LIBRARY "${GTEST_DIR}/lib/Release/gtest_main.lib") -# set(GTEST_LIBRARIES "${GTEST_DIR}/lib/Release/gtest.lib;${GTEST_DIR}/lib/Release/gtest_main.lib")