summaryrefslogtreecommitdiff
path: root/sys-devel/llvm-roc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /sys-devel/llvm-roc
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'sys-devel/llvm-roc')
-rw-r--r--sys-devel/llvm-roc/Manifest3
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch35
-rw-r--r--sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild71
3 files changed, 109 insertions, 0 deletions
diff --git a/sys-devel/llvm-roc/Manifest b/sys-devel/llvm-roc/Manifest
index be8dc74ef1a4..08544a214ddc 100644
--- a/sys-devel/llvm-roc/Manifest
+++ b/sys-devel/llvm-roc/Manifest
@@ -1,7 +1,10 @@
AUX llvm-roc-3.0.0-add_libraries.patch 648 BLAKE2B a201718b8afdc1ba18ae5d7e85a73fde7ca2bb163eecabab33d37c5815ac6ab8c4f8d960ab40f95ad6df95da626a439fbda1d20c25abb9558a37bcdf64a77e64 SHA512 7a1892c8781146830aa5bf69db20bbe7329634f469aeef0946232b15138b55d332491092ed00a4cf698033f19d8f279f4a5b34f13168d5b9ff7eba4a229e82a0
AUX llvm-roc-3.7.0-current_pos.patch 1292 BLAKE2B 8481497e3f9c46c142034ae4c5455f94e79d9c10cc806945af64252043d46c558a3ba08078239a673937705edfd21ba85f618d1d3a5bff652d45efe4e1e70877 SHA512 6cd41988e4eb654b7040c238bef8fc10d8f5922bac9c0ba112c5ba1b57c769472d0b9deaea6822f2d6bbbfda0a27bed2c1df2bba93a79cb4bf08f24185843981
+AUX llvm-roc-3.9.0-tensorflow.patch 1901 BLAKE2B 2fc2d2d77987e8a85c14e1190645f0453f431a6d606336696549e518cf216a15818bc4117bec7c270161ef86f0e6770c63c9fda84e12f3c3334c9dd04fa5ffbf SHA512 151b2f0fc9fd7193fc0af0c088d70b2e36fda484228f3c911dbf1a6c6e836107a8e156a98585dd2ffb6faea0953a05d769e986d72def0f2f530bc3da5c5521d7
DIST llvm-rocm-ocl-3.7.0.tar.gz 116973132 BLAKE2B c1cc8a3b95292d726626d3cb59ec1b96549682bfcbec16030e47cf1318c6ea01bc76f3349f012ce4f1e4d8b9fe192c51a025c2d08cf593622c61fe7c61969ba6 SHA512 0626075bedb3898c96c0bb0be7a2aba4662050a1c738115f661bedc03d744ace7a4581b55c6325060740c13a0e50e72e09272bb02c1186c2c4a40fc9b961dcbe
DIST llvm-rocm-ocl-3.8.0.tar.gz 117004300 BLAKE2B 13c3213f0fb951fb9d574e8f6d76bb6c632fecadfe93dbe68a9720baa22e35aa3269deef8b533c5a5ff50a2c1ee3dd7a1ea0fae4b8ab8573ec5bfc5ca5d04f4f SHA512 4eca387a132c9d1237ebec7c80319e99c80088766209d05a697d09890f4a82c56ba5f48a5c8c8749bb051c177bb5eab67e00405b04d3191681d0ac7cf1ae868c
+DIST llvm-rocm-ocl-3.9.0.tar.gz 123591368 BLAKE2B 54b44d705e7704921df1914bac6dc1da8e420f9383efb698a9cf6a339b653d71cad29aa077a9e24d6764ca81fb8dc55fa70abb0cfac004d40f7d811e20ec9945 SHA512 3404390506b33c1de1d05980fafb219692985f38b52d852e9a47ab94e57228caa25ccd0d0d69da656281de32c75e001f60cb9f22453e70fea7b39d065d4333af
EBUILD llvm-roc-3.7.0-r1.ebuild 1397 BLAKE2B 08aec56b8ab26093f28a9118ca043adb35dcb84ae5899da5890cbeecb5d10f8d6b08e767a490272a5f35d1b3a5ee8d912a52b448ee57582cda9f99fce57ec8ec SHA512 745f2a9fa18bc3b9d76a324beb1e5165f9be8f720ef133b35e1509c08c08e48872ec4c7402e52d29a3b493e27729a43081fd0e90afe90d30b64d6da3f046e824
EBUILD llvm-roc-3.8.0.ebuild 1492 BLAKE2B 73fd9fd2c47a18b5de44222b84fead548f85b4e67c18838050c52917b6836debee77bc83db6aa0a378516b48a56e5daaac53dde84bdbe1dbefd02494b06498d8 SHA512 d45f0e60c2f12e9b98425310fe370aeeb5d29cd24bfa83b1b908bcbc25866a49e6e1fc7facb04e699bd897f1960a394f2e3a4c5a8308ad9af6177f735dc40631
+EBUILD llvm-roc-3.9.0.ebuild 1529 BLAKE2B 07aac1728864214e61ed45cee3ca718c7830835502fe9e6c1e5ba5d6fc8303f3b644b0bb3476f8a1adcaabf09e961b3b55bfce34312b953e8ba855b7f36cdecb SHA512 5b9755c9c06ed465b58d8ca7c677211c04cb05eafaffee1e558b26d3d3bc033a1b8d6b1b3e69732441edd9f14cbf608da919f4eac3e283f5f4226dc332ffb68c
MISC metadata.xml 461 BLAKE2B 5a060c417f0bb9bf1fba8375292e7bff20b2c50c3a2ab490bd436f81a954dbd370d61ba59b305b8bdaad9887e9c6a872eb30fea31c566dc6d74d3493b40d0a26 SHA512 a82c2186fc0642dab37608155dcf0aafd20701cb7e2769c6eb3aae88d4df6690743769a75f47efdb36fd8a3d6771f0feecd3efd01c98460fe195394c16d95660
diff --git a/sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch b/sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch
new file mode 100644
index 000000000000..3e1124457ad3
--- /dev/null
+++ b/sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch
@@ -0,0 +1,35 @@
+--- llvm-project-rocm-3.9.0.orig/CMakeLists.txt 2020-11-12 22:03:09.902293395 +0100
++++ llvm-project-rocm-3.9.0/CMakeLists.txt 2020-11-12 22:07:28.185294853 +0100
+@@ -824,6 +824,11 @@
+ ${LLVM_INCLUDE_DIR}/llvm/Config/Targets.def
+ )
+
++# They are not referenced. See set_output_directory().
++set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
++set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
++set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
++
+ # For up-to-date instructions for installing the Tensorflow dependency, refer to
+ # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
+ # In this case, the latest C API library is available for download from
+@@ -832,18 +837,13 @@
+ # LLVM_HAVE_TF_API, through llvm-config.h, so that a user of the LLVM library may
+ # also leverage the dependency.
+ set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
+-find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib)
+
+-if (tensorflow_c_api)
++if (TENSORFLOW_C_LIB_PATH)
++ find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
+ set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
+ include_directories(${TENSORFLOW_C_LIB_PATH}/include)
+ endif()
+
+-# They are not referenced. See set_output_directory().
+-set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
+-set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
+-set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
+-
+ # For up-to-date instructions for installing the Tensorflow dependency, refer to
+ # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
+ # Specifically, assuming python3 is installed:
diff --git a/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild b/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild
new file mode 100644
index 000000000000..bc0fdfcde777
--- /dev/null
+++ b/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="Radeon Open Compute llvm,lld,clang"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
+SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
+
+LICENSE="UoI-NCSA rc BSD public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug runtime"
+
+RDEPEND="virtual/cblas
+ dev-libs/libxml2
+ sys-libs/zlib
+ sys-libs/ncurses:="
+DEPEND="${RDEPEND}"
+PDEPEND="dev-libs/rocr-runtime"
+
+S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
+ "${FILESDIR}/${P}-tensorflow.patch"
+)
+
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+src_prepare() {
+ cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
+ eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
+ eapply_user
+ cmake_src_prepare
+}
+
+src_configure() {
+ PROJECTS="clang;lld"
+
+ if usex runtime; then
+ PROJECTS+=";compiler-rt"
+ fi
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
+ -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
+ -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
+ -DLLVM_BUILD_DOCS=NO
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=NO
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ -DLLVM_VERSION_SUFFIX=roc
+ -DOCAMLFIND=NO
+ )
+
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ cat > "99${PN}" <<-EOF
+ LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
+ EOF
+ doenvd "99${PN}"
+}