libtensorflow: rebuild

* libtensorflow: migrate to python@3.11
* libtensorflow: add python libexec to PATH

Closes #119032.

Co-authored-by: Michael Cho <cho-m@tuta.io>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
ryenus 2022-12-26 14:52:36 +08:00 committed by BrewTestBot
parent 0c09b47540
commit 78e742da8a
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 5 additions and 3 deletions

View File

@ -18,7 +18,7 @@ class Libtensorflow < Formula
depends_on "bazelisk" => :build depends_on "bazelisk" => :build
depends_on "numpy" => :build depends_on "numpy" => :build
depends_on "python@3.10" => :build depends_on "python@3.11" => :build
resource "homebrew-test-model" do resource "homebrew-test-model" do
url "https://github.com/tensorflow/models/raw/v1.13.0/samples/languages/java/training/model/graph.pb" url "https://github.com/tensorflow/models/raw/v1.13.0/samples/languages/java/training/model/graph.pb"
@ -26,6 +26,7 @@ class Libtensorflow < Formula
end end
def install def install
python3 = "python3.11"
optflag = if Hardware::CPU.arm? && OS.mac? optflag = if Hardware::CPU.arm? && OS.mac?
"-mcpu=apple-m1" "-mcpu=apple-m1"
elsif build.bottle? elsif build.bottle?
@ -34,7 +35,7 @@ class Libtensorflow < Formula
"-march=native" "-march=native"
end end
ENV["CC_OPT_FLAGS"] = optflag ENV["CC_OPT_FLAGS"] = optflag
ENV["PYTHON_BIN_PATH"] = which("python3.10") ENV["PYTHON_BIN_PATH"] = which(python3)
ENV["TF_IGNORE_MAX_BAZEL_VERSION"] = "1" ENV["TF_IGNORE_MAX_BAZEL_VERSION"] = "1"
ENV["TF_NEED_JEMALLOC"] = "1" ENV["TF_NEED_JEMALLOC"] = "1"
ENV["TF_NEED_GCP"] = "0" ENV["TF_NEED_GCP"] = "0"
@ -64,7 +65,8 @@ class Libtensorflow < Formula
--verbose_failures --verbose_failures
] ]
if OS.linux? if OS.linux?
env_path = "#{HOMEBREW_PREFIX}/bin:/usr/bin:/bin" pyver = Language::Python.major_minor_version python3
env_path = "#{Formula["python@#{pyver}"].opt_libexec}/bin:#{HOMEBREW_PREFIX}/bin:/usr/bin:/bin"
bazel_args += %W[ bazel_args += %W[
--action_env=PATH=#{env_path} --action_env=PATH=#{env_path}
--host_action_env=PATH=#{env_path} --host_action_env=PATH=#{env_path}