public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Craig Andrews" <candrews@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/rocm-comgr/files/, dev-libs/rocm-comgr/
Date: Wed,  7 Aug 2019 17:38:53 +0000 (UTC)	[thread overview]
Message-ID: <1565199526.c0aa27dab035db39ddc15bc22c0aba651513fead.candrews@gentoo> (raw)

commit:     c0aa27dab035db39ddc15bc22c0aba651513fead
Author:     Craig Andrews <candrews <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 15:53:28 2019 +0000
Commit:     Craig Andrews <candrews <AT> gentoo <DOT> org>
CommitDate: Wed Aug  7 17:38:46 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0aa27da

dev-libs/rocm-comgr: Radeon Open Compute Code Object Manager

Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>

 dev-libs/rocm-comgr/Manifest                       |  1 +
 .../files/rocm-comgr-2.6.0-correctly-install.patch | 44 +++++++++++++++
 .../files/rocm-comgr-2.6.0-dependencies.patch      | 63 ++++++++++++++++++++++
 .../files/rocm-comgr-2.6.0-find-clang.patch        | 26 +++++++++
 .../files/rocm-comgr-2.6.0-find-lld-includes.patch | 43 +++++++++++++++
 dev-libs/rocm-comgr/metadata.xml                   | 14 +++++
 dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild        | 45 ++++++++++++++++
 7 files changed, 236 insertions(+)

diff --git a/dev-libs/rocm-comgr/Manifest b/dev-libs/rocm-comgr/Manifest
new file mode 100644
index 00000000000..8e7150e7fd2
--- /dev/null
+++ b/dev-libs/rocm-comgr/Manifest
@@ -0,0 +1 @@
+DIST rocm-comgr-2.6.0.tar.gz 1484343 BLAKE2B fcb496b4997d672640e3f75622e74085eeb9dfe83c88ae025530389d3cdca7628155168060e71f7a3ff915e933ffe70c7026720dc124d128d16ef4df397525e7 SHA512 b14e90603d2b6e17f6b0335ea35da2e5d7e31710f301d7a7f7751a45d996e3dbbfbf84a03e2e911e8798e72e77b87b5cd88317e897cb4de3ee5cf0e7c3222d68

diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch
new file mode 100644
index 00000000000..74206760f39
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch
@@ -0,0 +1,44 @@
+From 98f589636729b1e25625db6880fbd7820dcf9e40 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 10:04:11 -0400
+Subject: [PATCH] Install to standard locations using GNUInstallDirs
+
+Some distributions require 64 bit libraries to be installed to lib64, for example.
+Using GNUInstallDirs ensures that files are installed to the expected locations.
+---
+ CMakeLists.txt | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 454b830..a89af16 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,7 @@
+ cmake_minimum_required(VERSION 3.2.0)
+ 
++include (GNUInstallDirs)
++
+ # Build ROCM-Compiler-Support with ccache if the package is present.
+ set(ROCM_COMPILER_SUPPORT_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
+ if(ROCM_COMPILER_SUPPORT_CCACHE_BUILD)
+@@ -146,17 +148,17 @@ configure_file("cmake/${AMD_COMGR_CONFIG_NAME}.in"
+ 
+ install(TARGETS amd_comgr
+   EXPORT amd_comgr_export
+-  DESTINATION lib)
++  DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ install(FILES
+   "include/amd_comgr.h"
+-  DESTINATION include)
++  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ install(FILES
+   "README.md"
+   "LICENSE.txt"
+   "NOTICES.txt"
+-  DESTINATION share/amd_comgr)
++  DESTINATION ${CMAKE_INSTALL_DATADIR}/amd_comgr)
+ 
+ # Generate the install-tree package.
+ set(AMD_COMGR_PREFIX_CODE "

diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch
new file mode 100644
index 00000000000..47f03716829
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch
@@ -0,0 +1,63 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/19
+
+--- comgr/CMakeLists.old	2019-07-19 17:19:26.080276421 +0200
++++ comgr/CMakeLists.txt	2019-07-19 18:17:25.780163592 +0200
+@@ -185,7 +185,11 @@
+ include_directories(./yaml-cpp/include)
+ 
+ set(CLANG_LIBS
+-  clangFrontendTool)
++  clangFrontendTool
++  clangFrontend
++  clangBasic
++  clangDriver
++  clangSerialization)
+ 
+ set(LLD_LIBS
+   lldELF
+@@ -193,8 +197,19 @@
+ 
+ llvm_map_components_to_libnames(LLVM_LIBS
+   ${LLVM_TARGETS_TO_BUILD}
++  Option
+   DebugInfoDWARF
+-  Symbolize)
++  Symbolize
++  Support
++  Object
++  BitWriter
++  MC
++  MCParser
++  MCDisassembler
++  Core
++  IRReader
++  CodeGen
++  Linker)
+ 
+ target_link_libraries(amd_comgr
+   PUBLIC
+@@ -203,8 +218,8 @@
+     ${AMD_COMGR_PRIVATE_LINKER_OPTIONS}
+     yaml-cpp
+     ${CLANG_LIBS}
+-    ${LLD_LIBS}
+     ${LLVM_LIBS}
++    ${LLD_LIBS}
+ )
+ 
+ if (NOT UNIX)
+@@ -238,3 +253,14 @@
+ if (NOT CPack_CMake_INCLUDED)
+   include(CPack)
+ endif()
++
++MESSAGE(STATUS "<<< Gentoo configuration >>>
++Build type      ${CMAKE_BUILD_TYPE}
++Install path    ${CMAKE_INSTALL_PREFIX}
++Compiler flags:
++C               ${CMAKE_C_FLAGS}
++C++             ${CMAKE_CXX_FLAGS}
++Linker flags:
++Executable      ${CMAKE_EXE_LINKER_FLAGS}
++Module          ${CMAKE_MODULE_LINKER_FLAGS}
++Shared          ${CMAKE_SHARED_LINKER_FLAGS}\n")

diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch
new file mode 100644
index 00000000000..dda005ab7a2
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch
@@ -0,0 +1,26 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/16
+
+From 09eb70afa22e2d6066a5f29888158c6005170ca6 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 10:13:30 -0400
+Subject: [PATCH] Find Clang avoiding the system (non-ROC) LLVM
+
+Use NO_DEFAULT_PATH to avoid finding the system (non-ROC) LLVM.
+Use /opt/rocm/llvm as an additional hint to be consistent with the build systems of other ROC projects (such as ROCm-OpenCL-Driver)
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 454b830..8642c98 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,7 +13,7 @@ endif()
+ 
+ project(code_object_manager)
+ 
+-find_package(Clang REQUIRED CONFIG)
++find_package(Clang REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
+ add_definitions(${LLVM_DEFINITIONS})
+ include_directories(${LLVM_INCLUDE_DIRS})
+ link_directories(${LLVM_LIBRARY_DIRS})

diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch
new file mode 100644
index 00000000000..5b44feaf1b3
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch
@@ -0,0 +1,43 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/17
+
+From 4588c1a5aad3edae9d3e121685d8d1f5fddd54ba Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 10:45:01 -0400
+Subject: [PATCH] Find lld includes in LLVM_INCLUDE_DIRS
+
+Allows building against an LLVM build tree
+---
+ CMakeLists.txt | 20 ++------------------
+ 1 file changed, 2 insertions(+), 18 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 454b830..db28533 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,24 +19,8 @@ include_directories(${LLVM_INCLUDE_DIRS})
+ link_directories(${LLVM_LIBRARY_DIRS})
+ include_directories(${CLANG_INCLUDE_DIRS})
+ 
+-# FIXME: There is no way to directly determine the include paths for LLD when
+-# working with an LLVM build tree, but we want to avoid having to install LLVM
+-# to build Comgr. This should eventually be fixed in usptream LLD so this can
+-# be removed.
+-if(DEFINED LLVM_BUILD_MAIN_SRC_DIR)
+-  set(INTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/tools/lld/include")
+-  set(EXTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/../lld/include")
+-  if (EXISTS "${INTERNAL_LLD_INCLUDE_DIRS}"
+-      AND IS_DIRECTORY "${INTERNAL_LLD_INCLUDE_DIRS}")
+-    set(LLD_INCLUDE_DIRS "${INTERNAL_LLD_INCLUDE_DIRS}")
+-  elseif (EXISTS "${EXTERNAL_LLD_INCLUDE_DIRS}"
+-      AND IS_DIRECTORY "${EXTERNAL_LLD_INCLUDE_DIRS}")
+-    set(LLD_INCLUDE_DIRS "${EXTERNAL_LLD_INCLUDE_DIRS}")
+-  else()
+-    message(FATAL_ERROR "You are attempting to compile using an LLVM build tree, but the LLD include directory could not be located. The paths '${INTERNAL_LLD_INCLUDE_DIRS}' and '${EXTERNAL_LLD_INCLUDE_DIRS}' were tried.")
+-  endif()
+-  include_directories(${LLD_INCLUDE_DIRS})
+-endif()
++set(LLD_INCLUDE_DIRS "${LLVM_INCLUDE_DIRS}/lld")
++include_directories(${LLD_INCLUDE_DIRS})
+ 
+ find_package(AMDDeviceLibs CONFIG)
+ 

diff --git a/dev-libs/rocm-comgr/metadata.xml b/dev-libs/rocm-comgr/metadata.xml
new file mode 100644
index 00000000000..20237687f91
--- /dev/null
+++ b/dev-libs/rocm-comgr/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+    <maintainer type="person">
+        <email>candrews@gentoo.org</email>
+        <name>Craig Andrews</name>
+    </maintainer>
+    <upstream>
+        <remote-id type="github">RadeonOpenCompute/ROCm-CompilerSupport</remote-id>
+    </upstream>
+    <longdescription lang="en">
+        Radeon Open Compute Code Object Manager
+    </longdescription>
+</pkgmetadata>

diff --git a/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild b/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild
new file mode 100644
index 00000000000..0f058da194b
--- /dev/null
+++ b/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+if [[ ${PV} == *9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/"
+	inherit git-r3
+	S="${WORKDIR}/${P}/lib/comgr"
+else
+	SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+	S="${WORKDIR}/ROCm-CompilerSupport-roc-${PV}/lib/comgr"
+	KEYWORDS="~amd64"
+fi
+PATCHES=(
+	"${FILESDIR}/${P}-correctly-install.patch"
+	"${FILESDIR}/${P}-find-clang.patch"
+	"${FILESDIR}/${P}-find-lld-includes.patch"
+	"${FILESDIR}/${P}-dependencies.patch"
+)
+
+DESCRIPTION="Radeon Open Compute Code Object Manager"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocm-device-libs
+	dev-cpp/yaml-cpp
+	sys-devel/llvm-roc"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+#	rm -rf yaml-cpp || die
+	cmake-utils_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/"
+		-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+	)
+	cmake-utils_src_configure
+}


             reply	other threads:[~2019-08-07 17:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 17:38 Craig Andrews [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-08 19:22 [gentoo-commits] repo/gentoo:master commit in: dev-libs/rocm-comgr/files/, dev-libs/rocm-comgr/ Sam James
2023-11-01  9:28 Yixun Lan
2023-09-03  6:31 罗百科
2023-03-07  7:57 Sam James
2023-02-02 12:54 Sam James
2022-02-11 16:12 Joonas Niilola
2020-08-25 21:08 Craig Andrews
2020-03-02  0:39 Craig Andrews
2019-09-27 18:05 Craig Andrews
2019-08-07 17:38 Craig Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1565199526.c0aa27dab035db39ddc15bc22c0aba651513fead.candrews@gentoo \
    --to=candrews@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox