Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate python wheels compatible with Mac Apple Silicon M1/M2 #56

Open
fteicht opened this issue Dec 2, 2023 · 2 comments
Open

Generate python wheels compatible with Mac Apple Silicon M1/M2 #56

fteicht opened this issue Dec 2, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@fteicht
Copy link
Member

fteicht commented Dec 2, 2023

Mac Apple Silicon M1/M2 processors equip by default the Mac Book computers since 2020. Those processors use the ARM64 architecture for which the default Python interpreter is compiled.

Therefore, up-tamer can only be used on those new Mac computers through Rosetta2 and x86 Python interpreters, which:

  1. does not allow the user to benefit from the ARM64 computational power
  2. requires the user to install an x86 homebrew and Python interpreter.

Since the ARM64 architecture is the default one on all the Mac Book computers assembled since 2020, it would be nice to provide Python wheels for the ARM64 architecture.

@fteicht fteicht added the enhancement New feature or request label Dec 2, 2023
@fteicht
Copy link
Member Author

fteicht commented Dec 2, 2023

The issue seems to originate in the fact that TAMER itself is not built for ARM64.
At least ARM64 binaries are not provided in the TAMER website.
If the code of TAMER is accessible somewhere, I'll be happy to try to build it on my Mac Book Pro equipped with a Mac Apple Silicon M2 processor.

@LamannaLeonardo
Copy link

For those still facing this issue, I describe how I installed up-tamer on a mac with an ARM architecture (M1 cpu) through an x86 python interpreter and homebrew for Rosetta2.

  1. Create an x86 python environment (e.g. with conda)
    conda create -n myenv -y
    conda activate myenv
    conda config --env --set subdir osx-64
    conda install python=3.10 -y

  2. Install the unified planning library with tamer
    pip install 'unified-planning[tamer]'

  3. Tamer might not be runnable and listed in the available unified-planning engines. I think this can be because it requires the gmp package to be installed for an x86 architecture. To do this on an M1 architecture you can download homebrew for Rosetta2
    arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

  4. Install gmp through homebrew for Rosetta2, e.g.
    /opt/homebrew/bin/brew install gmp

Tamer should be now runnable and correctly listed in the engines list of the unified planning library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants