Two issues are fixed:

libamdhip64_static.a is not included in package.

cmake generated target files uses installation path of libraries
which are created when the libraries are built and installed.
The CI uses customized installation directory which is not
the package installation directory, thefore the library location
in cmake generated target files differs from the library location
installed from package. This causes rocPRIM build failure since
rocPRIM uses pkg-config which checks library location.

The fix is to fix the library location before adding cmake
generated target files to package.

Change-Id: I4aa2c6138f58df6d4a86301a5c0436edcb19ab70
Этот коммит содержится в:
Yaxun (Sam) Liu
2020-04-14 09:47:59 -04:00
родитель 88304c15e6
Коммит 3128b2dfd1
+12 -2
Просмотреть файл
@@ -2,19 +2,29 @@ cmake_minimum_required(VERSION 2.8.3)
project(hip_vdi)
install(FILES @PROJECT_BINARY_DIR@/lib/libamdhip64.so DESTINATION lib)
install(FILES @PROJECT_BINARY_DIR@/lib/libamdhip64_static.a DESTINATION lib)
install(FILES @PROJECT_BINARY_DIR@/lib/libhip_hcc.so DESTINATION lib)
install(FILES @PROJECT_BINARY_DIR@/lib/libhiprtc.so DESTINATION lib)
install(FILES @PROJECT_BINARY_DIR@/.hipInfo DESTINATION lib)
install(FILES @PROJECT_BINARY_DIR@/hip-config.cmake @PROJECT_BINARY_DIR@/hip-config-version.cmake DESTINATION lib/cmake/hip)
file(GLOB target_files @CONFIG_PACKAGE_INSTALL_DIR@/hip-targets-*.cmake)
install(FILES @CONFIG_PACKAGE_INSTALL_DIR@/hip-targets.cmake ${target_files} DESTINATION lib/cmake/hip)
#############################
# Packaging steps
#############################
set(CPACK_SET_DESTDIR TRUE)
set(CPACK_INSTALL_PREFIX "/opt/rocm/hip")
## cmake generated target files contains IMPORTED_LOCATION_RELEASE etc. which
## is installation path when building the project, which may be different from
## the intallation path for packaging. These paths have to be replaced by
## the package installation path, otherwise apps using pkg-config will fail.
file(GLOB _target_files @CONFIG_PACKAGE_INSTALL_DIR@/hip-targets*.cmake)
foreach(_target_file ${_target_files})
execute_process(COMMAND sed -i s:@CMAKE_INSTALL_PREFIX@:${CPACK_INSTALL_PREFIX}:g ${_target_file})
endforeach()
install(FILES ${_target_files} DESTINATION lib/cmake/hip)
set(CPACK_PACKAGE_NAME "hip-vdi")
set(HCC_PACKAGE_NAME "vdi")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HIP: Heterogenous-computing Interface for Portability [VDI]")