1.1.3. Complete system setup for: (modern) Mac OSΒΆ

Here we describe a complete AFNI installation and system setup for Mac versions that are reasonably modern, such as Mac OS 10.7+. The full set of steps applies to a “clean” (i.e., empty) 10.7+ system. There is a special step at the end for 10.11 (El Capitan) users, because life is hard sometimes.

Note that 10.8 does not come with X11 (or XQuartz) installed. When afni is started for the first time, you should be directed (by the operating system) to a link to install XQuartz.

  1. Account setup

    Assuming a user account exists, these steps are all optional:

    1. Create a user account with su (Administrator) privileges (via “System Preferences”, under “Accounts”).

      Note

      Admin privileges are needed for package management.

    2. (optional) Set the shell to /bin/tcsh. This no longer works using the chsh ... command.

      Under System Preferences : System : Accounts menu, right-click on the user to get the Advanced Options menu and change the Login shell to /bin/tcsh.

    3. (optional) Under System Preferences : Sharing : Services, enable “Remote Login” to allow ssh access.

    4. Set the policy where “focus follows mouse”, so that it is not necessary to first click on a new window (to select it) before subsequent clicks are applied to that window. There are 3 applications that this might apply to, so we make sure...

      From a terminal window, enter:

      defaults write org.macosforge.xquartz.X11 wm_ffm -bool true
      defaults write org.x.X11 wm_ffm -bool true
      defaults write com.apple.Terminal FocusFollowsMouse -string YES
      

  2. Xcode and XQuartz installation

    Xcode is needed for the gcc compiler and related tools. XQuartz is the desktop manager needed to run X11 programs (such as afni).

    For OS X 10.9 and later, simply run the 2 commands:

    xcode-select --install
    /Applications/Utilities/X11.app
    

    Otherwise (for OS X versions up through 10.8), it is best to start with the most recent version from the Apple website:

    1. Go to http://developer.apple.com
      • Sign up for a login account (necessary for downloading)
      • Sign up via “Register as an Apple Developer” (it is free)
    2. Get the current “Command Line Tools” package (part of Developer Tools) and install
      • current version is 4.6.2
      • installation defaults are good, to complete installation

  3. Homebrew installation

    At this point, we will install the package manager Homebrew:

    1. Install HomeBrew and Python

      Run this command to run the Homebrew installation script, choosing one of these shell syntaxes:

      • for tcsh:

        curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install | ruby
        
      • for bash:

        ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
        
    2. Make sure the Homebrew installation succeeded with no errors by typing this command:

      brew doctor
      
    3. Install PyQt4, enabling use of the AFNI uber_*.py programs:

      brew install pyqt
      
    4. (only for OS X 10.11, El Capitan) Install gcc with OpenMP support, along with glib:

      brew install gcc --with-all-languages --without-multilib
      ln -s /usr/local/Cellar/gcc/5.3.0/lib/gcc/5/libgomp.1.dylib /usr/local/lib/libgomp.1.dylib
      brew install glib
      
  4. AFNI installation

    1. Download and unpack the current binaries into your $HOME directory, changing the directory name to $HOME/abin/:

      cd
      curl -O https://afni.nimh.nih.gov/pub/dist/bin/macosx_10.7_Intel_64/@update.afni.binaries
      tcsh @update.afni.binaries -defaults
      
    2. Update the path and library path.

      Note

      DYLD_FALLBACK_LIBRARY_PATH does not apply to OS X 10.11, El Capitan

      • for tcsh ($PATH in ~/.cshrc was set by @update.afni.binaries):

        echo 'setenv DYLD_FALLBACK_LIBRARY_PATH $HOME/abin' >> ~/.cshrc
        echo 'setenv PYTHONPATH /usr/local/lib/python2.7/site-packages' >> ~/.cshrc
        source ~/.cshrc
        rehash
        
      • for bash:

        echo 'export PATH=/usr/local/bin:$PATH:$HOME/abin' >> ~/.bashrc
        echo 'export DYLD_FALLBACK_LIBRARY_PATH=$HOME/abin' >> ~/.bashrc
        echo 'export PYTHONPATH=/usr/local/lib/python2.7/site-packages' >> ~/.bashrc
        . ~/.bashrc
        
  5. Quick AFNI verification

    1. Try it out! If these start, you should be in good shape:

      afni
      suma
      uber_subject.py
      

      Note

      For 10.8 users, when prompted, follow the instructions to install XQuartz.

  6. R installation

    1. Download and install from the main R website:

    2. Install extra packages needed by AFNI.

      Run the following AFNI command:

      sudo rPkgsInstall -pkgs ALL
      
  7. EVALUATE THE SETUP: an important and useful step in this process!

    1. There is a very useful script to check on your installed AFNI and lots of its dependencies, such as looking for the installed R libraries, profiles, Python stuff, etc. You can run it

      • outputting to the screen:

        afni_system_check.py -check_all
        
      • outputting to a text file:

        afni_system_check.py -check_all > out.afni_system_check.txt
        

      which might be useful to email to your local AFNI Guru if there are any problems.

    2. So, at this point, if your “system check” doesn’t really give any errors, you’re all set to go. If it did give some errors, please:


  8. Setting up autoprompts for command line options.

    The following is quite useful to be set up help files for tab-autocompletion of options as you type AFNI commands. Run this command:

    apsearch -update_all_afni_help
    

    and then follow the brief instructions.

  9. Keeping up-to-date.

    From this point onward, you can easily keep your AFNI uptodate just by running a single command:

    @update.afni.binaries -d
    

    That’s it!! It will automatically download the correct latest version to your computer, replacing your old binaries. You can always check your version by typing:

    afni -ver
    

    (And you should always check and report your version if you have questions/comments/etc.)

  10. (optional) Prepare for an AFNI Bootcamp.

    Warning

    If you are preparing for an AFNI Bootcamp, then please see the Bootcamp prep instructions on downloading the class data. And have a nice day.