You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
148 lines
5.0 KiB
Tcl
148 lines
5.0 KiB
Tcl
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
|
|
|
PortSystem 1.0
|
|
PortGroup python 1.0
|
|
PortGroup github 1.0
|
|
PortGroup compilers 1.0
|
|
|
|
name py-tensorflow
|
|
version 2.12.0
|
|
revision 0
|
|
github.setup tensorflow tensorflow ${version} v
|
|
# Change github.tarball_from to 'releases' or 'archive' next update
|
|
github.tarball_from tarball
|
|
|
|
license Apache-2
|
|
maintainers {emcrisostomo @emcrisostomo} openmaintainer
|
|
# Goal is darwin >= 18, but present failures prevent that for macOS 11.x+
|
|
platforms {darwin >= 18 <= 19}
|
|
supported_archs x86_64 arm64
|
|
|
|
description TensorFlow helps the tensors flow
|
|
long_description {*}${description}
|
|
homepage https://www.tensorflow.org/
|
|
|
|
known_fail yes
|
|
pre-fetch {
|
|
ui_error "${subport}: This port is presently broken on all macOS platforms"
|
|
return -code error "port broken"
|
|
}
|
|
|
|
github.livecheck.regex {([0-9.]+)}
|
|
|
|
checksums rmd160 26051c2456224f94f82e896aff4cb8512c2f6dc3 \
|
|
sha256 2b1725eccba5ee42347462f5a65b274a905f7946181fadafc7b44b5c85ba3041 \
|
|
size 69709103
|
|
|
|
use_xcode yes
|
|
|
|
compiler.cxx_standard 2017
|
|
compiler.blacklist-append {clang < 1000} {macports-clang-[4-9].0}
|
|
|
|
# Supported python versions
|
|
python.versions 39 310
|
|
|
|
if {${name} ne ${subport}} {
|
|
PortGroup bazel 1.0
|
|
|
|
# TF versions 1 and 2 cannot be installed at once
|
|
if { ${python.version} < 310 } {
|
|
conflicts py${python.version}-tensorflow1
|
|
}
|
|
|
|
# Conflicts with tensorflow-macos, tensorflow-metal
|
|
conflicts-append \
|
|
py${python.version}-tensorflow-macos \
|
|
py${python.version}-tensorflow-metal
|
|
|
|
# Relax Xcode minimum version, based on testing
|
|
bazel.min_xcode 10.3
|
|
|
|
variant mkl description {Enable Intel Math Kernel Library support} {
|
|
bazel.extra_build_opts-append --config=mkl
|
|
depends_lib-append port:py${python.version}-mkl
|
|
}
|
|
# Enable MKL by default on 10.15 and newer.
|
|
#if {${os.major} >= 19} {
|
|
# default_variants-append +mkl
|
|
#}
|
|
|
|
depends_build-append \
|
|
port:cctools \
|
|
port:ld64 \
|
|
port:py${python.version}-future \
|
|
port:py${python.version}-mock \
|
|
port:py${python.version}-pip
|
|
|
|
depends_lib-append \
|
|
port:py${python.version}-absl \
|
|
port:py${python.version}-astor \
|
|
port:py${python.version}-astunparse \
|
|
port:py${python.version}-flatbuffers \
|
|
port:py${python.version}-gast \
|
|
port:py${python.version}-google-pasta \
|
|
port:py${python.version}-grpcio \
|
|
port:py${python.version}-keras \
|
|
port:py${python.version}-numpy \
|
|
port:py${python.version}-opt_einsum \
|
|
port:py${python.version}-protobuf3 \
|
|
port:py${python.version}-six \
|
|
port:py${python.version}-tensorboard \
|
|
port:py${python.version}-tensorflow_estimator \
|
|
port:py${python.version}-termcolor \
|
|
port:py${python.version}-wheel \
|
|
port:py${python.version}-wrapt
|
|
|
|
use_configure yes
|
|
|
|
# Options passed to configure script via env vars
|
|
bazel::add_to_envs PYTHON_LIB_PATH=${python.prefix}/lib/python${python.branch}/site-packages
|
|
bazel::add_to_envs PYTHON_BIN_PATH=${prefix}/bin/python${python.branch}
|
|
|
|
# Use correct python in bazel build
|
|
bazel.python_version ${python.branch}
|
|
|
|
bazel.build_target "//tensorflow/tools/pip_package:build_pip_package"
|
|
bazel.post_build_cmd ./bazel-bin/tensorflow/tools/pip_package/build_pip_package [list $workpath]
|
|
# add -fuse-ld becase https://github.com/tensorflow/tensorflow/issues/58368
|
|
bazel.extra_build_opts-append \
|
|
--config=opt \
|
|
--linkopt="-fuse-ld=/usr/bin/ld"
|
|
|
|
bazel.limit_build_jobs no
|
|
|
|
# Overstep:
|
|
# target '@tf_runtime//:support' is not visible from target '//tensorflow/compiler/xla/pjrt:pjrt_future'
|
|
# See: https://github.com/tensorflow/tensorflow/issues/58825
|
|
bazel.extra_build_opts-append \
|
|
--noincompatible_fix_package_group_reporoot_syntax \
|
|
--noincompatible_validate_top_level_header_inclusions
|
|
|
|
destroot.cmd pip-${python.branch}
|
|
destroot.args \
|
|
--ignore-installed \
|
|
--no-cache-dir \
|
|
--no-dependencies \
|
|
--root ${destroot} \
|
|
${workpath}/tensorflow-*.whl
|
|
destroot.post_args
|
|
|
|
post-destroot {
|
|
file delete ${destroot}${python.prefix}/bin/tensorboard
|
|
file delete ${destroot}${prefix}/bin/tensorboard-${python.branch}
|
|
}
|
|
|
|
livecheck.type none
|
|
|
|
# If tensorflow-macos is available for this OS advertise it
|
|
if { ${os.major} > 19 } {
|
|
notes-append "
|
|
* A hardware accelerated MacOS optimised port of tensorflow from Apple\
|
|
is available as an alternative to ${subport}. To use run:
|
|
sudo port uninstall -f ${subport} ${subport}-addons
|
|
sudo port install ${subport}-macos
|
|
"
|
|
}
|
|
|
|
}
|