summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@gentoo.org>2020-11-18 12:53:45 -0500
committerCraig Andrews <candrews@gentoo.org>2020-11-18 12:56:01 -0500
commita8ad5900db1f02b75ce25108ea867806abf07095 (patch)
treea00137ee35cdff3a44754161cf58e1ef9088cb5e /sys-devel/llvm-roc
parentapp-misc/lirc: Python 3.8 and 3.9 compatibility (diff)
downloadgentoo-a8ad5900db1f02b75ce25108ea867806abf07095.tar.gz
gentoo-a8ad5900db1f02b75ce25108ea867806abf07095.tar.bz2
gentoo-a8ad5900db1f02b75ce25108ea867806abf07095.zip
sys-devel/llvm-roc: Fix compile when tensorflow is installed
Closes: https://bugs.gentoo.org/754276 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Craig Andrews <candrews@gentoo.org>
Diffstat (limited to 'sys-devel/llvm-roc')
-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.ebuild1
2 files changed, 36 insertions, 0 deletions
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
index 8bcc3f8ce0eb..bc0fdfcde777 100644
--- a/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild
+++ b/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild
@@ -25,6 +25,7 @@ S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
PATCHES=(
"${FILESDIR}/${PN}-3.7.0-current_pos.patch"
+ "${FILESDIR}/${P}-tensorflow.patch"
)
CMAKE_BUILD_TYPE=RelWithDebInfo