From 642e9305eb60fbe91a7db1f86faf2fdbe9648f9a Mon Sep 17 00:00:00 2001 From: Milos Puzovic Date: Wed, 7 May 2025 19:47:16 +0000 Subject: [PATCH] Fixes detection of ArmPL on Linux platform (#150031) On Linux it failed to detect that there is bin directory as it wasn't looking for armpl-info which is the only file that is in that directory on Linux and also adding link to math library as it is required to link against when checking for LAPACK functions. Fixes #149610 Pull Request resolved: https://github.com/pytorch/pytorch/pull/150031 Approved by: https://github.com/fadara01, https://github.com/malfet --- cmake/Modules/FindAPL.cmake | 2 +- cmake/Modules/FindLAPACK.cmake | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindAPL.cmake b/cmake/Modules/FindAPL.cmake index 8990d3091ee..7bb01955376 100644 --- a/cmake/Modules/FindAPL.cmake +++ b/cmake/Modules/FindAPL.cmake @@ -29,7 +29,7 @@ IF(NOT APL_LIB_DIR) ENDIF() # Check bin file -FIND_PATH(APL_BIN_DIR NAMES armpl_lp64.dll libarmpl_lp64.a PATHS ${APL_BIN_SEARCH_PATHS}) +FIND_PATH(APL_BIN_DIR NAMES armpl_lp64.dll armpl-info PATHS ${APL_BIN_SEARCH_PATHS}) IF(NOT APL_BIN_DIR) SET(APL_FOUND OFF) MESSAGE(STATUS "Could not verify APL bin directory. Turning APL_FOUND off") diff --git a/cmake/Modules/FindLAPACK.cmake b/cmake/Modules/FindLAPACK.cmake index 7d343f8adab..500bec8cef6 100644 --- a/cmake/Modules/FindLAPACK.cmake +++ b/cmake/Modules/FindLAPACK.cmake @@ -226,6 +226,9 @@ if(BLAS_FOUND) #Arm Performance Libraries IF((NOT LAPACK_INFO) AND (BLAS_INFO STREQUAL "apl")) SET(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES}) + if(UNIX) + list(APPEND CMAKE_REQUIRED_LIBRARIES -lm) + endif(UNIX) check_function_exists("cheev_" APL_LAPACK_WORKS) if(APL_LAPACK_WORKS) check_function_exists("cgesdd_" LAPACK_CGESDD_WORKS)