<div dir="ltr"><br>Forwarding a message from Rajeev Raizada, who had to explore the current insufficiencies<br>of pynifti's and pymvpa's installation procedures on MacOS. Hope this helps others to get started....<br>
<br><br>Michael<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>
From: Rajeev Raizada <<a href="mailto:rajeev.raizada@dartmouth.edu">rajeev.raizada@dartmouth.edu</a>><br>
Date: Tue, Aug 5, 2008 at 12:49 AM<br>
Subject: Getting PyMVPA to work on Mac OS X: problems + finally<br>
getting it to work<br>
To: <a href="mailto:pkg-exppsy-pymvpa@lists.alioth.debian.org">pkg-exppsy-pymvpa@lists.alioth.debian.org</a>.<br>
Cc: Rajeev Raizada <<a href="mailto:rajeev.raizada@dartmouth.edu">rajeev.raizada@dartmouth.edu</a>><br>
<br>
Dear PyMVPA folks,<br>
<br>
After some struggle getting PyMVPA to work on Mac OS X (10.5.4),<br>
here are the steps that worked for me.<br>
I think that it would be very useful if this info or parts of it<br>
were put onto the PyMVPA webpage and the README files,<br>
as the current info in them isn't enough to get things to work on the Mac.<br>
<br>
I obtained the sources for pymvpa and pynifti using git,<br>
using the commands from these websites:<br>
<a href="http://pkg-exppsy.alioth.debian.org/pymvpa/#download" target="_blank">http://pkg-exppsy.alioth.debian.org/pymvpa/#download</a><br>
git clone git://<a href="http://git.debian.org/git/pkg-exppsy/pymvpa.git" target="_blank">git.debian.org/git/pkg-exppsy/pymvpa.git</a><br>
<a href="http://niftilib.sourceforge.net/pynifti/#download" target="_blank">http://niftilib.sourceforge.net/pynifti/#download</a><br>
git clone <a href="http://git.debian.org/git/pkg-exppsy/pynifti.git" target="_blank">http://git.debian.org/git/pkg-exppsy/pynifti.git</a><br>
I got git from here:<br>
<a href="http://code.google.com/p/git-osx-installer/" target="_blank">http://code.google.com/p/git-osx-installer/</a><br>
<br>
Orginally I tried using the Python that is built into Mac OS X,<br>
with the scientific and numerical libraries from <a href="http://www.sagemath.org/" target="_blank">http://www.sagemath.org/</a><br>
Using this built-in python, pynifti failed to work, for reasons that<br>
are mysterious to me.<br>
Then, following a suggestion from Michael, I tried using Enthought Python:<br>
<a href="http://www.enthought.com/products/epdacademic.php?ver=MacOSX" target="_blank">http://www.enthought.com/products/epdacademic.php?ver=MacOSX</a><br>
With Enthought Python, things eventually worked,<br>
although the following tweaks were required.<br>
<br>
Pynifti<br>
-------<br>
Following the instructions in pynifti/doc/manual/manual.txt,<br>
I did this:<br>
<br>
make 3rd<br>
python setup.py build_ext<br>
sudo python setup.py install<br>
<br>
To test whether it worked, I started up python,<br>
and typed "import nifti" at the prompt.<br>
This failed with the message<br>
"ImportError: No module named _nifticlib".<br>
However, when I started up a new Terminal.app tab,<br>
started Python in that, and then did "import nifti" in that, it worked!<br>
Note that it needed a new terminal session.<br>
Simply typing "source ~/.bashrc" in my existing session<br>
did not do the trick.<br>
<br>
PyMVPA<br>
-----------<br>
At first, I simply did<br>
python setup.py build_ext<br>
python setup.py build<br>
...but then the tests failed when they tried to run any SVM stuff.<br>
Digging into pymvpa/doc/intro.txt,<br>
I found the following line that I needed to execute:<br>
cd 3rd/libsvm<br>
g++ -O2 -c svm.cpp<br>
ar cur libsvm.a svm.o<br>
cd ../.. [ to get back into the main pymvpa dir ]<br>
PYMVPA_LIBSVM=1 python setup.py build_ext --swig-opts="-c++ -noproxy"<br>
-I3rd/libsvm -L3rd/libsvm<br>
<br>
This gave me the following warning,<br>
although it didn't seem to actually cause anything to break:<br>
"ld: warning in 3rd/libsvm/libsvm.a, file is not of required architecture"<br>
<br>
So, I executed that above set of commands first.<br>
It might be easier if this were taken care of in setup.py<br>
<br>
Then I did<br>
python setup.py build_ext<br>
sudo python setup.py install<br>
<br>
To test whether it worked, I went into pymvpa/doc/examples/<br>
to try to run the scripts in that dir.<br>
However, it turns out that these examples expect the data directory<br>
to be a subdirectory of examples, when it is in fact higher up.<br>
This link command, executed in the examples dir, fixes that:<br>
<br>
ln -s ../../data data<br>
<br>
Then, if I tried, e.g.<br>
python searchlight_2d.py<br>
but I got errors about smlrc.dylib not being found.<br>
I fixed this as follows:<br>
cd /Library/Frameworks/Python.framework/Versions/2.5.2001/lib/python2.5/site-packages/mvpa/clfs/libsmlr/<br>
sudo ln -s smlrc.so smlrc.dylib<br>
<br>
Then it all worked:<br>
e.g. I got number crunching and nice graphics from, e.g.:<br>
python searchlight_2d.py<br>
python sensanas.py<br>
<br>
My guess is that installations on people's Macs<br>
may appear to be working, but unless the above tweaks are made,<br>
they may not be fully working.<br>
e.g. I had to put the symbolic link in by hand<br>
between smlrc.so and smlrc.dylib<br>
<br>
If the above info were on the PyMVPA webpage,<br>
then that would save people needing to work it out by trial and error.<br>
<br>
The only Mac OS X info that is on the webpages<br>
is advice about changing the Makefile to include i386 and ppc, here:<br>
<a href="http://niftilib.sourceforge.net/pynifti/#macos-x-and-macpython" target="_blank">http://niftilib.sourceforge.net/pynifti/#macos-x-and-macpython</a><br>
saying to put this line in the Makefile<br>
CFLAGS=-Wall -O2 -I. -DHAVE_ZLIB -arch ppc -arch i386<br>
This change doesn't appear to be actually needed,<br>
as all the above steps worked fine without doing it.<br>
<br>
I hope this helps,<br>
<br>
Raj<br>
</div><br><br clear="all"><br>-- <br><br>GPG key: 1024D/3144BE0F Michael Hanke<br><a href="http://apsy.gse.uni-magdeburg.de/hanke">http://apsy.gse.uni-magdeburg.de/hanke</a><br>ICQ: 48230050<br>Jabber: <a href="mailto:michael.hanke@gmail.com">michael.hanke@gmail.com</a><br>
<br>
</div>