Update cmake minimum version number to 3.10.2
MODIFY
.gitlab-ci.yml
.gitlab-ci.yml
@@ -14,7 +14,7 @@ stages:
variables:
# Tested CMake versions
- CMAKE_MINIMUM_VERSION: 3.5.2
+ CMAKE_MINIMUM_VERSION: 3.10.2
CMAKE_LATEST_VERSION: 3.17.0
# Cluster config
@@ -23,11 +23,11 @@ variables:
# Helper variables
DEPS_DIR: $CI_PROJECT_DIR/deps
BUILD_DIR: $CI_PROJECT_DIR/build
- CMAKE_MINIMUM_URL: "https://cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
- CMAKE_MINIMUM_PATH: "$CI_PROJECT_DIR/deps/cmake-3.5.2"
+ CMAKE_MINIMUM_URL: "https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz"
+ CMAKE_MINIMUM_PATH: "$CI_PROJECT_DIR/deps/cmake-3.10.2"
CMAKE_LATEST_URL: "https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.tar.gz"
CMAKE_LATEST_PATH: "$CI_PROJECT_DIR/deps/cmake-3.17.0"
- BUILD_MINIMUM_DIR: $CI_PROJECT_DIR/build/cmake-3.5.2
+ BUILD_MINIMUM_DIR: $CI_PROJECT_DIR/build/cmake-3.10.2
BUILD_LATEST_DIR: $CI_PROJECT_DIR/build/cmake-3.17.0
PACKAGE_DIR: $CI_PROJECT_DIR/build/package

MODIFY
CMakeLists.txt
CMakeLists.txt
# Copyright 2019-2020 Advanced Micro Devices, Inc.
# ########################################################################
-cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
# Install prefix
if(WIN32)

MODIFY
extra/CMakeLists.txt
extra/CMakeLists.txt
# Copyright 2019 Advanced Micro Devices, Inc.
# ########################################################################
-cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
# This project includes tests that should be run after
# rocThrust is installed from package or using `make install`
@@ -14,6 +14,22 @@ list(APPEND CMAKE_MODULE_PATH
${HIP_PATH}/cmake /opt/rocm/hip/cmake # FindHIP.cmake
)
+# Detect compiler support for target ID
+if( CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} "--help"
+ OUTPUT_VARIABLE CXX_OUTPUT
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE)
+ string(REGEX MATCH ".mcode\-object\-version" TARGET_ID_SUPPORT ${CXX_OUTPUT})
+endif()
+
+# Use target ID syntax if supported for AMDGPU_TARGETS
+if(TARGET_ID_SUPPORT)
+ set(AMDGPU_TARGETS gfx900:xnack-;gfx906:xnack-;gfx908:xnack- CACHE STRING "List of specific machine types for library to target")
+else()
+ set(AMDGPU_TARGETS gfx900;gfx906;gfx908 CACHE STRING "List of specific machine types for library to target")
+endif()
+
# Verify that hcc or hipcc compiler is used on ROCM platform
include(VerifyCompiler)
include(DownloadProject)
@@ -47,9 +63,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
-# AMD targets
-set(AMDGPU_TARGETS gfx803;gfx900;gfx906 CACHE STRING "List of specific machine types for library to target")
-
# Enable testing (ctest)
enable_testing()

Update cmake minimum version number to 3.10.2