coin-or / pulp

A python Linear Programming API
http://coin-or.github.io/pulp/
Other
2.1k stars 384 forks source link

Fix detection of osx-arm64 #766

Closed peterjc closed 2 months ago

peterjc commented 2 months ago

Currently the code assumes all Darwin aka osx aka maxOS machines are Intel 64 bit. With this change pulp will no look for a solver at pulp/solverdir/cbc/osx/arm64/cbc and works correctly on an Apple M3 ARM CPU.

This was tested with the pre-compiled binary extracted from Cbc-arm64-macos14-gcc1330.tar.gz at https://github.com/coin-or/Cbc/actions/runs/10332640644 at the suggestion of one of the cbc maintainers, @tkralphs in conversation on a linked issue here: https://github.com/conda-forge/pulp-feedstock/issues/27#issuecomment-2285782785

$ md5 pulp/solverdir/cbc/osx/arm64/cbc
MD5 (pulp/solverdir/cbc/osx/arm64/cbc) = 6b4b1b8849cac7ed5574166f6a8586d8
$ shasum -a 256 pulp/solverdir/cbc/osx/arm64/cbc
6e3cfc1d1bd5294d61279fb52dd21590653a4da2eb0472b651577ec860f699bb  pulp/solverdir/cbc/osx/arm64/cbc

I am happy to add that exact binary cbc to this pull request which was built from https://github.com/coin-or/Cbc/commit/50c612fe9ce5c31f4b0be9dde4cc0b8f7d6e018b (master branch 10 August) which I presume is 2.10.11 plus work since. There have been a couple of newer builds since - I don' know when the next release is planned.

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.

peterjc commented 2 months ago

Cross reference #765

tkralphs commented 2 months ago

To be clear, the master branch has diverged from stable/2.10. Stable version 2.10 is still being patched and there are releases being made on an ad hoc basis. The master branch will hopefully become stable version 3.0 someday, but developer bandwidth is limited. With all that said, there should be no compatibility issues for PuLP, since the command-line interface is the same, only the build system, the API, and the internal structure of the code has changed.

Nevertheless, it is probably better if all platforms use the same version of Cbc and there hasn't been a release of the 2.10 series since arm64 support was added to the release workflow. I can try to get a new release out and then there will be a 2.10.12 binary for arm64 on OSX.

peterjc commented 2 months ago

As an end user (via snakemake), having pulp updated to use pre-compiled cbc 2.10.12 release binaries (including osx-arm64) does sound best.

peterjc commented 2 months ago

Not convinced the CLA is needed for this one line change, but signed now.

peterjc commented 2 months ago

Thanks