From 3fd7df3f4ce8c798e390c99781d8f5642a2ceeaa Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary Date: Thu, 8 Jun 2023 12:50:12 +0100 Subject: [PATCH] SWDEV-404816 - Default HIPCC_BIN_DIR to /opt/rocm/bin on Linux, incase user does not provide with one Change-Id: I3a1dd467df787437ed923349776d3fe994928e0d --- .gitignore | 1 + CMakeLists.txt | 14 +++++++++++--- README.md | 5 ++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 04df03e7ea..f0245c8823 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ debug/ packages/ install/ .vs/ +.vscode/ # Editor temp files *.swp diff --git a/CMakeLists.txt b/CMakeLists.txt index 04ada948dc..4e4ad54074 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -project(clr) cmake_minimum_required(VERSION 3.16.8) +project(clr) ########## # Defaults @@ -41,9 +41,17 @@ endif() # Build steps ############# if(CLR_BUILD_HIP) - if(NOT EXISTS ${HIPCC_BIN_DIR}/hipconfig) - message(FATAL_ERROR "Please pass hipcc/build or hipcc/bin using -DHIPCC_BIN_DIR. Passed HIPCC_BIN_DIR: "${HIPCC_BIN_DIR}) + # Set default HIPCC_BIN_DIR to /opt/rocm/bin + if(NOT DEFINED HIPCC_BIN_DIR AND UNIX) + set(HIPCC_BIN_DIR "/opt/rocm/bin" CACHE STRING "Default hipcc directory on linux.") endif() + message(STATUS "HIPCC Binary Directory: ${HIPCC_BIN_DIR}") + + if(NOT EXISTS ${HIPCC_BIN_DIR}/hipconfig) + message(FATAL_ERROR "Please pass hipcc/build or hipcc/bin using -DHIPCC_BIN_DIR.") + endif() + + message(STATUS "HIP Common Directory: ${HIP_COMMON_DIR}") if(NOT DEFINED HIP_COMMON_DIR) message(FATAL_ERROR "Please pass HIP using -DHIP_COMMON_DIR. HIP_COMMON_DIR is incorrect") endif() diff --git a/README.md b/README.md index 3bf498e87b..48e583cadb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ AMD Common Language Runtime contains source code for AMD's compute languages run ### Prerequisites -Please refer to Prerequisite Actions in [ROCm Installation Guide](https://docs.amd.com/) in release documentation. +Please refer to Quick Start Guide in [ROCm Docs](https://rocm.docs.amd.com/en/latest/deploy/linux/quick_start.html). + +Building clr requires `rocm-hip-libraries` meta package, which provides the pre-requisites for clr. ### Linux @@ -20,6 +22,7 @@ Please refer to Prerequisite Actions in [ROCm Installation Guide](https://docs.a - `cd clr && mkdir build && cd build` - For HIP : `cmake .. -DCLR_BUILD_HIP=ON -DHIP_COMMON_DIR=$HIP_COMMON_DIR` - `HIP_COMMON_DIR` points to [HIP](https://github.com/ROCm-Developer-Tools/HIP) + - `HIPCC_BIN_DIR` points to [HIPCC](https://github.com/ROCm-Developer-Tools/HIPCC)'s bin folder. If not provided, it defaults to `/opt/rocm/bin`. - For OpenCLâ„¢ : `cmake .. -DCLR_BUILD_OCL=ON` - `make` : to build - `make install` : to install