Skip to content

Commit

Permalink
cmake: Update ARMPL properties
Browse files Browse the repository at this point in the history
  - Ensure that libgfortran and libm are pulled in when
    linking against KokkosKernels::ARMPL.
  - Update CheckHostBlasReturnComplex to use properties of
    KokkosKernels::ARMPL.

src: Link kokkoskernels against KokkosKernels::ARMPL.
  • Loading branch information
e10harvey committed Mar 1, 2021
1 parent 28644d2 commit 8afdc60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CheckHostBlasReturnComplex.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ FUNCTION(CHECK_HOST_BLAS_RETURN_COMPLEX VARNAME)
IF (KOKKOSKERNELS_HAS_TRILINOS)
SET(CMAKE_REQUIRED_LIBRARIES ${TPL_BLAS_LIBRARIES})
ELSE()
SET(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
# For TPLs, just pull out the required libraries from the target properies.
IF (KOKKOSKERNELS_ENABLE_TPL_ARMPL)
GET_TARGET_PROPERTY(CMAKE_REQUIRED_LIBRARIES KokkosKernels::ARMPL INTERFACE_LINK_LIBRARIES)
ELSE()
SET(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
ENDIF()
ENDIF()

SET(SOURCE
Expand Down
10 changes: 5 additions & 5 deletions cmake/Modules/FindTPLARMPL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ TRY_COMPILE(KOKKOSKERNELS_TRY_COMPILE_ARMPL
IF(NOT KOKKOSKERNELS_TRY_COMPILE_ARMPL)
MESSAGE(FATAL_ERROR "KOKKOSKERNELS_TRY_COMPILE_ARMPL_OUT=${KOKKOSKERNELS_TRY_COMPILE_ARMPL_OUT}")
ELSE()
# Check with Jeremy. It looks like the defacto standard is to
# have the user set BLAS_LIBRARIES. However, we've done the work
# of finding the armpl blas lib here, so let's go ahead and set it
# in BLAS_LIBRARIES.
SET(BLAS_LIBRARIES "${ARMPL_LIB};gfortran;amath;m")
# KokkosKernels::ARMPL is an alias to the ARMPL target.
# Let's add in the libgfortran and libm dependencies for users here.
GET_TARGET_PROPERTY(ARMPL_INTERFACE_LINK_LIBRARIES KokkosKernels::ARMPL INTERFACE_LINK_LIBRARIES)
SET(ARMPL_INTERFACE_LINK_LIBRARIES "${ARMPL_INTERFACE_LINK_LIBRARIES};-lgfortran;-lm")
SET_TARGET_PROPERTIES(ARMPL PROPERTIES INTERFACE_LINK_LIBRARIES "${ARMPL_INTERFACE_LINK_LIBRARIES}")
ENDIF()
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,5 @@ KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC MKL)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUBLAS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUSPARSE)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC METIS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ARMPL)
# Not yet here KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC MAGMA)

0 comments on commit 8afdc60

Please sign in to comment.