# -*- 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 name py-tensorflow-metal version 0.7.1 revision 0 categories-append lang license MIT maintainers nomaintainer supported_archs arm64 x86_64 description TensorFlow acceleration for Mac GPUs. long_description Hardware-accelerated TensorFlow and TensorFlow \ Addons for macOS 12.0+. Native hardware \ acceleration is supported on M1 Macs and \ Intel-based Macs through Appleā€™s ML Compute \ framework. homepage https://developer.apple.com/metal/tensorflow-plugin/ extract.suffix .whl extract.only # set build_arch by hand on arm64/x86_64 systems to get x86_64/arm64 checksums # sudo port -d checksum py310-tensorflow-metal os.arch=arm build_arch=arm64 # run `port clean --all py*-tensorflow-metal` afterwards python.versions 39 310 python.pep517 yes python.pep517_backend set minimum_supported_major_version 21 if {${os.arch} ni [list arm i386] || ${os.platform} eq {darwin} && ${os.major} < ${minimum_supported_major_version}} { known_fail yes pre-fetch { ui_error "TensorFlow with ML Compute acceleration is only available \ on macOS [expr ${minimum_supported_major_version} - 9] and later \ with [join ${supported_archs} " or "] architectures." error {unsupported platform} } } if {${name} ne ${subport}} { # https://pypi.org/project/tensorflow-metal/#files if {${build_arch} eq {arm64}} { if {${python.version} eq 310} { master_sites \ https://files.pythonhosted.org/packages/e6/07/5f4ab135894225884e88bef51c93e64e0958dbacf7811bb3dcaee270fe90/ checksums \ rmd160 46888ae57d8409d3507054b61508538c321ada5b \ sha256 ebd433d54c78eff6d98df99e6f3c9ad8c81bd6c015a822904a2cbfdc74b59ce1 \ size 1390870 } elseif {${python.version} eq 39} { master_sites \ https://files.pythonhosted.org/packages/cf/4d/c39ef716346feaa7452b9ef033b29485f8f55de4f970bcdcc77ffc1a1cb1/ checksums \ rmd160 5533c4fb6171bebe65334ee063c6019168010166 \ sha256 c91f7957e76f2d24f3ecd7e8ddc62c917ded5489ef954c3aa174a8516d5c655d \ size 1390867 } elseif {${python.version} eq 38} { master_sites \ https://files.pythonhosted.org/packages/38/70/251e74f3ebc6240764871311dcda326482da281877f4dca6ed169d5920c6/ checksums \ rmd160 b64e4dd33d5c2bc2335a7e9e724b6b27207e5b1d \ sha256 a6a5d02714602d5c7096a33b9a5f28f92a135b6861b5646504fed3e40de27bb5 \ size 1391555 } } elseif {${build_arch} eq {x86_64}} { if {${python.version} eq 310} { master_sites \ https://files.pythonhosted.org/packages/b6/f1/796a6a9996f481c1b753087bae5e09fc2872c625f03778cd7d8fe9ace836/ checksums \ rmd160 6084f5451ad54bfd6dc98b470aa40489ed8b76fc \ sha256 6206a34065146ec242965161b8f90ddfc32d47024c138c58f5796591f7c61f47 \ size 1534998 } elseif {${python.version} eq 39} { master_sites \ https://files.pythonhosted.org/packages/3e/26/9d5ad7ff877fe0e006529d3860f78c9c2a848cd47dca54dfaacd011b1959/ checksums \ rmd160 82b073a9301f6902d270881548f9e6a4f545edae \ sha256 bfcb63e4688937d02fc0bf82f6384f1ee1dd922e1dd38fd3467abd922dfae958 \ size 1534996 } elseif {${python.version} eq 38} { master_sites \ https://files.pythonhosted.org/packages/17/b3/205c462b72de64457f74bd951ae81a21c44badd4c04aabe56b2b282f73a5/ checksums \ rmd160 8d3cb4f08813cf49f22bcc3758836cea90a858cd \ sha256 0e250e34a971a9e243e63366f9fdb21b28049b52561f4f219a60439c831ef945 \ size 1535683 } } distname tensorflow_metal-${version}-cp${python.version}-cp${python.version}-macosx_12_0_${build_arch} depends_run-append \ port:py${python.version}-tensorflow-macos build {} destroot.target ${distpath}/${distfiles} livecheck.type none }