<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/3f0c985544d81b0c186c9fc59a490e87fa63ad0b">https://github.com/macports/macports-ports/commit/3f0c985544d81b0c186c9fc59a490e87fa63ad0b</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 3f0c985544d py-pytorch: patch unused-but-set-variable error Fixes: https://trac.macports.org/ticket/65016
</span>3f0c985544d is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 3f0c985544d81b0c186c9fc59a490e87fa63ad0b
</span>Author: Christopher Nielsen <mascguy@github.com>
AuthorDate: Sun Apr 17 14:53:46 2022 -0400
<span style='display:block; white-space:pre;color:#404040;'> py-pytorch: patch unused-but-set-variable error
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/65016
</span>---
python/py-pytorch/Portfile | 5 +++++
.../patch-benchmark-unused_local_variable.diff | 22 ++++++++++++++++++++++
2 files changed, 27 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-pytorch/Portfile b/python/py-pytorch/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 994767e2845..bc7bf9adf59 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-pytorch/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-pytorch/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -102,6 +102,11 @@ if {${name} ne ${subport}} {
</span> # Upstream PyTorch issue: https://github.com/pytorch/pytorch/issues/58054
patchfiles-append patch-glog-init-check.diff
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Patch to fix Clang -Wunused-but-set-variable errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # - https://github.com/google/benchmark/issues/1172
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # - https://github.com/google/benchmark/commit/e991355c02b93fe17713efe04cbc2e278e00fdbd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-benchmark-unused_local_variable.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Use Intel Math kernel Library
if {[variant_isset mkl]} {
patchfiles-append FindMKL-OMP.patch
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-pytorch/files/patch-benchmark-unused_local_variable.diff b/python/py-pytorch/files/patch-benchmark-unused_local_variable.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..6d964e6f961
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-pytorch/files/patch-benchmark-unused_local_variable.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,22 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/third_party/benchmark/src/complexity.cc.orig 2022-04-17 14:24:55.000000000 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/third_party/benchmark/src/complexity.cc 2022-04-17 14:23:08.000000000 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -77,19 +77,17 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // http://github.com/ismaelJimenez/Minimal-Cpp-Least-Squared-Fit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LeastSq MinimalLeastSq(const std::vector<int64_t>& n,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const std::vector<double>& time,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ BigOFunc* fitting_curve) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double sigma_gn = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double sigma_gn_squared = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double sigma_time = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double sigma_time_gn = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Calculate least square fitting parameter
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (size_t i = 0; i < n.size(); ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double gn_i = fitting_curve(n[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sigma_gn += gn_i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sigma_gn_squared += gn_i * gn_i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sigma_time += time[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sigma_time_gn += time[i] * gn_i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>