wiki:MacM1Notes

Version 2 (modified by toby, 5 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 11.2.3.

As of right now (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:

  1. Install command line tools. Use command:
    xcode-select --install
    
  2. Log into a admin account (I used su admin in a terminal)
  3. Install homebrew using command:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  4. 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

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 (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