Skip to content

Instantly share code, notes, and snippets.

@paulgribble
Created November 3, 2013 15:30
Show Gist options
  • Save paulgribble/7291469 to your computer and use it in GitHub Desktop.
Save paulgribble/7291469 to your computer and use it in GitHub Desktop.
getting afni working on mac osx 10.9 mavericks with home-brew
Getting afni working on Mac OSX 10.9 Mavericks, using Homebrew
Briefly: parts of afni (e.g. uber_subject.py) require the pyqt library ... and pyqt requires qt ... but the homebrew install of qt is currently broken on osx mavericks 10.9 ... but there is a patch ... but pyqt also requires sip ... and there is a problem where pyqt doesn't like the version of sip, in particular with a newer haswell CPU macbook pro ... but there is a fix ... and we need to add lines to our .bash_profile for afni ... and be careful if you have other python things installed since afni expects to find python things in certain locations
Here is a step-by-step:
1. install Xcode command line tools
xcode-select --install
2. install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
3. install Qt4 using Cliff Rowley's patch (https://github.com/mxcl/homebrew/pull/23793)
* note this could take a while, and your CPU fans will go nuts
brew install https://raw.github.com/cliffrowley/homebrew/patched_qt/Library/Formula/qt.rb --HEAD
4. install sip
brew install sip
5. before installing pyqt, bypass the stdlib dependency tracking, see 2 links below for details
(this may only apply to you if you have a newer macbook pro with a haswell cpu)
https://github.com/mxcl/homebrew/issues/23687#issuecomment-27339429
https://github.com/mxcl/homebrew/blob/master/Library/Homebrew/build.rb#L174
- comment out line 174 in /usr/local/Library/Homebrew/build.rb:
# stdlib_in_use = CxxStdlib.new(stdlibs.first, ENV.compiler)
6. install pyqt
brew install pyqt
7. un-comment line 174 in /usr/local/Library/Homebrew/build.rb:
stdlib_in_use = CxxStdlib.new(stdlibs.first, ENV.compiler)
8. install wget so we can download stuff from the interwebs using the command line
brew install wget
9. download and install XQuartz (to provide X11)
wget http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.4.dmg -P ~/Downloads/
open ~/Downloads/XQuartz-2.7.4.dmg
open /Volumes/XQuartz-2.7.4/XQuartz.pkg
and follow the GUI instructions for install
then unmount and delete the installer
umount /Volumes/XQuartz-2.7.4/
rm -fr ~/Downloads/XQuartz-2.7.4.dmg
9. download afni to your ~/Downloads folder
wget http://afni.nimh.nih.gov/pub/dist/tgz/macosx_10.7_Intel_64.tgz -P ~/Downloads/
10. install afni to your home directory
cd ~/Downloads
tar -xvzf macosx_10.7_Intel_64.tgz
mkdir ~/afni
cp -r ~/Downloads/macosx_10.7_Intel_64/* ~/afni/
/bin/rm -fr ~/Downloads/macosx_10.7_Intel_64*
11. add some stuff to your .bash_profile file:
export PATH=~/afni:$PATH
export DYLD_FALLBACK_LIBRARY_PATH=~/afni
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
* note that if you have other python stuff installed,
* e.g. the Enthought or Anaconda python distributions,
* then you probably have lines like this in your .bash_profile:
* that you will have to comment out (and re-start bash)
* before using afni:
* export PATH="/Users/plg/anaconda/bin:$PATH"
12. open up a new terminal and run afni or uber_subject.py
afni
uber_subject.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment