Skip to content

[Issue] include and library paths are hardcoded #1086

@e-kwsm

Description

@e-kwsm

if (RVS_ROCBLAS EQUAL 1)
set(ROCBLAS_INC_DIR "${CMAKE_BINARY_DIR}/rvs_rblas-src/build/release/rocblas-install")
set(ROCBLAS_LIB_DIR "${CMAKE_BINARY_DIR}/rvs_rblas-src/build/release/rocblas-install/lib/")
else()
set(ROCBLAS_INC_DIR "${ROCM_PATH}/include")
set(ROCBLAS_LIB_DIR "${ROCM_PATH}/lib")
endif()
if (RVS_ROCMSMI EQUAL 1)
set(ROCM_SMI_INC_DIR "${CMAKE_BINARY_DIR}/rvs_smi-src/include")
set(ROCM_SMI_LIB_DIR "${CMAKE_BINARY_DIR}/rvs_smi-build")
else()
set(ROCM_SMI_INC_DIR "${ROCM_PATH}/rocm_smi/include")
set(ROCM_SMI_LIB_DIR "${ROCM_PATH}/rocm_smi/lib")
endif()

Here the paths are hardcoded, and passing -DROCBLAS_INC_DIR:PATH=/opt/rocm/include/rocblas -DROCM_SMI_LIB_DIR:PATH=/opt/rocm/lib (as provided by arch linux rocblas 7.1.1 and rocm-smi-lib 7.1.1 packages, resp.) has no effect, resulting in configuration error:

…
-- MODULE: gm
ERROR: rocm_smi library can't be found!...
…
-- MODULE: iet
ERROR: rocm_smi library can't be found!...
…
-- MODULE: edp
ERROR: rocBLAS headers can't be found under specified path. Please set ROCBLAS_INC_DIR path. Current value is : /opt/rocm/include
…

Also, HIP_INC_DIR is inappropriately set at:

set(HIP_INC_DIR /opt/rocm/hip)
if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime_api.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()

set(HIP_INC_DIR /opt/rocm/hip)
if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime_api.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()

I would recommend to use find_package functional instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions