dimod icon indicating copy to clipboard operation
dimod copied to clipboard

Could You Support arm architecture?

Open 29rou opened this issue 4 years ago • 7 comments

Application

Support arm architecture.

Proposed Solution cibuildwheel allows you to do that.

29rou avatar Jul 01 '21 09:07 29rou

Hi @29rou, thanks for contributing the issue and the PR.

We have already looked into shipping arm64 wheels (see this issue on Ocean SDK repo: https://github.com/dwavesystems/dwave-ocean-sdk/issues/126), and we looked at using cibuildwheel.

However, at the time it seemed better to wait for CircleCI to support custom docker images on arm64 than using the emulator, and to wait for cibuildwheel to support Windows on CircleCI. We might revisit that decision over time, as significance of arm64 wheels grows.

Currently, switching to GitHub Actions for CI (partially or fully) is not an attractive option.

randomir avatar Jul 01 '21 12:07 randomir

I understand. I'm sorry for the trouble I've caused you. By the way, is it possible to support Apple Silicon and universal2? https://github.com/pypa/cibuildwheel/blob/b552fbd016bf1394c6b7de96d5bf98dde5b17730/cibuildwheel/macos.py#L277 Also, would it be possible to support an arm binary build without using Docker? For example, https://github.com/dockcross/dockcross .

29rou avatar Jul 02 '21 00:07 29rou

Thank you @29rou, these are great finds. We'll look into them. Unless you'd like to? Great first step would be enabling universal builds for macos, similar to how cibuildwheel does it (but consistent with our CircleCI workflow). We would love to see that PR :wink:

randomir avatar Jul 02 '21 15:07 randomir

Thanks, cibuildwheel's behavior on MacOS is not to use Docker. Therefore, I think it is safe to use cibuildwheel directly. https://cibuildwheel.readthedocs.io/en/stable/setup/#circleci

29rou avatar Jul 05 '21 02:07 29rou

Of course, I would also like to investigate linux/arm64 cross-compilation and suggest it to you.

29rou avatar Jul 05 '21 02:07 29rou

Could You use this code? https://github.com/pypa/cibuildwheel/blob/9ce9574d4e6fce57daeb398479d39e3a388945e1/cibuildwheel/macos.py#L281

29rou avatar Oct 07 '21 01:10 29rou

On Mac, It would work well. And, Dimod would be builded by Xcode for M1 Mac.

export _PYTHON_HOST_PLATFORM=macosx-11.0-arm64
export ARCHFLAGS=-arch arm64
pip wheel .

29rou avatar Oct 07 '21 01:10 29rou

Done in https://github.com/dwavesystems/dimod/pull/1290.

randomir avatar Apr 24 '24 09:04 randomir