Version 3 (modified by toby, 19 months ago) (diff) |
---|
Installing a Native "Apple Silicon" GSAS-II Version on MacOS
After something like 4 months of occasional trial and much error, I was finally able to get GSAS-II to run on a ARM Mac running MacOS 11.2.3.
As I write this (6/24/21), Anaconda is not supporting ARM Macs and the wxpython version of miniforge is broken, so I had to install Python and associated packages with homebrew.
Installing Homebrew
See this page. Note that access to a Admin level account is a requirement for this. Use these steps:
- Install command line tools. Use command:
xcode-select --install
- Log into a admin account (I used su admin in a terminal running as a standard user)
- Install homebrew using command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- To add brew to path, use command:
eval "$(/opt/homebrew/bin/brew shellenv)"
Install stuff with brew
Brew is used to install a bunch of things. Here are the commands I used:
brew install svn brew install python brew install scipy brew install wxpython
Install more stuff with pip
python3 -m pip install -U matplotlib python3 -m pip install -U pyopengl
Install GSAS-II
These steps are best done from a user account rather than an admin account. You can log out of the admin account or simply close the terminal window used before and open a new one.
eval "$(/opt/homebrew/bin/brew shellenv)" mkdir ~/GSASII cd ~/GSASII curl https://subversion.xray.aps.anl.gov/pyGSAS/install/bootstrap.py -o bootstrap.py python3 bootstrap.py
Compiling GSAS-II fortran routines
You probably do not need this. There is now a set of M1 (aka ARM, aka Apple Silicon) binaries in
This was fairly hard and I don't know what steps were required in retrospect. Also, it might have been better to use brew install gfortran scons rather than using miniforge to install gfortran. (I downloaded https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh from Miniforge3-MacOSX-arm64 link on https://github.com/conda-forge/miniforge
bash ~/Downloads/Miniforge3-MacOSX-arm64.sh source /Users/toby/miniforge3/bin/activate conda create -n buildg10.2 gfortran=10.2 gfortran_impl_osx-arm64=10.2 scons numpy
I installed all of Xcode to get file headers, but that may not have been needed. I had a lot of problems getting gcc to find them, but that should now be changed in Sconstruct
Speed Benchmarks
These comparisons are for two very different powder refinement cycles with a 2.3 Mh quadcore I7 MacBook Pro (early 2020) with a M1 MacBook Pro (late 2020); Both have 16 Gb.
Intel I7 | Apple M1 | I7:M1 ratio |
---|---|---|
4 cores | 4 performance | |
& 4 efficiency | ||
6.99 s | 3.85 s | 1.82 |
106.9 s | 57.34 | 1.86 |