Skip to content

Commit

Permalink
Merge pull request #92 from arvindcheru/develop-swdev-426645-patch
Browse files Browse the repository at this point in the history
Hard coded path (/opt/rocm-version) references removed from cmake files
  • Loading branch information
stanleytsang-amd authored Nov 20, 2023
2 parents 51e872c + 0644df0 commit eab84d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,14 @@ rocm_install(
)

set(FORTRAN_SRCS_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/hiprand/src/fortran")
configure_file(
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(CONFIG_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hiprand)

include(CMakePackageConfigHelpers)
configure_package_config_file(
src/hiprand-fortran-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/hiprand-fortran-config.cmake
INSTALL_DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR}
)

if (BUILD_WITH_LIB STREQUAL "CUDA")
Expand Down
5 changes: 3 additions & 2 deletions library/src/hiprand-fortran-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@
# target_link_libraries(bar "-lcurand" hip::hiprand)
# endif()
#
@PACKAGE_INIT@

# Fortran wrapper
if(@BUILD_FORTRAN_WRAPPER@)
set_and_check(hiprand_FORTRAN_SRC_DIR "@FORTRAN_SRCS_INSTALL_DIR@")
set_and_check(hiprand_FORTRAN_SRC_DIRS "@FORTRAN_SRCS_INSTALL_DIR@")
set_and_check(hiprand_FORTRAN_SRC_DIR "${PACKAGE_PREFIX_DIR}/hiprand/src/fortran")
set_and_check(hiprand_FORTRAN_SRC_DIRS "${PACKAGE_PREFIX_DIR}/hiprand/src/fortran")
set(hiprand_FORTRAN_FOUND YES)
else()
set(hiprand_FORTRAN_FOUND NOTFOUND)
Expand Down

0 comments on commit eab84d8

Please sign in to comment.