<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Please backport e72d792c147ee506e337401e20c0f23042cc43fe: Guard `find_library(tensorflow_c_api ...)` by checking for TENSORFLOW_C_LIB_PATH to be set by the user"
href="https://bugs.llvm.org/show_bug.cgi?id=47992">47992</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Please backport e72d792c147ee506e337401e20c0f23042cc43fe: Guard `find_library(tensorflow_c_api ...)` by checking for TENSORFLOW_C_LIB_PATH to be set by the user
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mgorny@gentoo.org
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Blocks</th>
<td>47800
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=24109" name="attach_24109" title="0001-backport-D88371-guard-find_library-tensorflow_c_api.patch">attachment 24109</a> <a href="attachment.cgi?id=24109&action=edit" title="0001-backport-D88371-guard-find_library-tensorflow_c_api.patch">[details]</a></span>
0001-backport-D88371-guard-find_library-tensorflow_c_api.patch
The TF logic in 11.0.0 causes LLVM to fail to build on Gentoo when TF is
installed.
I'm attaching the rebased version of the commit that applies to 11.x.
commit e72d792c147ee506e337401e20c0f23042cc43fe
Author: Mehdi Amini <<a href="mailto:joker.eph@gmail.com">joker.eph@gmail.com</a>>
Date: 2020-09-28 22:46:22 +0200
Guard `find_library(tensorflow_c_api ...)` by checking for
TENSORFLOW_C_LIB_PATH to be set by the user
Also have CMake fails if the user provides a TENSORFLOW_C_LIB_PATH but
we can't find TensorFlow at this path.
At the moment the CMake script tries to figure if TensorFlow is
available on the system and enables support for it. This is in general
not desirable to customize build features this way and instead it is
preferable to let the user opt-in explicitly into the features they want
to enable. This is in line with other optional external dependencies
like Z3.
There are a few reasons to this but amongst others:
- reproducibility: making features "magically" enabled based on whether
we find a package on the system or not makes it harder to handle bug
reports from users.
- user control: they can't have TensorFlow on the system and build LLVM
without TensorFlow right now. They also would suddenly distribute LLVM
with a different set of features unknowingly just because their build
machine environment would change subtly.
Right now this is motivated by a user reporting build failures on their
system:
.../mesa-git/llvm-git/src/llvm-project/llvm/lib/Analysis/TFUtils.cpp:23:10:
fatal error: tensorflow/c/c_api.h: No such file or directory
23 | #include "tensorflow/c/c_api.h"
| ^~~~~~
It looks like we detected TensorFlow at configure time but couldn't set all
the paths correctly.
Differential Revision: <a href="https://reviews.llvm.org/D88371">https://reviews.llvm.org/D88371</a></pre>
</div>
</p>
<div id="referenced">
<hr style="border: 1px dashed #969696">
<b>Referenced Bugs:</b>
<ul>
<li>
[<a class="bz_bug_link
bz_status_NEW "
title="NEW - [meta] 11.0.1 Release Blockers"
href="https://bugs.llvm.org/show_bug.cgi?id=47800">Bug 47800</a>] [meta] 11.0.1 Release Blockers
</li>
</ul>
</div>
<br>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>