From 5b4fbe08d24c90797033ca5112686ecc36027cfd Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Fri, 12 Feb 2021 15:36:13 -0500 Subject: [PATCH] Change CMakeLists.txt to include the libras The CMakeLists.txt is changed to add instructions to build raslib. Change-Id: I0779046f28cbc7af292c83f3ae3ed7bcda5c57eb --- CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 31 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9febff2b1..e69e7c479d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,25 @@ set(RSMI_INC_DIR ${ROCM_DIR}/rocm_smi/include) # which requires the gRPC option(BUILD_STANDALONE "Build targets for rdci and rdcd" ON) +# When cmake -DBUILD_RASLIB=off, it will not build the raslib +# which requires the ROCT-Thunk-Interface. +option(BUILD_RASLIB "Build targets for raslib" OFF) + +if( NOT EXISTS "${CMAKE_SOURCE_DIR}/raslib/.git" AND BUILD_RASLIB) + message( FATAL_ERROR "The git submodule raslib is not available. Please run + git submodule update --init --recursive + If you do not want to build raslib, use cmake -DBUILD_RASLIB=off" + ) +endif() + +if (BUILD_RASLIB AND NOT DEFINED HSA_DIR) + message( FATAL_ERROR "Please specify libhsakmt directory which is required by raslib + cmake -DHSA_DIR= + If you do not want to build raslib, use cmake -DBUILD_RASLIB=off" + ) +endif() + + set(RSMI_LIB_DIR ${ROCM_DIR}/rocm_smi/lib) if (NOT DEFINED GRPC_ROOT) @@ -88,6 +107,7 @@ project(${RDC}) set(RDC_SRC_ROOT "${PROJECT_SOURCE_DIR}") message("Build Configuration:") + if(BUILD_STANDALONE) message("-----------GRPC ROOT: " ${GRPC_ROOT}) endif() @@ -196,6 +216,16 @@ if(BUILD_STANDALONE) add_subdirectory("rdci") endif() +# Raslib +if(BUILD_RASLIB) + message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") + message(" Build raslib") + message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") + + set(RDC_BUILD_DIR ${PROJECT_BINARY_DIR}/rdc_libs) + add_subdirectory("raslib") +endif() + # Folders for both standalone and embedded add_subdirectory("rdc_libs") add_subdirectory("example") diff --git a/README.md b/README.md index 16249b7319..0b68dbce6e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ For complete list of features and how to start using RDC from pre-built packages Doxygen (1.8.11) ## required to build the latest documentation Latex (pdfTeX 3.14159265-2.6-1.40.16) ## required to build the latest documentation gRPC and protoc ## required for communication + libcap-dev ## required to manage the privileges. AMD ROCm platform (https://github.com/RadeonOpenCompute/ROCm) * It is recommended to install the complete AMD ROCm platform.