diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-10-28 09:08:41 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-10-28 09:37:35 +0100 |
commit | 20ab0d476f1f2467cb35a863d36e21dfb48f075b (patch) | |
tree | 642b5c62388e19c383c05f2d6c0da9905ee62c62 /sys-devel/llvm | |
parent | dev-python/aiohttp: Bump to 3.7.2 (diff) | |
download | gentoo-20ab0d476f1f2467cb35a863d36e21dfb48f075b.tar.gz gentoo-20ab0d476f1f2467cb35a863d36e21dfb48f075b.tar.bz2 gentoo-20ab0d476f1f2467cb35a863d36e21dfb48f075b.zip |
sys-devel/llvm: Backport tensorflow automagic dep fix
Backport patch fixing CMakeLists.txt not to use tensorflow
automagically. This also fixes build failure due to our TF packages
being incompatible. TF is now always-off.
Thanks to Georgy Yakovlev for rebasing and testing the patch.
Closes: https://bugs.gentoo.org/748444
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-devel/llvm')
-rw-r--r-- | sys-devel/llvm/files/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch | 55 | ||||
-rw-r--r-- | sys-devel/llvm/llvm-11.0.0.ebuild | 6 |
2 files changed, 61 insertions, 0 deletions
diff --git a/sys-devel/llvm/files/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch b/sys-devel/llvm/files/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch new file mode 100644 index 000000000000..73959afb2677 --- /dev/null +++ b/sys-devel/llvm/files/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch @@ -0,0 +1,55 @@ +From 8dcb88f7705fb3927938dd9bd103efcabafcefb0 Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev <gyakovlev@gentoo.org> +Date: Tue, 27 Oct 2020 18:20:56 -0700 +Subject: [PATCH] backport D88371, guard `find_library(tensorflow_c_api ...)` + +Differential Revision: https://reviews.llvm.org/D88371 +Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> +--- + llvm/CMakeLists.txt | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt +index 1f137f0..4112def 100644 +--- a/llvm/CMakeLists.txt ++++ b/llvm/CMakeLists.txt +@@ -832,6 +832,11 @@ configure_file( + ${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 +@@ -840,9 +845,9 @@ configure_file( + # 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() +@@ -877,12 +882,6 @@ add_custom_target(srpm + COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR}' ${LLVM_SRPM_BINARY_SPECFILE}) + set_target_properties(srpm PROPERTIES FOLDER "Misc") + +- +-# 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} ) +- + if(APPLE AND DARWIN_LTO_LIBRARY) + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}") +-- +2.26.2 + diff --git a/sys-devel/llvm/llvm-11.0.0.ebuild b/sys-devel/llvm/llvm-11.0.0.ebuild index 6bdf1c7ec770..ad20115fb6bf 100644 --- a/sys-devel/llvm/llvm-11.0.0.ebuild +++ b/sys-devel/llvm/llvm-11.0.0.ebuild @@ -73,6 +73,12 @@ RDEPEND="${RDEPEND} PDEPEND="sys-devel/llvm-common gold? ( >=sys-devel/llvmgold-${SLOT} )" +PATCHES=( + # backport tensorflow finding fix (avoids broken automagic dep) + # https://bugs.gentoo.org/748444 + "${FILESDIR}"/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch +) + python_check_deps() { use doc || return 0 |