Verify cmake update
MODIFY
.gitlab-ci.yml
.gitlab-ci.yml
@@ -17,7 +17,7 @@ variables:
before_script:
- $SUDO_CMD apt-get update -qq
- - $SUDO_CMD apt-get install -y -qq libnuma-dev libunwind-dev git wget tar xz-utils bzip2 build-essential pkg-config ca-certificates
+ - $SUDO_CMD apt-get install -y -qq libidn11 libnuma-dev libunwind-dev git wget tar xz-utils bzip2 build-essential pkg-config ca-certificates
- hipconfig
# cmake
- mkdir -p $DEPS_DIR/cmake
@@ -37,7 +37,7 @@ build:rocm:
script:
- mkdir build
- cd build
- - CXX=hipcc cmake -DBUILD_TEST=ON ../.
+ - CXX=hipcc cmake -DBUILD_TEST=ON -DCMAKE_CXX_FLAGS="-w" ../.
- make -j $(nproc)
- make package
artifacts:

MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -32,15 +32,21 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "Add paths to linker searc
# Verify that hcc compiler is used on ROCM platform
include(cmake/VerifyCompiler.cmake)
+# Build options
+# Disable -Werror
+option(DISABLE_WERROR "Disable building with Werror" ON)
+option(BUILD_TEST "Build tests" OFF)
+option(DOWNLOAD_ROCPRIM "Download rocPRIM and do not search for rocPRIM package" OFF)
+
# Set CXX flags
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
+if(DISABLE_WERROR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-function")
-
-# Build options
-option(BUILD_TEST "Build tests" OFF)
-option(DOWNLOAD_ROCPRIM "Download rocPRIM and do not search for rocPRIM package" OFF)
+else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-function -Werror")
+endif()
# Get dependencies
include(cmake/Dependencies.cmake)

MODIFY
README.md
README.md
@@ -39,7 +39,8 @@ cd rocThrust; mkdir build; cd build
# Configure rocThrust, setup options for your system.
# Build options:
-# BUILD_TEST - ON by default,
+# DISABLE_WERROR - ON by default, This flag disable the -Werror compiler flag
+# BUILD_TEST - OFF by default,
# DOWNLOAD_ROCPRIM - OFF by default and at ON the rocPRIM will be downloaded to build folder,
#
# ! IMPORTANT !

MODIFY
cmake/Summary.cmake
cmake/Summary.cmake
-# ########################################################################
-# Copyright 2019 Advanced Micro Devices, Inc.
-# ########################################################################
+# MIT License
+#
+# Copyright (c) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
function (print_configuration_summary)
+ message(STATUS "")
message(STATUS "******** Summary ********")
message(STATUS "General:")
message(STATUS " System : ${CMAKE_SYSTEM_NAME}")
@@ -13,6 +32,11 @@ function(print_configuration_summary)
message(STATUS " CXX flags : ${CMAKE_CXX_FLAGS_STRIP}")
message(STATUS " Build type : ${CMAKE_BUILD_TYPE}")
message(STATUS " Install prefix : ${CMAKE_INSTALL_PREFIX}")
+if(HIP_COMPILER STREQUAL "hcc" OR HIP_COMPILER STREQUAL "clang")
+ message(STATUS " Device targets : ${AMDGPU_TARGETS}")
+endif()
message(STATUS "")
+ message(STATUS " DISABLE_WERROR : ${DISABLE_WERROR}")
+ message(STATUS " DOWNLOAD_ROCPRIM : ${DOWNLOAD_ROCPRIM}")
message(STATUS " BUILD_TEST : ${BUILD_TEST}")
endfunction()

MODIFY
cmake/VerifyCompiler.cmake
cmake/VerifyCompiler.cmake
-# ########################################################################
-# Copyright 2019 Advanced Micro Devices, Inc.
-# ########################################################################
+# MIT License
+#
+# Copyright (c) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
-# Find HIP package
-find_package(HIP REQUIRED)
+list(APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/hip)
+find_package(hip REQUIRED CONFIG PATHS /opt/rocm)
-if(HIP_PLATFORM STREQUAL "hcc")
+if(HIP_COMPILER STREQUAL "nvcc")
+ message(FATAL_ERROR "rocThrust does not support the CUDA backend.")
+elseif(HIP_COMPILER STREQUAL "hcc" OR HIP_COMPILER STREQUAL "clang")
if(NOT (CMAKE_CXX_COMPILER MATCHES ".*/hcc$" OR CMAKE_CXX_COMPILER MATCHES ".*/hipcc$"))
message(FATAL_ERROR "On ROCm platform 'hcc' or 'clang' must be used as C++ compiler.")
- else()
- # Determine if CXX Compiler is hcc, hip-clang or other
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} "--version" OUTPUT_VARIABLE CXX_OUTPUT
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_STRIP_TRAILING_WHITESPACE)
- string(REGEX MATCH "[A-Za-z]* ?clang version" TMP_CXX_VERSION ${CXX_OUTPUT})
- string(REGEX MATCH "[A-Za-z]+" CXX_VERSION_STRING ${TMP_CXX_VERSION})
- if(CXX_VERSION_STRING MATCHES "HCC")
- set(HIP_COMPILER "hcc" CACHE STRING "HIP Compiler")
- elseif(CXX_VERSION_STRING MATCHES "clang")
- set(HIP_COMPILER "clang" CACHE STRING "HIP Compiler")
- else()
- message(FATAL_ERROR "CXX Compiler version ${CXX_VERSION_STRING} unsupported.")
+ elseif(NOT CXX_VERSION_STRING MATCHES "clang")
+ list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hcc)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument")
endif()
- message(STATUS "HIP Compiler: " ${HIP_COMPILER})
- # Workaround until hcc & hip cmake modules fixes symlink logic in their config files.
- # (Thanks to rocBLAS devs for finding workaround for this problem.)
- list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hcc /opt/rocm/hip)
- # Ignore hcc warning: argument unused during compilation: '-isystem /opt/rocm/hip/include'
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument")
if(HIP_COMPILER STREQUAL "hcc")
+ list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hcc)
find_package(hcc REQUIRED CONFIG PATHS /opt/rocm)
- else()
- find_package(hcc QUIET CONFIG PATHS /opt/rocm)
- endif()
- find_package(hip REQUIRED CONFIG PATHS /opt/rocm)
endif()
else()
- message(FATAL_ERROR "HIP_PLATFORM must be 'hcc' (AMD ROCm platform)")
+ message(FATAL_ERROR "HIP_COMPILER must be 'hcc' or 'clang' (AMD ROCm platform)")
endif()

Verify cmake update