Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#63776 closed defect (fixed)

py39-tensorflow-metal, py39-tensorflow-macos not found on M1 device

Reported by: essandess (Steve Smith) Owned by: essandess (Steve Smith)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: cjones051073 (Chris Jones)
Port: py39-tensorflow-metal, py39-tensorflow-macos

Description

$ port info py-tensorflow-metal
py-tensorflow-metal @0.2.0 (python, lang)
Sub-ports:            py38-tensorflow-metal, py39-tensorflow-metal

Description:          Hardware-accelerated TensorFlow and TensorFlow Addons for
                      macOS 11.0+. Native hardware acceleration is supported on
                      M1 Macs and Intel-based Macs through Apple’s ML Compute
                      framework.
…

$ sudo port install py39-tensorflow-metal
Error: Port py39-tensorflow-metal not found

But py38-tensorflow-metal and py38-tensorflow-macos work just fine.

Change History (6)

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

The portfile says:

if {${build_arch} eq {arm64}} {
    python.versions 38 39
} elseif {${build_arch} eq {x86_64}} {
    python.versions 38
}

Setting python.versions causes the subports to be created.

You should not vary which ports or subports exist based on any criteria. A port should always exist or it should always not exist.

There are separate portindexes for each Darwin OS version and OS arch, so some variation in port existence or attributes is acceptable. However, varying based on $build_arch is not supported. The server that generates the portindexes is x86_64, so any port variations that check $build_arch will be indexed for an x86_64 machine.

Varying based on ${os.arch} is supported, for example:

platform arm {
    python.versions 38 39
}
platform i386 {
    python.versions 38
}

comment:2 Changed 2 years ago by essandess (Steve Smith)

Thanks. How would we hack setting os.arch or tell port that we're on a different platform by hand to be able to download and generate all the checksums on machines of different architectures the next time we have to upgrade?

comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

os.arch should be settable on the command line just as I assume you were setting build_arch on the command line before.

sudo port -d checksum py38-tensorflow-macos os.arch=arm

Also, the port sets:

    supported_archs ${build_arch}

which is weird. It looks like the port supports arm64 and x86_64 so it should set

    supported_archs arm64 x86_64

comment:4 Changed 2 years ago by essandess (Steve Smith)

Thank you for the corrections!

Please see https://github.com/macports/macports-ports/pull/12778.

comment:5 Changed 2 years ago by essandess (Steve Smith)

Owner: set to essandess
Resolution: fixed
Status: newclosed

In d12b1c847d3f5cfc67401595cba239ac84eca0c5/macports-ports (master):

py-tensorflow-metal: Bugfix

comment:6 Changed 2 years ago by essandess (Steve Smith)

In 359f8e68811b40aedfa080e57914956ee02d04f0/macports-ports (master):

py-tensorflow-macos: Bugfix

Note: See TracTickets for help on using tickets.