Version 4 (modified by toby, 7 months ago) (diff)


Installing GSAS-II on Raspberry Pi (Linux) systems

GSAS-II can be run on 32-bit and 64-bit Raspberry Pi systems running the two most recent versions of the Raspberry Pi OS (formerly called Raspbian), Buster (based on Debian 9, 32-bit only) or Bullseye (based on Debian 10). All required packages for Python are available as part of the OS distribution and no other Python dists have been found that work. The commands below are all entered through the command line by opening a terminal window. Note that the Raspberry Pi Zero 2W computer costs US$15 and the Pi 400 costs US$70 (prices without monitor, power supply, SD card...).

Part 1: Update the OS

All work was done in early January 2022 and was done after updating to the latest software versions (this update may not be required, but is likely a good idea) with these commands:

sudo apt update
sudo apt full-upgrade
sudo apt autoremove

These commands must be run from an account that has sudo access (such as the initial pi user account.) The full-upgrade command may take a while to complete (10-60+ minutes), depending on internet download speeds and the Pi model.

Part 2: Install required software

The subversion package is required to install and update GSAS-II and a number of Python packages are also required. Enter these commands to do that:

sudo apt install subversion 
sudo apt install python3-wxgtk4.0 python3-numpy python3-scipy python3-matplotlib python3-opengl python3-pil python3-h5py python3-imageio

These commands must also be run from an account that has sudo access. These commands complete pretty quickly usually (a few minutes). Note that the second command above is fairly long and can be broken into several shorter commands if desired, replacing that line with this:

sudo apt install python3-wxgtk4.0 python3-numpy python3-scipy 
sudo apt install python3-matplotlib python3-opengl 
sudo apt install python3-pil python3-h5py python3-imageio

Part 3: Install GSAS-II

These commands download GSAS-II, obtain the correct binary files from the three sets of files compiled for the Pi. Two shortcuts for starting GSAS-II are created. A Desktop icon and an entry in the "Other" category of the system menu (upper left on taskbar with default layout). These commands will be needed from the account where the software will be run and do not require sudo access.

mkdir GSASII
svn export .

Note that the software can be installed anywhere that is desired, so the location "GSASII" in the first two commands can be replaced with anything you want, such as "~/software/G2". In this way more than one version of GSAS-II can be installed, but note that the desktop/menu shortcuts must be duplicated with new file names as a second installation will replace the first copies of those files.

After the python3 command is entered, the installation script will ask for a proxy address, at most locations, this is not needed (network proxy info here), so no input is needed before enter is pressed to start the installation. The GSAS-II files are then downloaded and then the binary files are downloaded. This goes pretty quick as the download is fairly small.

If the installation is successful, a new GSAS-II icon will appear on the desktop. If not an error message should be displayed. If this occurs, you may want to get in touch with Brian.


When one double-clicks on the GSAS-II desktop icon, a message saying “This text file ‘GSAS-II’ seems to be an executable script. What do you want to do with it?” One can then click on Execute and the program starts in a new Window. To avoid this step, it is possible to turn off this message for all desktop icons in the file manager preferences. To do this, find the File Manager launcher in the system menu in the Accessories section. Then once the File manager is open, use menus Edit->Preferences command. Then in the General panel, check the “Don’t ask options on launch executable file” and press Close (see info here).

Timing Notes

Results from tests with a pretty massive (MacGovernite) test refinement. Raspberry Pi OS is 32 bit, except as noted.

System OS timing
Pi Zero 0 W Buster 1353 sec
Pi 3 B+ Bullseye 1408 sec
Pi 400 Buster 476 sec
Pi 400 Bullseye 644 sec
Pi 400 Bullseye, 64-bit 496 sec
Intel Mac Pro (2020) MacOS 10.15.7 118 sec
M1 Mac Pro (2021) MacOS 11.6.2 58 sec


pi@raspberrypi:~ $ cp G2timing.gpx /tmp/
pi@raspberrypi:~ $ cd /tmp
pi@raspberrypi:/tmp $ python3 ~/GSASII/ G2timing.gpx 

Developer Notes

Build commands

These are unlikely to be needed by anyone other than a software developer, unless you really like to compile all the code you use. If so, use command scons rather than the scons install=T step below and skip all the svn commands.

Required tools in addition to steps 2 & 3:

sudo apt install gfortran
sudo apt install scons 

Not needed, but useful if any debugging will be needed:

sudo apt install xemacs21
sudo apt install ipython3

Set the working directory to where GSAS-II has been installed


Download all binaries (to make the upload easier later) and then compile.

svn switch AllBinaries --ignore-ancestry
cd fsource
scons install=T

This will create a new directory ../AllBinaries/linux_armXX_p3.Y_n1.Z/ where XX is 32 or 64 and Y and Z are determined from the Python and numpy versions if it does not exist. Otherwise the files will be updated. Note that you may want to add comments to file ../AllBinaries/linux_armXX_p3.Y_n1.Z/Build.notes.txt before performing the next step.

Assuming a new directory is created, include that to be tracked by svn add the new files to the repository

svn add ../AllBinaries/linux_armXX_p3.Y_n1.Z/
svn add ../AllBinaries/linux_armXX_p3.Y_n1.Z/*.so

Either way, upload the ne files:

svn ci -m"<explanatory note>"

OS notes

For Buster I used a SD card provided by PiShop.US updated as noted above.

For 32-bit bullseye I downloaded the zipped SD image from web page (file

For 64-bit bullseye I downloaded the zipped SD image from directory (file

To create the SD use these steps on Mac (also see this):

  • In disk utility, format as MS-DOS (FAT) with Master Boot Record (may not be needed)
  • use commands:
    • diskutil list to find sd card mount point (disk4)
    • sudo diskutil unmountDisk /dev/disk4 this dismounts the disk, but keeps it attached
    • unzip -p /tmp/ | sudo dd bs=1m of=/dev/rdisk4 copies the image to the SD card.
  • When done the SD card is remounted as a disk
  • Use touch /Volumes/boot/ssh to enable an ssh connection to the system
  • Eject the "disk", for example in disk utility