1.1.7. macOS: The App-based system setup

Welcome to the Jungle [1]

The following is a set of scripts packaged as an app. It is designed to automate the AFNI installation steps. You should launch the script by double clicking the icon like a regular program.

This app will download and install the recommended versions of the following:
  1. Xcode command line tools
  2. Xquartz
  3. R
  4. AFNI

If a package is already installed, you may be asked if you want to reinstall it. But you can skip it if you like. This script will also setup your ~/.cshrc, ~/.bashrc, and ~/.bash_profile. It will add the appropriate entries to your paths specified there. After completion, you should restart your computer just in case.

This is a BETA script, so your feedback is welcome. We have tested the app on 10.10 to 10.13 with various hardware.

If you are seeking the non-App version of install instructions, please see HERE.

Break It Down Again [3]

  • Download the file and open it to extract or mount.

  • Read the README!!

  • Double click the “afni_macOS_install_10.7_BETA” or “afni_macOS_install_10.12_BETA” icon.

  • You may get a popup notification about an “unidentified developer”.

    If so, you can continue by:
  • This will launch your terminal.

    Most of the rest of the interactions are in the terminal. If needed, the Xcode command line tools will popup an installation window. Once complete, return to the terminal to continue.

  • To accept the default options (shown in [ ]), just press Enter.

    For some sections, you may need to type in your password. If you are not an administrator on your computer, this installation may fail. Make sure you have permissions for the folder you choose for AFNI! The sudo prompt will time out after awhile, so this is not an unattended install.

  • This script does not install fink. Nor does it download the class data.


The icon is a work in progress. If you have some design skills, please send me alternatives.

Install Netpbm

  1. Copy+paste:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
  2. Copy+paste:

    brew install netpbm
  3. Copy+paste:


Purpose: Install “netpbm”, which has functionality for converting image formats (such as to PNG) and is used in several programs like @snapshot_volreg, @chauffeur_afni and others.

Prepare for Bootcamp

  1. Copy+paste:

    curl -O https://afni.nimh.nih.gov/pub/dist/edu/data/CD.tgz
    tar xvzf CD.tgz
    cd CD
    tcsh s2.cp.files . ~
    cd ..

    Purpose: Download the Bootcamp class data; untar+unzip it (= open it up); move into the newly opened directory; execute a script to copy the files to $HOME/..

    If no errors occur in the above, and your afni_system_check.py says things are OK, you can delete/remove the tarred/zipped package, using “rm CD.tgz”. If you are really confident, you can also deleted the CD/ directory in the present location.

  2. Read+practice with the handy Unix documentation/tutorial.

    Purpose: give you a quick lesson/refresher on using basic Linux shell commands (e.g., ls, cd, less, etc.). It will greatly enhance your bootcamp experience– we promise!

  3. Pro tip: If you will be attending a Bootcamp, you might want to bring a mouse to use with your laptop. It will be easier to follow the demos using a mouse than a trackpad.

Evaluate setup/system (important!)

  1. Copy+paste:

    afni_system_check.py -check_all
  2. Read the “Please Fix” section at the end. If there are no suggestions, then rejoice! Otherwise, try the suggestion(s) there.

  3. Open up the AFNI and SUMA GUIs, juuuust to make sure all is well:


    Report any crashes!

  4. If stuck, then …

    • … put any error message into an online search, and/or post a question on the Message Board

    • … copy+paste this:

      afni_system_check.py -check_all > out.afni_system_check.txt

      … and email the file “out.afni_system_check.txt” to an AFNI Guru for advice.

Niceify terminal (optional, but goood)

To improve your life when using the terminal, copy+paste these:

echo 'set filec'    >> ~/.cshrc
echo 'set autolist' >> ~/.cshrc
echo 'set nobeep'   >> ~/.cshrc

echo 'alias ls ls -G'    >> ~/.cshrc
echo 'alias ll ls -lG'   >> ~/.cshrc
echo 'alias ls="ls -G"'  >> ~/.bashrc
echo 'alias ll="ls -lG"' >> ~/.bashrc

Purpose: The first commands set up tab autocompletion for tcsh (which should already be enabled for bash users by default). The second set of commands make aliases so that different types of files (“normal” files, zipped files, executables, et al.) and directories are shown using different colors and boldness. It makes it much easier to navigate on a terminal, IMHO.

Keep up-to-date (remember!)

  1. To update your AFNI sometime, copy+paste:

    @update.afni.binaries -d

    That’s it!!

    Purpose: This will automatically download the correct, latest AFNI version to your computer, replacing your old binaries. It will also update the apearch help information. Update often!

  2. To check your AFNI version, copy+paste:

    afni -ver

    Purpose: Report this useful info whenever asking a question on the Message Board!


The record of all changes (new options, new programs, bug fixes, et al.) in AFNI programs is maintained for all to see in the online AFNI History.


[1]Guns N’ Roses
[2]Steve Miller Band
[3]Tears for Fears