diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt index a8b5fe54fb..efc441841c 100644 --- a/runtime/hsa-runtime/CMakeLists.txt +++ b/runtime/hsa-runtime/CMakeLists.txt @@ -40,7 +40,7 @@ ## ################################################################################ -cmake_minimum_required ( VERSION 3.6.3 ) +cmake_minimum_required ( VERSION 3.7 ) ## Clear target dependency data. ## Needed to allow UI transitions between static and dynamic builds. @@ -136,7 +136,7 @@ if ( CMAKE_COMPILER_IS_GNUCXX ) endif () if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang") set ( HSA_CXX_FLAGS ${HSA_CXX_FLAGS} -Wno-error=self-assign) - if( CLANG_VERSION_MAJOR -ge 13) + if( ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 13) set ( HSA_CXX_FLAGS ${HSA_CXX_FLAGS} -Wno-error=unused-but-set-variable) endif() endif() diff --git a/runtime/hsa-runtime/README.md b/runtime/hsa-runtime/README.md index 88a57073c6..2b29eea755 100644 --- a/runtime/hsa-runtime/README.md +++ b/runtime/hsa-runtime/README.md @@ -20,7 +20,7 @@ utils - Utilities required to build the core runtime. #### Build Environment CMake build framework is used to build the ROC runtime. The minimum version is -3.6.3. +3.7. Obtain cmake infrastructure: http://www.cmake.org/download/ @@ -32,7 +32,6 @@ The following support packages are required to successfully build the runtime: * libelf-dev * g++ -* libc6-dev-i386 (for libhsakmt 32bit) #### Building the Runtime diff --git a/runtime/hsa-runtime/image/blit_src/CMakeLists.txt b/runtime/hsa-runtime/image/blit_src/CMakeLists.txt index 3a639662f3..068995282a 100644 --- a/runtime/hsa-runtime/image/blit_src/CMakeLists.txt +++ b/runtime/hsa-runtime/image/blit_src/CMakeLists.txt @@ -40,7 +40,7 @@ ## ################################################################################ -cmake_minimum_required ( VERSION 3.5.0 ) +cmake_minimum_required ( VERSION 3.7 ) # Flag to abort before executing after default initialization of cache variables set (QUIT 0) @@ -49,15 +49,20 @@ set (QUIT 0) find_package(Clang REQUIRED HINTS ${CMAKE_INSTALL_PREFIX}/llvm ${CMAKE_PREFIX_PATH}/llvm PATHS /opt/rocm/llvm ) # Device libs doesn't support find_package yet. -# FIXME: HINTS should not use CMAKE_INSTALL_PREFIX +set(PREFIX_HINTS "") +foreach(hint "/amdgcn/bitcode" "/lib/bitcode" "/lib/x86_64/bitcode") + foreach(path ${CMAKE_PREFIX_PATH}) + string(APPEND path ${hint}) + list(APPEND PREFIX_HINTS ${path}) + endforeach(path) +endforeach(hint) + get_include_path(BITCODE_DIR "Bitcode library path" RESULT FOUND NAMES "opencl.bc" "opencl.amdgcn.bc" HINTS "${CMAKE_INSTALL_PREFIX}/amdgcn/bitcode" "${CMAKE_INSTALL_PREFIX}/lib/bitcode" "${CMAKE_INSTALL_PREFIX}/lib/x86_64/bitcode" - "${CMAKE_PREFIX_PATH}/amdgcn/bitcode" - "${CMAKE_PREFIX_PATH}/lib/bitcode" - "${CMAKE_PREFIX_PATH}/lib/x86_64/bitcode" + "${PREFIX_HINTS}" PATHS "/opt/rocm/amdgcn/bitcode" "/opt/rocm/lib/bitcode"