[ROCm] Custom OpenBLAS library name (#166333)

- TheRock build system for ROCm builds OpenBLAS from source and uses a custom name for the library.
- Following existing conventions in `FindOpenBLAS.cmake` to support finding a custom named version of OpenBLAS.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/166333
Approved by: https://github.com/jeffdaily
This commit is contained in:
Joseph Macaranas 2025-10-27 22:13:02 +00:00 committed by PyTorch MergeBot
parent 2a5f87decf
commit 92381a5aa7

View File

@ -29,10 +29,15 @@ SET(Open_BLAS_LIB_SEARCH_PATHS
$ENV{OpenBLAS}/lib $ENV{OpenBLAS}/lib
$ENV{OpenBLAS_HOME} $ENV{OpenBLAS_HOME}
$ENV{OpenBLAS_HOME}/lib $ENV{OpenBLAS_HOME}/lib
) )
SET(Open_BLAS_LIB_NAME openblas)
IF(DEFINED ENV{OpenBLAS_LIB_NAME})
SET(Open_BLAS_LIB_NAME $ENV{OpenBLAS_LIB_NAME})
ENDIF()
FIND_PATH(OpenBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Open_BLAS_INCLUDE_SEARCH_PATHS}) FIND_PATH(OpenBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Open_BLAS_INCLUDE_SEARCH_PATHS})
FIND_LIBRARY(OpenBLAS_LIB NAMES openblas PATHS ${Open_BLAS_LIB_SEARCH_PATHS}) FIND_LIBRARY(OpenBLAS_LIB NAMES ${Open_BLAS_LIB_NAME} PATHS ${Open_BLAS_LIB_SEARCH_PATHS})
SET(OpenBLAS_FOUND ON) SET(OpenBLAS_FOUND ON)