Skip to content

Commit

Permalink
dev-libs/rocr-runtime: Install libraries to libdir, not libdir/hsa
Browse files Browse the repository at this point in the history
Installing to libdir (as opposed to a subdirectory)
allows the linker to find the libraries

Package-Manager: Portage-2.3.71, Repoman-2.3.17
Signed-off-by: Craig Andrews <[email protected]>
  • Loading branch information
candrews committed Aug 14, 2019
1 parent c1059d8 commit 2ddd8ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From 866c2fbcf1efa3e84e6f25bebc12dc1d4caa4e74 Mon Sep 17 00:00:00 2001
From: Craig Andrews <[email protected]>
Date: Mon, 7 Jan 2019 21:06:14 -0500
Subject: [PATCH] Correctly install the library into the system
https://github.com/RadeonOpenCompute/ROCR-Runtime/pull/51/

Install to standard locations in /usr/{lib,include}/lib (as opposed to /usr/hsa/{lib,include}/hsa)
Use CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR from GNUInstallDirs instead of using "lib" and "include"
---
src/CMakeLists.txt | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
commit 2d51a6133f32b72f60fba0e95234aee2b63aa682 (HEAD -> patch-6)
Author: Craig Andrews <[email protected]>
Date: Mon Jan 7 21:06:14 2019 -0500

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 37a9b09..e39f3d2 100644
Correctly install the library into the system

Install to standard locations in /usr/{lib,include}/lib (as opposed to /usr/hsa/{lib,include}/hsa)
Use CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR from GNUInstallDirs instead of using "lib" and "include"

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37a9b09..545f183 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,7 @@ project( ${CORE_RUNTIME_TARGET} )
Expand All @@ -21,22 +21,22 @@ index 37a9b09..e39f3d2 100644
include ( hsa_common )

## Find LibElf
@@ -177,14 +178,12 @@ if ( "${CMAKE_BUILD_TYPE}" STREQUAL Release )
@@ -176,15 +177,9 @@ if ( "${CMAKE_BUILD_TYPE}" STREQUAL Release )
add_custom_command ( TARGET ${CORE_RUNTIME_TARGET} POST_BUILD COMMAND ${CMAKE_STRIP} *.so )
endif ()

## Create symlinks for packaging and install
-## Create symlinks for packaging and install
-add_custom_target ( hsa-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../hsa/include/hsa hsa-link )
-add_custom_target ( ${CORE_RUNTIME_TARGET}.so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../hsa/lib/${CORE_RUNTIME_LIBRARY}.so ${CORE_RUNTIME_LIBRARY}.so-link )
+add_custom_target ( ${CORE_RUNTIME_TARGET}.so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink hsa/${CORE_RUNTIME_LIBRARY}.so ${CORE_RUNTIME_LIBRARY}.so-link )

-
## Set install information
-install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION hsa/lib )
-install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION hsa/include/hsa )
-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/hsa-link DESTINATION include PERMISSIONS OWNER_WRITE OWNER_READ RENAME hsa )
-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}.so-link DESTINATION lib PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so )
+install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/hsa )
+install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hsa )
+install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}.so-link DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so )

## Packaging directives
set ( CPACK_PACKAGE_NAME "hsa-rocr-dev" )

0 comments on commit 2ddd8ac

Please sign in to comment.