CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
83 lines
3.8 KiB
CMake
83 lines
3.8 KiB
CMake
# Copyright Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
# Project wide compiler configuration.
|
|
|
|
# On win32 only support embedded debug databases project wide.
|
|
# This improves compatibility with ccache and sccache:
|
|
# https://github.com/ccache/ccache/issues/1040
|
|
if(WIN32 AND NOT DEFINED CMAKE_MSVC_DEBUG_INFORMATION_FORMAT)
|
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
|
|
endif()
|
|
|
|
if(WIN32 AND NOT MSVC AND NOT THEROCK_DISABLE_MSVC_CHECK)
|
|
message(FATAL_ERROR
|
|
"Bootstrap compiler was expected to be MSVC (cl.exe). Instead found:\n"
|
|
" Detected CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n"
|
|
" Detected CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}\n"
|
|
"To use MSVC, try one of these:\n"
|
|
" * Use one of the MSVC command prompts like `x64 Native Tools Command Prompt for VS 2022`\n"
|
|
" * In your existing terminal, run `vcvars64.bat` from e.g. `C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build`\n"
|
|
" * Set `-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe`\n"
|
|
"Set THEROCK_DISABLE_MSVC_CHECK to bypass this check.")
|
|
endif()
|
|
|
|
if(MSVC AND MSVC_VERSION LESS_EQUAL 1941 AND NOT THEROCK_DISABLE_MSVC_VERSION_CHECK)
|
|
# See https://github.com/ROCm/TheRock/issues/711. We can probably remove this
|
|
# check after adding openmp to LLVM_ENABLE_RUNTIMES in pre_hook_amd-llvm.cmake.
|
|
#
|
|
# For the compiler version mapping, see
|
|
# https://learn.microsoft.com/en-us/cpp/overview/compiler-versions
|
|
message(FATAL_ERROR
|
|
"Detected MSVC_VERSION is too old and may encounter OpenMP linker errors.\n"
|
|
" Detected MSVC_VERSION: ${MSVC_VERSION}\n"
|
|
" Detected MSVC_TOOLSET_VERSION: ${MSVC_TOOLSET_VERSION}\n"
|
|
" Detected CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}\n"
|
|
"We recommend at least Visual Studio [Build Tools] version 17.12.*, with:\n"
|
|
" * MSVC_VERSION 1942\n"
|
|
" * CMAKE_CXX_COMPILER_VERSION version 19.42.*\n"
|
|
"Set THEROCK_DISABLE_MSVC_VERSION_CHECK to bypass this check.")
|
|
endif()
|
|
|
|
if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
message(FATAL_ERROR
|
|
"Cannot build 32-bit ROCm with MSVC. You must enable the Windows x64 "
|
|
"development tools and rebuild.\n"
|
|
" Detected CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
|
|
endif()
|
|
|
|
# macOS-specific compiler checks
|
|
if(APPLE)
|
|
# Verify we're using AppleClang or Clang on macOS
|
|
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT THEROCK_DISABLE_APPLECLANG_CHECK)
|
|
message(FATAL_ERROR
|
|
"macOS builds require AppleClang or Clang compiler.\n"
|
|
" Detected CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}\n"
|
|
" Detected CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}\n"
|
|
" Detected CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n"
|
|
" Detected CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}\n"
|
|
"Ensure Xcode Command Line Tools are installed:\n"
|
|
" xcode-select --install\n"
|
|
"Set THEROCK_DISABLE_APPLECLANG_CHECK to bypass this check.")
|
|
endif()
|
|
|
|
# Check for minimum macOS deployment target (13.0 Ventura)
|
|
if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "13.0")
|
|
message(WARNING
|
|
"macOS deployment target is ${CMAKE_OSX_DEPLOYMENT_TARGET}.\n"
|
|
"TheRock recommends macOS 13.0 (Ventura) or later for best compatibility.")
|
|
endif()
|
|
|
|
# Default to ARM64 on Apple Silicon
|
|
if(NOT DEFINED CMAKE_OSX_ARCHITECTURES)
|
|
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "macOS architecture")
|
|
endif()
|
|
|
|
message(STATUS "macOS build configuration:")
|
|
message(STATUS " Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
|
|
message(STATUS " Architecture: ${CMAKE_OSX_ARCHITECTURES}")
|
|
if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
message(STATUS " Deployment target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
endif()
|
|
endif()
|