Skip to content

GudPy on Apple Silicon #462

@rhinoella

Description

@rhinoella
  • Create documentation to illustrate how to get GudPy on Apple Silicon.
  • Change PySide version in requirements.txt to 6.6.0

Here are the steps:

Install Dependencies

We will be using Homebrew as the package manager. Get Homebrew via:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Using Homebrew, install the following dependencies:

brew install cmake
brew install zlib
brew install gsl
brew install libaec
brew install hdf5
brew install xcb-util-keysyms
brew install xcb-util-image
brew install xcd-util-wm
brew install python@3.9
arch -arm64 brew install llvm

Get gcc and create a link:

brew install gcc@11
sudo ln /opt/homebrew/Cellar/gcc@11/11.4.0/lib/gcc/11/libgfortran.5.dylib /usr/local/opt/gcc@11/lib/gcc/11/libgfortran.5.dylib

Install the following dependencies using pip:

pip3 install h5py
pip3 install ruamel-yaml
pip3 install chardet
pip3 install pyside6

Build Dependencies

Clone the following repositories in your home directory:

git clone https://github.com/disorderedmaterials/GudPy
git clone https://github.com/disorderedmaterials/ModEx
git clone https://github.com/disorderedmaterials/Gudrun

ModEx

cd ModEx
mkdir build && cd build

To compile the code, you will have to specify the GSL directories. Replace 2.7.1 with the GSL version being used:

cmake ../ -DLOCAL_STATIC_GSL=ON -DGSL_DIR=/opt/homebrew/Cellar/gsl/2.7.1 - -DCMAKE_OSX_ARCHITECTURES:string"arm64" 
DGSL_INCLUDE_DIR=/opt/homebrew/include/gsl

Build:

cmake --build .
cmake --install . --prefix=$HOME/ModEx

GudRun

cd Gudrun
mkdir build && cd build
cmake ../ -DBUILD_SZIP:bool=true -DCMAKE_OSX_ARCHITECTURES:string"arm64" -DCMAKE_INSTALL_PREFIX:path=pwd/..
make install

Copy and paste the built binary

Building GudPy

Edit requirements.txt file so that PySide version is set to 6.6.0.

cd GudPy
python3 -m install -r requirements.txt
pyside6-rcc gudpy/gui/widgets/resources/resources.qrc > gudpy/gui/widgets/resources/resources_rc.py
# Copy startup files and binaries from Gudrun to GudPy
cp <Gudrun dir>/bin/ <GudPy-dir>/bin
cp -r ../Gudrun/StartupFiles ./bin

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions