SWDEV-404816 - Default HIPCC_BIN_DIR to /opt/rocm/bin on Linux, incase user does not provide with one

Change-Id: I3a1dd467df787437ed923349776d3fe994928e0d
Этот коммит содержится в:
Jatin Chaudhary
2023-06-08 12:50:12 +01:00
коммит произвёл Jatin Jaikishan Chaudhary
родитель a4cccd3b0e
Коммит 3fd7df3f4c
3 изменённых файлов: 16 добавлений и 4 удалений
+1
Просмотреть файл
@@ -38,6 +38,7 @@ debug/
packages/
install/
.vs/
.vscode/
# Editor temp files
*.swp
+11 -3
Просмотреть файл
@@ -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()
+4 -1
Просмотреть файл
@@ -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