Things I didn't do... I'm sure there are lots of options that I should have turned on if I were savvy at all this stuff, but I did not include any instructions to build this stuff with Qt, VTK, or a lot of other neat stuff. So the fun interactive examples in matplotlib do not work with this. If someone wants to clue me in to the easiest way to make this happen, I'll be happy to add it to this tutorial. Also, some things like the wx libraries are disabled in this article, as they are still i386/ppc only in Snow Leopard, so if you want those you'll have to check into what that takes.
Also, a warning... While what is built below is indeed a full 32/64-bit stack, however, so far, 32-bit libraries will not work with it. For reasons that seem to be out of my hands, something isn't yet all dual-binary compatible and is only working in 64-bit mode. So if you need 32-bit compatibility, usually because of 32-bit modules you need to use, perhaps wait until a proper solution, here or elsewhere, is found.
The boxes below that show yellow text are meant to show what was is to be typed by you. It does not show any of the crazy text that gets spit back out at you when you type it. Be sure to type in one line, let it do its thing, then type in the next. Do not just copy and paste a multi-line block of these commands unless you know what you're doing.
The boxes with light blue text are meant to show lines inside a text file that are to be edited by you at the appropriate time.
For this tutorial, I'm going to build everything in a fresh ~/tmp directory (I'll assume nothing else is in there too), so open up a fresh Terminal window, make it nice and wide, and, if it doesn't already exist, warm up your fingers with a simple command: mkdir ~/tmp
1. gfortran This is the simplest step, merely downloading and installing the 4.2.3 version of gfortran listed on this page of tools for use with R. While the gfortran binary itself is i386/ppc, it does create i386/x86_64 binaries just fine.
Update: There is also a gfortran build 4.2 specifically for Snow Leopard under the "Alternative and experimental tools" section, if you'd rather use that. It's built against Snow Leopard's gcc 4.2 for Xcode 3.2, which in principle is a better match than the older 4.2.3 version. While it seems to work fine, as of this writing, gfortran-42-5646.pkg for Snow Leopard contains gfortran version 4.2.1, not 4.2.4 as labelled. Also, if you already installed another gfortran, this one is placed in /usr/bin, not /usr/local/bin, for some reason, so make sure that your $PATH is discovering the gfortran version you want to use before proceeding. (Quick check: see what "which gfortran" responds with at the Terminal after installing.)
As an aside, to have gfortran build a 64-bit binary, pass it the flag "-m64". To create a universal 32/64-bit binary, you can take an i386 and an x86_64 binary and create one universal with lipo: lipo -create bin32 bin64 -output binUniversal.
(On one machine I downloaded and installed gfortran 4.5.0 from source found on the GNU site, but for reasons I can't remember now, switched back to this one. I'm not sure if there's a reason to avoid the 4.5.0 version.)
I'm assuming /usr/local/bin is in everyone's path, but if you type echo $PATH and don't see it included, type this in (or the bash equivalent): setenv PATH "${PATH}:/usr/local:/usr/local/bin"
2. FFTW - a discrete Fourier transform library This is just a straight-forward download and build, using the binary from the official FFTW site. rehash cd ~/tmp curl -O h ttp://www.fftw.org/fftw-3.2.2.tar.gz tar xf fftw-3.2.2.tar.gz cd fftw-3.2.2 ./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E" make sudo make install
3. UMFPACK - routines for solving unsymmetric sparse linear systems How much fun would it be if everything were just as smooth as those two steps? UMFPACK requires being built along side AMD and UFconfig , where all 3 sources are located in the same parent directory. All of them are available on the U of Florida CISE site if you want to poke around there for other versions or whatnot. cd ~/tmp curl -O h ttp://www.cise.ufl.edu/research/sparse/umfpack/current/UMFPACK.tar.gz curl -O h ttp://www.cise.ufl.edu/research/sparse/UFconfig/current/UFconfig.tar.gz curl -O h ttp://www.cise.ufl.edu/research/sparse/amd/current/AMD.tar.gz tar xf AMD.tar.gz tar xf UFconfig.tar.gz tar xf UMFPACK.tar.gz
What follows comes from both the sparse docs in the projects and some helpful notes from Tony S Yu.
In your editor of choice, edit the file UFconfig/UFconfig.mk and make two changes. On line 51, change the F77 setting to read F77 = gfortran
and then starting around line 295, un-comment the lines related to the Mac setup to look as follows: #------------------------------------------------------------------------------ # Macintosh #------------------------------------------------------------------------------
Now we copy some header files and then make the UMFPACK: cp UFconfig/UFconfig.h AMD/Include/ cp UFconfig/UFconfig.h UMFPACK/Include/ cd UMFPACK make make hb make clean
The make hb line is in just there to make sure it doesn't break, and the make clean is just to keep the place tidy.
4. NumPy - Numeric Python Apple includes NumPy in a standard Snow Leopard install, and it's already 32/64-bit. Very nice and all, but it won't build against the SciPy source that I'll be using in the next step, so we need to build a fresh NumPy and to have it used instead of Apple's. We can tell Python to use our own by setting the search path appropriately.
For the next steps I set the environmental variables to build against 32 and 64bit architectures. If you open a new Terminal window or start a new shell for some reason in between these steps, be sure to reinstate these environmental variables: setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv CFLAGS "-arch i386 -arch x86_64" setenv FFLAGS "-m32 -m64" setenv LDFLAGS "-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" setenv PYTHONPATH "/Library/Python/2.6/site-packages/"
which, in bash-speak, is just export MACOSX_DEPLOYMENT_TARGET=10.6 export CFLAGS="-arch i386 -arch x86_64" export FFLAGS="-m32 -m64" export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" export PYTHONPATH="/Library/Python/2.6/site-packages/"
Ok, now we're ready to build NumPy. First grab the source (which may take a bit), then build away. You can either build this from the source repository, which is more cutting-edge, but more prone to getting cut of course, or grab the current stable source (the .tar.gz, not the Mac-specific file!). I'll show what to do for both cases.
First the sane stable-source way. You have to use a web browser and go to the Numpy SourceForge Project page, download the latest stable source (I went with, v1.3.0), then mv the downloaded file to ~/tmp (at least that's what I'm assuming here). Future readers may have to adjust the following to suit their actual downloaded source versions. ("Hello, people of the future!") cd ~/tmp tar xf numpy-1.3.0.tar cd numpy-1.3.0
Or, for those wishing to use the latest source, (which has the fun feature of following all current updates as they happen): cd ~/tmp svn co h ttp://svn.scipy.org/svn/numpy/trunk numpy cd numpy
To make NumPy aware of where we put our AMD and UMFPACK source files, copy the default site.cfg.example file cp site.cfg.example site.cfg
and modify the contents of site.cfg, around line 99, to read like the following:
Obviously, change the /Users/jeff/tmp part to wherever you ended up putting those files.
Continuing, whichever way you went with the source, python setup.py build --fcompiler=gnu95 sudo python setup.py install
5. SciPy - Scientific Python Unable to find a more correct way to do the following, I have found that the system's NumPy gets in the way of building SciPy, so I change its name, to prevent it from making mischief. This is an ugly and fragile solution, but I'm unable to find a workable correct solution to this problem. After you're done with the whole install, feel free to change the library name back, but I'm not sure if it ends up interfering in daily use. (Please contribute if you know the proper way to handle this! See the many forum comments below for discussions about other ways to handle this.) sudo mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy \ /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpyX
Stable-source-style: Grab the latest stable source from the SciPy SourceForge Project, then... cd ~/tmp tar xf scipy-0.7.1.tar cd scipy-0.7.1 python setup.py build sudo python setup.py install
and source-repository-style: cd ~/tmp svn co h ttp://svn.scipy.org/svn/scipy/trunk scipy cd scipy python setup.py build sudo python setup.py install
6. matplotlib - 2- and 3-d plotting libraries, w/ PyLab Stable source, gotten from the matplotlib SourceForge page, and: cd ~/tmp tar xf matplotlib-0.99.1.1.tar cd matplotlib-0.99.1.1
or grab the latest source: cd ~/tmp svn co h ttps://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib cd matplotlib
and before we continue we need to first edit the file make.osx which is right in the directory you should be in now. Within the first few lines of the file you'll see something similar to what I have below, but not quite, so update it to include these changes: MACOSX_DEPLOYMENT_TARGET=10.6
PREFIX=/usr/local
## You shouldn't need to configure past this point (and yet...)
and, since Snow Leopard's wx libraries are a touch behind the times and are compiled i386/ppc, edit line 57 (or thereabouts) of the file setup.cfg to comment out the following line: wxagg = False
from here we can finally build matplotlib with the next, and final, two commands: sudo make -f make.osx fetch deps mpl_build mpl_install sudo python setup.py install
7. iPython - interactive computing environment
David, below, made the fine point of including the quick and easy steps to also pop iPython on your machine. You can check the download page to grab the latest source version, which for me was 0.10, and do as with the others above: cd ~/tmp curl -O h ttp://ipython.scipy.org/dist/ipython-0.10.tar.gz tar xf ipython-0.10.tar.gz cd ipython-0.10 python setup.py build sudo python setup.py install
and, voila, iPython, the more fun way to play with all of the above.
8. Done You may now want to rename the system's NumPy back to what it was, allowing it to be updated nicely when system updates come along, and hopefully it doesn't stir up any troubles: sudo mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpyX \ /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy
However, if you do run into troubles, rename it back to numpyX. On my system, re-enabling the system's NumPy causes trouble, but not everyone seems to need it set up this way. Sorry I can't be of more help on this issue (yet).
Ok, you're done. Scram. Beat it. Get to codin'. Well, if you want to actually see if it's working (and I really hope it is at this point), try running any number of different examples listed on the matplotlib examples page. Again, many of them do not work when they require libraries such as Qt or VTK, but most of them should work as advertised.
Hope this was of help to someone, if only myself in the future when installing it on other machines. Of course, by then, there'll be some great one-click install that'll do it for me, or just be totally built-in to the system the way NumPy already is (well, a boy can dream).]]>" />
Googlier.com | HJ Blog > Building 64bit NumPy/SciPy/PyLab on Snow LeopardAdvertise with Googlier.comHJ Blog > Building 64bit NumPy/SciPy/PyLab on Snow Leopard After trial and error, and plenty of the latter, I have streamlined the process down to installing the following, in order: gfortran, FFTW, UMFPACK, NumPy, SciPy and finally matplotlib (which includes PyLab).
There used to be a great resource for this kinda thing, the Scipy Superpack page, but it appears now to be down, but hopefully not out. Until such a day, there is this page.
Please read the forums if you have any questions, disagree with something that I'm doing or just want to hear the fine things others have figured out. Those who have posted have important contributions and it's a great way to help others if you have some gem to contribute.
0. Setup As of the last update of this article, I am using a clean installation of Snow Leopard, Mac OS X version 10.6.2, with developer tools installed, Xcode version 3.2.1.
I'm assuming MacPorts is not set up on your system yet, or at least I'm not making any use of it. If it is there, make sure your PATH environment variable doesn't have /opt/... listed before the other PATH directories or it may grab something from there when you don't want it to. (As with everything here, if you know better, by all means do what you know is best.) I use a tcsh environment, but the only difference here with my bash brethren will be in typing "export X=whatever" where I type "setenv X whatever".
Things I didn't do... I'm sure there are lots of options that I should have turned on if I were savvy at all this stuff, but I did not include any instructions to build this stuff with Qt, VTK, or a lot of other neat stuff. So the fun interactive examples in matplotlib do not work with this. If someone wants to clue me in to the easiest way to make this happen, I'll be happy to add it to this tutorial. Also, some things like the wx libraries are disabled in this article, as they are still i386/ppc only in Snow Leopard, so if you want those you'll have to check into what that takes.
Also, a warning... While what is built below is indeed a full 32/64-bit stack, however, so far, 32-bit libraries will not work with it. For reasons that seem to be out of my hands, something isn't yet all dual-binary compatible and is only working in 64-bit mode. So if you need 32-bit compatibility, usually because of 32-bit modules you need to use, perhaps wait until a proper solution, here or elsewhere, is found.
The boxes below that show yellow text are meant to show what was is to be typed by you. It does not show any of the crazy text that gets spit back out at you when you type it. Be sure to type in one line, let it do its thing, then type in the next. Do not just copy and paste a multi-line block of these commands unless you know what you're doing.
The boxes with light blue text are meant to show lines inside a text file that are to be edited by you at the appropriate time.
For this tutorial, I'm going to build everything in a fresh ~/tmp directory (I'll assume nothing else is in there too), so open up a fresh Terminal window, make it nice and wide, and, if it doesn't already exist, warm up your fingers with a simple command: mkdir ~/tmp
1. gfortran This is the simplest step, merely downloading and installing the 4.2.3 version of gfortran listed on this page of tools for use with R. While the gfortran binary itself is i386/ppc, it does create i386/x86_64 binaries just fine.
Update: There is also a gfortran build 4.2 specifically for Snow Leopard under the "Alternative and experimental tools" section, if you'd rather use that. It's built against Snow Leopard's gcc 4.2 for Xcode 3.2, which in principle is a better match than the older 4.2.3 version. While it seems to work fine, as of this writing, gfortran-42-5646.pkg for Snow Leopard contains gfortran version 4.2.1, not 4.2.4 as labelled. Also, if you already installed another gfortran, this one is placed in /usr/bin, not /usr/local/bin, for some reason, so make sure that your $PATH is discovering the gfortran version you want to use before proceeding. (Quick check: see what "which gfortran" responds with at the Terminal after installing.)
As an aside, to have gfortran build a 64-bit binary, pass it the flag "-m64". To create a universal 32/64-bit binary, you can take an i386 and an x86_64 binary and create one universal with lipo: lipo -create bin32 bin64 -output binUniversal.
(On one machine I downloaded and installed gfortran 4.5.0 from source found on the GNU site, but for reasons I can't remember now, switched back to this one. I'm not sure if there's a reason to avoid the 4.5.0 version.)
I'm assuming /usr/local/bin is in everyone's path, but if you type echo $PATH and don't see it included, type this in (or the bash equivalent): setenv PATH "${PATH}:/usr/local:/usr/local/bin"
2. FFTW - a discrete Fourier transform library This is just a straight-forward download and build, using the binary from the official FFTW site. rehash cd ~/tmp curl -O h ttp://www.fftw.org/fftw-3.2.2.tar.gz tar xf fftw-3.2.2.tar.gz cd fftw-3.2.2 ./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E" make sudo make install
3. UMFPACK - routines for solving unsymmetric sparse linear systems How much fun would it be if everything were just as smooth as those two steps? UMFPACK requires being built along side AMD and UFconfig , where all 3 sources are located in the same parent directory. All of them are available on the U of Florida CISE site if you want to poke around there for other versions or whatnot. cd ~/tmp curl -O h ttp://www.cise.ufl.edu/research/sparse/umfpack/current/UMFPACK.tar.gz curl -O h ttp://www.cise.ufl.edu/research/sparse/UFconfig/current/UFconfig.tar.gz curl -O h ttp://www.cise.ufl.edu/research/sparse/amd/current/AMD.tar.gz tar xf AMD.tar.gz tar xf UFconfig.tar.gz tar xf UMFPACK.tar.gz
What follows comes from both the sparse docs in the projects and some helpful notes from Tony S Yu.
In your editor of choice, edit the file UFconfig/UFconfig.mk and make two changes. On line 51, change the F77 setting to read F77 = gfortran
and then starting around line 295, un-comment the lines related to the Mac setup to look as follows: #------------------------------------------------------------------------------ # Macintosh #------------------------------------------------------------------------------
Now we copy some header files and then make the UMFPACK: cp UFconfig/UFconfig.h AMD/Include/ cp UFconfig/UFconfig.h UMFPACK/Include/ cd UMFPACK make make hb make clean
The make hb line is in just there to make sure it doesn't break, and the make clean is just to keep the place tidy.
4. NumPy - Numeric Python Apple includes NumPy in a standard Snow Leopard install, and it's already 32/64-bit. Very nice and all, but it won't build against the SciPy source that I'll be using in the next step, so we need to build a fresh NumPy and to have it used instead of Apple's. We can tell Python to use our own by setting the search path appropriately.
For the next steps I set the environmental variables to build against 32 and 64bit architectures. If you open a new Terminal window or start a new shell for some reason in between these steps, be sure to reinstate these environmental variables: setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv CFLAGS "-arch i386 -arch x86_64" setenv FFLAGS "-m32 -m64" setenv LDFLAGS "-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" setenv PYTHONPATH "/Library/Python/2.6/site-packages/"
which, in bash-speak, is just export MACOSX_DEPLOYMENT_TARGET=10.6 export CFLAGS="-arch i386 -arch x86_64" export FFLAGS="-m32 -m64" export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" export PYTHONPATH="/Library/Python/2.6/site-packages/"
Ok, now we're ready to build NumPy. First grab the source (which may take a bit), then build away. You can either build this from the source repository, which is more cutting-edge, but more prone to getting cut of course, or grab the current stable source (the .tar.gz, not the Mac-specific file!). I'll show what to do for both cases.
First the sane stable-source way. You have to use a web browser and go to the Numpy SourceForge Project page, download the latest stable source (I went with, v1.3.0), then mv the downloaded file to ~/tmp (at least that's what I'm assuming here). Future readers may have to adjust the following to suit their actual downloaded source versions. ("Hello, people of the future!") cd ~/tmp tar xf numpy-1.3.0.tar cd numpy-1.3.0
Or, for those wishing to use the latest source, (which has the fun feature of following all current updates as they happen): cd ~/tmp svn co h ttp://svn.scipy.org/svn/numpy/trunk numpy cd numpy
To make NumPy aware of where we put our AMD and UMFPACK source files, copy the default site.cfg.example file cp site.cfg.example site.cfg
and modify the contents of site.cfg, around line 99, to read like the following:
Obviously, change the /Users/jeff/tmp part to wherever you ended up putting those files.
Continuing, whichever way you went with the source, python setup.py build --fcompiler=gnu95 sudo python setup.py install
5. SciPy - Scientific Python Unable to find a more correct way to do the following, I have found that the system's NumPy gets in the way of building SciPy, so I change its name, to prevent it from making mischief. This is an ugly and fragile solution, but I'm unable to find a workable correct solution to this problem. After you're done with the whole install, feel free to change the library name back, but I'm not sure if it ends up interfering in daily use. (Please contribute if you know the proper way to handle this! See the many forum comments below for discussions about other ways to handle this.) sudo mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy \ /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpyX
Stable-source-style: Grab the latest stable source from the SciPy SourceForge Project, then... cd ~/tmp tar xf scipy-0.7.1.tar cd scipy-0.7.1 python setup.py build sudo python setup.py install
and source-repository-style: cd ~/tmp svn co h ttp://svn.scipy.org/svn/scipy/trunk scipy cd scipy python setup.py build sudo python setup.py install
6. matplotlib - 2- and 3-d plotting libraries, w/ PyLab Stable source, gotten from the matplotlib SourceForge page, and: cd ~/tmp tar xf matplotlib-0.99.1.1.tar cd matplotlib-0.99.1.1
or grab the latest source: cd ~/tmp svn co h ttps://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib cd matplotlib
and before we continue we need to first edit the file make.osx which is right in the directory you should be in now. Within the first few lines of the file you'll see something similar to what I have below, but not quite, so update it to include these changes: MACOSX_DEPLOYMENT_TARGET=10.6
PREFIX=/usr/local
## You shouldn't need to configure past this point (and yet...)
and, since Snow Leopard's wx libraries are a touch behind the times and are compiled i386/ppc, edit line 57 (or thereabouts) of the file setup.cfg to comment out the following line: wxagg = False
from here we can finally build matplotlib with the next, and final, two commands: sudo make -f make.osx fetch deps mpl_build mpl_install sudo python setup.py install
7. iPython - interactive computing environment
David, below, made the fine point of including the quick and easy steps to also pop iPython on your machine. You can check the download page to grab the latest source version, which for me was 0.10, and do as with the others above: cd ~/tmp curl -O h ttp://ipython.scipy.org/dist/ipython-0.10.tar.gz tar xf ipython-0.10.tar.gz cd ipython-0.10 python setup.py build sudo python setup.py install
and, voila, iPython, the more fun way to play with all of the above.
8. Done You may now want to rename the system's NumPy back to what it was, allowing it to be updated nicely when system updates come along, and hopefully it doesn't stir up any troubles: sudo mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpyX \ /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy
However, if you do run into troubles, rename it back to numpyX. On my system, re-enabling the system's NumPy causes trouble, but not everyone seems to need it set up this way. Sorry I can't be of more help on this issue (yet).
Ok, you're done. Scram. Beat it. Get to codin'. Well, if you want to actually see if it's working (and I really hope it is at this point), try running any number of different examples listed on the matplotlib examples page. Again, many of them do not work when they require libraries such as Qt or VTK, but most of them should work as advertised.
Hope this was of help to someone, if only myself in the future when installing it on other machines. Of course, by then, there'll be some great one-click install that'll do it for me, or just be totally built-in to the system the way NumPy already is (well, a boy can dream).]]>
http://blog.hyperjeff.net/?p=160
en-ushyperjeff@mac.comlup
minor glitch: tar xzf *.gz was not "copy and paste working" so I had to unpack each separately: tar xzf AMD.tar.gz tar xzf UFconfig.tar.gz tar xzf UMFPACK.tar.gz are you sending this upstream to the dev teams of numpy + scipy + pylab?]]>
http://blog.hyperjeff.net/?p=160#comment614
Thu, 03 Sep 2009 16:54:15 -0500http://blog.hyperjeff.net/?p=160#comment614Jeff I'll mention this article to the powers that be in scipy-land. I'm sure they'll know how to integrate these notes and have it handled properly.]]>
http://blog.hyperjeff.net/?p=160#comment616
Thu, 03 Sep 2009 22:35:28 -0500http://blog.hyperjeff.net/?p=160#comment616David
Just upgraded from Leopard to Snow and borked my "scientific" python environment. This sorted it out nicely. A few small issues: I had to run the build step for Scipy through sudo, I was getting fortran permission errors (but perhaps this is an issue with my fortran install).
Also, I uncommented and adjusted the PREFIX= line in make.osx (matplotlib install) otherwise it compiled freetype/png/etc in the / dir of my HDD and left them there.
For what its worth, IPython also installs easily following your instructions above.
Thanks again!]]>
http://blog.hyperjeff.net/?p=160#comment617
Fri, 04 Sep 2009 01:47:16 -0500http://blog.hyperjeff.net/?p=160#comment617Jeff Interesting about both the sudo for fortran and the PREFIX issues. Not sure why I got out of those tweaks, but this discussion can serve to archive such specific issues that others will surely run across as well.]]>
http://blog.hyperjeff.net/?p=160#comment618
Fri, 04 Sep 2009 02:19:24 -0500http://blog.hyperjeff.net/?p=160#comment618David Looks related to this: http://www.shocksolution.com/2009/01/14/scipyintegrate-odepack-import-error-solved/
Wondering if SciPy doesn't like being compiled against the native Mac BLAS libraries from veclib? Or maybe I have another fortran problem. Have you had any troubles with this? David.]]>
http://blog.hyperjeff.net/?p=160#comment619
Sun, 06 Sep 2009 08:24:01 -0500http://blog.hyperjeff.net/?p=160#comment619Jack Although, am I supposed to see a scary rash of compiler warnings? Seems like every other statement violates some convention. I didn't follow your instructions to the letter, though (played fast and loose with the fftw libs and other dependencies - maybe that's what's causing all the trouble).]]>
http://blog.hyperjeff.net/?p=160#comment620
Mon, 07 Sep 2009 23:28:25 -0500http://blog.hyperjeff.net/?p=160#comment620Bryan Lunt
It SHOULD BE #1 on the list!!!! Make sure you don't have python.org or macpython, or other non-apple python distributions installed and overriding your Snow Leopard's default python installation.]]>
http://blog.hyperjeff.net/?p=160#comment621
Tue, 08 Sep 2009 16:04:03 -0500http://blog.hyperjeff.net/?p=160#comment621Jeff Jack, A rash of scary compiler warnings: YES. Try to go into Zen state of some kind when they are flying by. I guess I got numb to them after a while and forgot to say anything about it. They seem to be ultimately harmless, at least for now.
Bryan, Thanks for mentioning that. Although I make the assumption way up there that people are using a clean SL install, it's more probable that people here have upgraded from a Leopard install and may have such things on their system.]]>
http://blog.hyperjeff.net/?p=160#comment622
Tue, 08 Sep 2009 16:17:57 -0500http://blog.hyperjeff.net/?p=160#comment622Jack echo "import scipy scipy.test('full')" | python > scipy-test-log 2>&1
and have the results uploaded here: [link] /> The short version is,
Ran 4115 tests in 486.157s
FAILED (KNOWNFAIL=10, SKIP=32, errors=289)
But, uh, I'll just ignore that and use scipy as if nothing happened. Better something than nothing, right?]]>
http://blog.hyperjeff.net/?p=160#comment623
Tue, 08 Sep 2009 18:55:10 -0500http://blog.hyperjeff.net/?p=160#comment623Jeff I noticed some differences in our setup: - I don't get the deprecation warning you get about scipy.linsolve at the top. - You are using the NumPy 1.2.1 installed on the system, but I'm using NumPy 1.4.0.dev7345 that I grabbed from recent source - Your SciPy is 0.7.1, and I'm using 0.8.0.dev5911 - Our Python and nose versions are the same
I get the same clapack warning as you, but not the cblas warning you get. After this point in the test you get a million more warnings than I do.
I also get a zillion ERRORs related to the test suite that I'm looking into now. It'd be great to have a clean test, or something closer than this. Here's what I have currently:
I'll update this if I have something substantial to contribute on this front.]]>
http://blog.hyperjeff.net/?p=160#comment624
Tue, 08 Sep 2009 23:56:47 -0500http://blog.hyperjeff.net/?p=160#comment624Ben thanks for this very usefull script,
I followed it till the end and works pretty well except pour the matplotlib part,
here is there error I got :
building 'matplotlib.backends._tkagg' extension g++-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc -arch x86_64 build/temp.macosx-10.6-universal-2.6/src/agg_py_transforms.o build/temp.macosx-10.6-universal-2.6/src/ _tkagg.o build/temp.macosx-10.6-universal-2.6/CXX/cxx_extensions.o build/temp.macosx-10.6-universal-2.6/ CXX/cxxsupport.o build/temp.macosx-10.6-universal-2.6/CXX/IndirectPythonInterface.o build/ temp.macosx-10.6-universal-2.6/CXX/cxxextensions.o -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.6-universal-2.6/matplotlib/backends/_tkagg.so -framework Tcl -framework Tk ld: library not found for -lfreetype collect2: ld returned 1 exit status ld: library not found for -lfreetype collect2: ld returned 1 exit status ld: library not found for -lfreetype collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//cc5GeY7r.out (No such file or directory) error: command 'g++-4.2' failed with exit status 1 zsh: exit 1 sudo python setup.py install
any input on that ?
thanks]]>
http://blog.hyperjeff.net/?p=160#comment625
Wed, 09 Sep 2009 19:25:16 -0500http://blog.hyperjeff.net/?p=160#comment625Ben if you have port installed just do:
sudo port install freetype
and that'll fix it]]>
http://blog.hyperjeff.net/?p=160#comment626
Thu, 10 Sep 2009 11:02:30 -0500http://blog.hyperjeff.net/?p=160#comment626Hasan While the gfortran binary itself is i386/ppc, it does create i386/x86_64 binaries just fine.
What flag do I need to set to tell fortran to compile for x86_64? Doing gfortran -arch x86_64 results in
f951: error: unrecognized command line option "-arch" ]]>
http://blog.hyperjeff.net/?p=160#comment627
Thu, 10 Sep 2009 22:49:45 -0500http://blog.hyperjeff.net/?p=160#comment627Jeff
http://blog.hyperjeff.net/?p=160#comment628
Thu, 10 Sep 2009 22:58:26 -0500http://blog.hyperjeff.net/?p=160#comment628Richard West does that mean we should replace:
export FFLAGS="-arch i386 -arch x86_64"
with:
export FFLAGS="-m32 -m64"
or something like that? ]]>
http://blog.hyperjeff.net/?p=160#comment629
Sat, 12 Sep 2009 00:55:44 -0500http://blog.hyperjeff.net/?p=160#comment629Richard
>>> import scipy.integrate
I get a bunch of errors that your blog thinks is spam so I can only paste the summary:
ImportError: dlopen(/Library/Python/2.6/site-packages/scipy/special/_cephes.so, 2): no suitable image found. Did find: /Library/Python/2.6/site-packages/scipy/special/_cephes.so: mach-o, but wrong architecture]]>
http://blog.hyperjeff.net/?p=160#comment630
Sat, 12 Sep 2009 12:55:03 -0500http://blog.hyperjeff.net/?p=160#comment630Jeff FWIW, from what I compiled from this article, I can get integrate to import and ran a few tests, which mostly work: [code]]]>
http://blog.hyperjeff.net/?p=160#comment631
Sat, 12 Sep 2009 13:16:46 -0500http://blog.hyperjeff.net/?p=160#comment631Richard
When I use gfortran 4.2.3 from [link] the instructions work. Perhaps that is why you gave up on gfortran 4.5.0 in step 1.
It doesn't work for me - although we seemed to compile numpy as 32/64 bit, it won't actually work as 32 bit. A shame, as tons of my other modules don't (yet) work as 64-bit.
http://projects.scipy.org/numpy/ticket/1221]]>
http://blog.hyperjeff.net/?p=160#comment633
Sun, 13 Sep 2009 11:28:32 -0500http://blog.hyperjeff.net/?p=160#comment633Sergei Vieira
I get the following message... In summary...I am not able to run matplotlib Where did I go wrong?
Leopard libedit detected. ERROR: matplotlib could NOT be imported! Starting normal IPython. Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. ]]>
http://blog.hyperjeff.net/?p=160#comment634
Sun, 13 Sep 2009 23:16:57 -0500http://blog.hyperjeff.net/?p=160#comment634Srinath V
CFLAGS="-Os -arch x86_64 -arch i386 -l${PREFIX}/include"
if cut&pasted puts a "-l" (capital ell) instead of an "-I" (capital eye). Thus, you may want to use a different font?]]>
http://blog.hyperjeff.net/?p=160#comment635
Mon, 14 Sep 2009 16:56:55 -0500http://blog.hyperjeff.net/?p=160#comment635David Herrera checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. make: *** Error 77
perhaps because I didn't have a pkgconfig file in ~/dev/lib/ I tried to install pkgcong-0.23 thinking that would solve it, but it didn't Instead, I manually installed the libpng and freetype2 libraries. I couldn't run ./configure, instead I had to use sudo ./configure. Not sure if that was the problem with the make.osx script.
Looks like everything installed correctly. Let me know if you want to see the config.log file. I'll report any issues I find with my installation. Thanks ]]>
http://blog.hyperjeff.net/?p=160#comment636
Mon, 14 Sep 2009 22:59:52 -0500http://blog.hyperjeff.net/?p=160#comment636Andre Campos
http://blog.hyperjeff.net/?p=160#comment637
Thu, 17 Sep 2009 20:15:08 -0500http://blog.hyperjeff.net/?p=160#comment637David My errors importing scipy.stats/scipy.integrate got sorted out. I had inadvertently used a different fortran version to compile parts of numpy and scipy and they just don't play well together. If anyone is having errors with these components, I would suggest fully removing all versions of fortran and then reinstalling only version 4.2.3 from r.research - as stated in the numpy install docs (and scipy also I think) they will fail with errors if you use the HP version or verson 4.5... You will then need to recompile numpy and scipy.
Also, as another minor thing, in the final part of step 3 you create a .numpy-site.cfg file in the home dir. This step is mainly required if you are going to use the easy_install tools. If you are compiling from source as you have detailed, you can simply put that information about and in the site.cfg file in your numpy source dir at the time of compiling.
Thanks again Jeff - great guide. ]]>
http://blog.hyperjeff.net/?p=160#comment638
Fri, 18 Sep 2009 02:04:28 -0500http://blog.hyperjeff.net/?p=160#comment638John Like Ben above, all is well until the matplotlib make, which fails. This has happened on both upgraded and clean Snow Leopard installs, and I can't find a way around it. Editing out some of the long parts, the error I get is:
building 'matplotlib.ft2font' extension gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Os -arch x86_64 -arch i386 -I/include -pipe -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/Library/Python/2.6/site-packages/numpy/core/include -I. -I/Library/Python/2.6/site-packages/numpy/core/include/freetype2 -I./freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/ft2font.cpp -o build/temp.macosx-10.6-universal-2.6/src/ft2font.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ In file included from src/ft2font.h:13, from src/ft2font.cpp:1: /include/ft2build.h:56:38: error: freetype/config/ftheader.h: No such file or directory
…lots removed, happy to email…
src/ft2font.cpp:98: error: ‘FT_Int’ was not declared in this scope /Library/Python/2.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:1174: warning: ‘int _import_array()’ defined but not used lipo: can't open input file: /var/tmp//ccoIauD8.out (No such file or directory) error: command 'gcc-4.2' failed with exit status 1 make: *** Error 1
Any advice would be life-saving (or at least sanity-saving) -- thanks!
john ]]>
http://blog.hyperjeff.net/?p=160#comment639
Sun, 20 Sep 2009 09:28:01 -0500http://blog.hyperjeff.net/?p=160#comment639Jeff 1) I should mention above that my disabling of Apple's Numpy is potentially problematic down the road. 2) I will add notes about building from latest stable releases instead of from source (I'm perhaps a bit too playful with my local builds). 3) There was a #3, but I lost my train of thought. More later...]]>
http://blog.hyperjeff.net/?p=160#comment641
Tue, 22 Sep 2009 01:17:34 -0500http://blog.hyperjeff.net/?p=160#comment641Jay
http://blog.hyperjeff.net/?p=160#comment642
Wed, 23 Sep 2009 19:24:09 -0500http://blog.hyperjeff.net/?p=160#comment642Peter
http://blog.hyperjeff.net/?p=160#comment643
Wed, 23 Sep 2009 20:30:00 -0500http://blog.hyperjeff.net/?p=160#comment643Greg ...... ...... src/ft2font.cpp:96: error: variable or field 'draw_bitmap' declared void src/ft2font.cpp:96: error: 'FT_Bitmap' was not declared in this scope src/ft2font.cpp:96: error: 'bitmap' was not declared in this scope src/ft2font.cpp:97: error: 'FT_Int' was not declared in this scope src/ft2font.cpp:98: error: 'FT_Int' was not declared in this scope /Library/Python/2.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:1174: warning: 'int _import_array()' defined but not used lipo: can't figure out the architecture type of: /var/tmp//cciuW995.out lipo: can't open input file: /var/tmp//cc1Lf2gd.out (No such file or directory) error: command 'gcc-4.2' failed with exit status 1 make: *** Error 1 ]]>
http://blog.hyperjeff.net/?p=160#comment644
Thu, 24 Sep 2009 23:41:40 -0500http://blog.hyperjeff.net/?p=160#comment644Jean-Louis I must admit I did not follow your installation guide, but for something similar, I got stuck on an error that does not appear in the above comments... yet.
I got numpy and ipython installed, already. However, I fail to install matplotlib: I had the same problems to install the dependencies as David Herrera (see above comment). It so happens that my version (0.99.1.1) of the make.osx file did not use any flags for the dependencies: CFLAGS_DEPS and LDFLAGS_DEPS were never used... I used this instead, and it seemed to work:
However, I get stuck with the "make mpl_build" step. Here s the error:
ImportError: /usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
I m not sure how to go around this, I tried to install wxPython from source, but that did not work out either (some strange problems at compilation). Anyway, has anyone already been confronted to that error?
and that put all the files into /System/Library/Frameworks/Python.framework/Versions/2.6, which was acceptable for my purposes.
Thanks again.
Conrad
PS For the folks who are seeing the "error: freetype/config/ftheader.h: No such file or directory" message, check your CFLAGS line to make sure you have the "-I${PREFIX}/include/freetype2" flag. That's what fixed it for me.]]>
http://blog.hyperjeff.net/?p=160#comment647
Tue, 29 Sep 2009 16:54:15 -0500http://blog.hyperjeff.net/?p=160#comment647Lion Change the beginning of make.osx to:
MACOSX_DEPLOYMENT_TARGET=10.6
## You shouldn't need to configure past this point
About my last post: I checked the file "setup.cfg" in the matplotlib directory. I commented the line #wxagg = True
and than keep following the instructions. Seems to have worked great for me :-)
Rock on! ]]>
http://blog.hyperjeff.net/?p=160#comment648
Tue, 29 Sep 2009 19:36:18 -0500http://blog.hyperjeff.net/?p=160#comment648Lion I downloaded the stable matplotlib 0.99.1.1 and not the repository version and compiled it as written above. I did everything else as written in the article.
Just in case it makes a difference.]]>
http://blog.hyperjeff.net/?p=160#comment649
Tue, 29 Sep 2009 19:38:23 -0500http://blog.hyperjeff.net/?p=160#comment649Jeff 4 tiny typos in the original article were corrected, including a bad flag being passed in the make.osx file (many thanks, Srinath). Hope these didn't trip people up too much.
As Bryan and David have pointed out, you may want to make sure that older or different installs of python / macpython and gfortran are out of the way or uninstalled before running through these install steps. (It may be as easy is changing the order of your $PATH variable to find the /usr/local copies before others in /opt or elsewhere.)
Tonight's fresh install was done using the latest stable source instead of the svn source, which is really what I should suggest for others to do. I sometimes frivolously live on the edge more than is practical, especially when writing a tutorial for others and I'll reflect this option above.
Jean_Louis, perhaps because I'm now building from stable source, I too found that I have to put in #wxagg = True" in order to get matplotlib to build, so I'll add that note in up there.
Also, I ended up changing my make.osx file settings to a hybrid of mine and the suggestions of Jean-Louis and Lion, although I don't have the energy tonight to figure out if the FFLAGS setting is needed or not (I'll have it in for now).
This is a great discussion! Many thanks to everyone contributing both problems and solutions.]]>
http://blog.hyperjeff.net/?p=160#comment651
Wed, 30 Sep 2009 03:20:34 -0500http://blog.hyperjeff.net/?p=160#comment651Nicholas Lundgaard
[link] page lately? They've posted a gfortran package built for Snow Leopard, which is gfortran 4.2.4 (rather than the 4.2.3 in the article). This one is built against the Snow Leopard build of gcc 4.2; I am not sure if there's a realistic benefit to that. You'll find it under the "Alternative and experimental tools" section. I am starting to redo the process as I speak, using this one. Might be worth a mention in the article if it works.]]>
http://blog.hyperjeff.net/?p=160#comment652
Thu, 01 Oct 2009 10:59:41 -0500http://blog.hyperjeff.net/?p=160#comment652Jeff
http://blog.hyperjeff.net/?p=160#comment654
Thu, 01 Oct 2009 12:51:25 -0500http://blog.hyperjeff.net/?p=160#comment654Nicholas Lundgaard On the 4.2.1 vs. 4.2.4 thing, I was also thrown by that when I poked through the installation. I think it says "4.2.1" with gfortran -v because it's built for Apple's gcc 4.2.1. The folders where the install files are put are also labelled as 4.2.1. I think it actually is 4.2.4 as the author claims, and that these oddities are because of the gcc version.
Still, I'd love to hear if you have more luck getting this gfortran working with all this; I'm worried that it's not doing something right, but at this point it's just as likely I haven't cleaned out my old build properly.]]>
http://blog.hyperjeff.net/?p=160#comment655
Thu, 01 Oct 2009 15:58:12 -0500http://blog.hyperjeff.net/?p=160#comment655Jeff On gfortran, I'll trust the author that it's 4.2.4, especially since I have no idea what the difference is and he actually built it. =]]]>
http://blog.hyperjeff.net/?p=160#comment656
Thu, 01 Oct 2009 16:18:09 -0500http://blog.hyperjeff.net/?p=160#comment656Nicholas Lundgaard So it sounds like the Snow Leopard build of gfortran may be the safest route, compatibility-wise, though as you say it's too bad it installs into /usr rather than /usr/local.]]>
http://blog.hyperjeff.net/?p=160#comment657
Thu, 01 Oct 2009 19:19:47 -0500http://blog.hyperjeff.net/?p=160#comment657SBates
When I try to install Matplotlib, I'm getting the following error:
REQUIRED DEPENDENCIES numpy: 1.2.1 freetype2: found, but unknown version (no pkg-config) * WARNING: Could not find 'freetype2' headers in any * of '.', './freetype2'.
Now I'm not a newbie, but I am still only beginning to get comfortable with unix environments, so I may be missing something simple - but I have freetype installed from macports, plus there is a freetype-2.3.7 directory in my matplotlib directory. Should it be able to find the header files?!
thanks for any help you can offer.]]>
http://blog.hyperjeff.net/?p=160#comment658
Tue, 06 Oct 2009 09:32:01 -0500http://blog.hyperjeff.net/?p=160#comment658Isabel
I have a trouble compiling the matplotlib part (the rest works pretty. I have followed the tutorial till the end).
Here is the error I got when I build matplotlib with the command: sudo make -f make.osx ...
... cc -arch i386 -arch x86_64 -I/usr/local /include -I/usr/local /include/freetype2 -isysroot \ /Developer/SDKs/MacOSX10.6.sdk -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o adler32.o adler32.c cc -arch i386 -arch x86_64 -I/usr/local /include -I/usr/local /include/freetype2 -isysroot \ /Developer/SDKs/MacOSX10.6.sdk -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o compress.o compress.c cc -arch i386 -arch x86_64 -I/usr/local /include -I/usr/local /include/freetype2 -isysroot \ /Developer/SDKs/MacOSX10.6.sdk -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o crc32.o crc32.c i686-apple-darwin10-gcc-4.2.1: /include: No such file or directory i686-apple-darwin10-gcc-4.2.1: no input files i686-apple-darwin10-gcc-4.2.1: /include: No such file or directory i686-apple-darwin10-gcc-4.2.1: no input files i686-apple-darwin10-gcc-4.2.1: /include: No such file or directory i686-apple-darwin10-gcc-4.2.1: i686-apple-darwin10-gcc-4.2.1: /include: No such file or directory ... i686-apple-darwin10-gcc-4.2.1: /include/freetype2: No such file or directory ... lipo: can't figure out the architecture type of: /var/tmp//ccUaeA7c.out ... make: *** Error 1 ... make: *** Error 2
any idea?
thanks]]>
http://blog.hyperjeff.net/?p=160#comment659
Wed, 07 Oct 2009 08:10:37 -0500http://blog.hyperjeff.net/?p=160#comment659Michael -I/usr/local /include should read -I/usr/local/include You have an extra space in there.]]>
http://blog.hyperjeff.net/?p=160#comment660
Thu, 08 Oct 2009 13:32:23 -0500http://blog.hyperjeff.net/?p=160#comment660Isabel
I've gone crazy trying to understand the meaning of the /include directory that appeared when compiling zlib. The problem was an extra space at the end of PREFIX variable in make.osx file. Now everything works perfectly.]]>
http://blog.hyperjeff.net/?p=160#comment663
Tue, 13 Oct 2009 08:34:05 -0500http://blog.hyperjeff.net/?p=160#comment663Hunter (...stuff working...) building extension "scipy.sparse.linalg.dsolve._ssuperlu" sources building extension "scipy.sparse.linalg.dsolve.umfpack.__umfpack" sources adding 'scipy/sparse/linalg/dsolve/umfpack/umfpack.i' to sources. swig: scipy/sparse/linalg/dsolve/umfpack/umfpack.i swig -python -I/Users/Hunter/Documents/Devel/AMD/Include \ -o build/src.macosx-10.6-universal-2.6/scipy/sparse/linalg/dsolve/umfpack/_umfpack_wrap.c \ -outdir build/src.macosx-10.6-universal-2.6/scipy/sparse/linalg/dsolve/umfpack scipy/sparse/linalg/dsolve/umfpack/umfpack.i scipy/sparse/linalg/dsolve/umfpack/umfpack.i:192: Error: Unable to find 'umfpack.h' scipy/sparse/linalg/dsolve/umfpack/umfpack.i:193: Error: Unable to find 'umfpack_solve.h' (...another ~15 similar errors...) scipy/sparse/linalg/dsolve/umfpack/umfpack.i:272: Error: Unable to find 'umfpack_get_numeric.h' error: command 'swig' failed with exit status 1
Any ideas?]]>
http://blog.hyperjeff.net/?p=160#comment664
Wed, 14 Oct 2009 19:13:18 -0500http://blog.hyperjeff.net/?p=160#comment664Hunter
http://blog.hyperjeff.net/?p=160#comment665
Wed, 14 Oct 2009 19:18:21 -0500http://blog.hyperjeff.net/?p=160#comment665Hunter export CFLAGS="-arch i386 -arch x86_64 -I/Users/Hunter/Documents/Devel/UMFPACK/Include"
and copying ~/.numpy-site.cfg to ~/.scipy-site.cfg, but neither of those worked. I checked earlier in the build output, and noticed this:
So, something's clearly not right here, but I have no idea how to fix it. Any help would be greatly appreciated.]]>
http://blog.hyperjeff.net/?p=160#comment668
Sat, 17 Oct 2009 13:43:35 -0500http://blog.hyperjeff.net/?p=160#comment668Darren export PYTHONPATH=/Library/Python/2.6/site-packages:${PYTHONPATH}
Note, I just started using OS X yesterday, but I have had to work through this same issue with Ubuntu.]]>
http://blog.hyperjeff.net/?p=160#comment669
Sun, 18 Oct 2009 13:14:14 -0500http://blog.hyperjeff.net/?p=160#comment669Darren Defaults env_keep += "PYTHONPATH"]]>
http://blog.hyperjeff.net/?p=160#comment670
Sun, 18 Oct 2009 13:29:30 -0500http://blog.hyperjeff.net/?p=160#comment670Pete
sudo make -f make.osx fetch deps mpl_build mpl_install ... Checking for mmap support... No. gcc -arch i386 -arch x86_64 -I/usr/local/include -I/usr/local/include/freetype2 -isysroot \ /Developer/SDKs/MacOSX10.6u.sdk -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o adler32.o adler32.c gcc -arch i386 -arch x86_64 -I/usr/local/include -I/usr/local/include/freetype2 -isysroot \ /Developer/SDKs/MacOSX10.6u.sdk -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o compress.o compress.c gcc -arch i386 -arch x86_64 -I/usr/local/include -I/usr/local/include/freetype2 -isysroot \ /Developer/SDKs/MacOSX10.6u.sdk -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o crc32.o crc32.c In file included from crc32.c:29: zutil.h:21:24: error: stddef.h: No such file or directory zutil.h:23:22: error: string.h: No such file or directory zutil.h:24:22: error: stdlib.h: No such file or directory crc32.c:36:24: error: limits.h: No such file or directory In file included from crc32.c:29: zutil.h:21:24: error: stddef.h: No such file or directory zutil.h:23:22: error: string.h: No such file or directory zutil.h:24:22: error: stdlib.h: No such file or directory crc32.c:36:24: error: limits.h: No such file or directory lipo: can't figure out the architecture type of: /var/tmp//ccc4ZzsB.out make: *** Error 1 make: *** Waiting for unfinished jobs.... make: *** Error 2
It looks like a problem with gcc under root maybe? Did anyone else run into this?? ]]>
http://blog.hyperjeff.net/?p=160#comment672
Sun, 18 Oct 2009 21:03:04 -0500http://blog.hyperjeff.net/?p=160#comment672Jeff It is worth mentioning that I added a line at the end to change the name of Apple's Numpy back to what it was, since I only needed it out of the way while compiling, and I did notice that some system updates have indeed altered that library since. Sorry about any inconveniences I've caused anyone on that. Here is the code I used to right the wrong post Apple's update (only do this if you notice that you have both a "numpy" and a "numpy_APPLE_DEFAULT" directory in /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python, and check to see if it looks like this as well:
It turns out that nothing different exists in those new folders and files at all, but for some reason the system push around files, no doubt confused by my renaming in the original version of this tutorial. (Important: If you don't know what I'm talking about, ignore the following.) Here's a set of commands to clean things up: (pardon the riskiness factor here...) sudo rm -r /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy sudo rm -r /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT/core sudo rm -r /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT/distutils sudo rm -r /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT/f2py sudo rm -r /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT/numarray sudo rm -r /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT/random sudo mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT/numpy_APPLE_DEFAULT \ /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy sudo rmdir /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT
I'm still looking into issues that others are having.]]>
http://blog.hyperjeff.net/?p=160#comment674
Sun, 18 Oct 2009 22:06:28 -0500http://blog.hyperjeff.net/?p=160#comment674Pete
10.6]]>
http://blog.hyperjeff.net/?p=160#comment675
Sun, 18 Oct 2009 22:10:58 -0500http://blog.hyperjeff.net/?p=160#comment675Jeff
http://blog.hyperjeff.net/?p=160#comment676
Sun, 18 Oct 2009 22:28:38 -0500http://blog.hyperjeff.net/?p=160#comment676Hunter
http://blog.hyperjeff.net/?p=160#comment677
Mon, 19 Oct 2009 13:28:07 -0500http://blog.hyperjeff.net/?p=160#comment677Darren Did you remember to "source ~/.profile", and to add PYTHONPATH to the list of environment variables to keep in sudoers?]]>
http://blog.hyperjeff.net/?p=160#comment679
Tue, 20 Oct 2009 09:48:29 -0500http://blog.hyperjeff.net/?p=160#comment679Darren
[link]
"Python comes pre-installed on Mac OS X, but due to Apple's release cycle, it's often one or even two years old. The overwhelming recommendation of the "MacPython" community is to upgrade your Python by downloading and installing a newer version from the Python standard release page."
This would solve the problem of numpy-1.2.1 being imported, because the new python won't pick up the system python packages. Too bad they didn't mention the all important qualifier that the mac installer disk image was not compiled to support x86_64.
]]>
http://blog.hyperjeff.net/?p=160#comment680
Tue, 20 Oct 2009 10:24:19 -0500http://blog.hyperjeff.net/?p=160#comment680Ross Coleman I made no changes to make.osx
I successfully compiled and installed matplotlib 0.99.0 from source as follows:
Change to setupext.py: (to find freetype2 that Apple bundled with the OS) basedir = { ... 'darwin' : , ... }
@Darren: Apple includes Python 2.6 in Snow Leopard, and numpy doesn't support Python 3.x yet, so I don't see much of a reason to install your own Python.]]>
http://blog.hyperjeff.net/?p=160#comment681
Tue, 20 Oct 2009 14:06:06 -0500http://blog.hyperjeff.net/?p=160#comment681Darren
... 'darwin' : , ... }
Could you be a bit more explicit? What did you put in place of "..." in the list?]]>
http://blog.hyperjeff.net/?p=160#comment682
Tue, 20 Oct 2009 16:27:50 -0500http://blog.hyperjeff.net/?p=160#comment682Darren
basedir = { ... 'darwin' : , ... } ]]>
http://blog.hyperjeff.net/?p=160#comment683
Tue, 20 Oct 2009 16:40:03 -0500http://blog.hyperjeff.net/?p=160#comment683Niall >>> import matplotlib.pyplot python(25582) malloc: *** error for object 0x10181f820: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap
Any help would be greatly appreciated.]]>
http://blog.hyperjeff.net/?p=160#comment684
Fri, 23 Oct 2009 06:51:10 -0500http://blog.hyperjeff.net/?p=160#comment684Xavier I do not see my comments appearing. However, I tried a matplotlib install following Ross Coleman's comment. And everything works fine.
Thks again for that very useful page, Cheers, X.]]>
http://blog.hyperjeff.net/?p=160#comment685
Sat, 24 Oct 2009 15:09:10 -0500http://blog.hyperjeff.net/?p=160#comment685Hunter
http://blog.hyperjeff.net/?p=160#comment686
Wed, 28 Oct 2009 10:54:25 -0500http://blog.hyperjeff.net/?p=160#comment686Jonny It would be really handy if you and Darren could confirm a definitive answer for how to deal with this issue of moving numpy aside. I have run into problems with this where I have compiled my own C modules against the newly-installed numpy 1.3.0, but at runtime it is the OS version of numpy that is loaded. This produces an instant and hard-to-diagnose crash in import_array(). At the moment I am just sticking with your original suggestion of renaming the OS version of numpy and not renaming it back. I'm not entirely clear what negative consequences this will have - does the confusion during software update actually do any harm?
As an aside I am not sure why the code in _import_array is not spotting this problem at runtime. This checks NPY_VERSION compatibility between the headers and the loaded module. A comment in ndarrayobject.h states: Some changes, such as adding a function pointer to the end of the function table, can be made without breaking binary compatibility. In this case, only the NPY_FEATURE_VERSION (*not* NPY_VERSION) would be increased Unfortunately in this case _import_array, which is defined in the header file __multiarray_api.h makes use of one of those new function pointers (PyArray_GetEndianness), and since this function pointer is missing a crash occurs. It strikes me that this is a bug in numpy, but I don't know enough about how this is all meant to work to be sure...]]>
http://blog.hyperjeff.net/?p=160#comment687
Thu, 29 Oct 2009 04:55:53 -0500http://blog.hyperjeff.net/?p=160#comment687Darren Just a reminder, I direct python to search first my locally installed packages before the system packages by adding the following to ~/.profile:
And in order for that PYTHONPATH to be respected when I use sudo to install something like svn scipy, which will not build using the system numpy, I added a line to my sudoers file (use visudo to edit it):
Defaults env_keep += "PYTHONPATH"
It would be so much easier to install a local 64-bit macpython framework from python.org, if such a thing existed. Anyone know if one will be available for python-2.7?]]>
http://blog.hyperjeff.net/?p=160#comment688
Sat, 31 Oct 2009 11:07:22 -0500http://blog.hyperjeff.net/?p=160#comment688IsoOctane - Installed 64-bit python 2.6.4 from sources, doing a framework install (./configure --enable-framework)
- Added the python binary directory to the path BEFORE the system python locations
- Installed latest numpy, scipy and matplotlib from sources, making sure 'python setup.py install' was invoking the self-installed python
- Installed ipython and whatnot using easy_install
I haven't tested this extensively, but seems to work fine for terminal work at least. Can't see why this would upset the system python in any way, and also root privileges are not needed for this method.]]>
http://blog.hyperjeff.net/?p=160#comment689
Sun, 01 Nov 2009 10:07:05 -0600http://blog.hyperjeff.net/?p=160#comment689Ben In case anyone else had the same problem: python was giving me a segfault whenever I tried to import a scipy subpackage. It turns out I had forgotten to fix my PYTHONPATH since I upgraded. Added that to .profile and everything is good!]]>
http://blog.hyperjeff.net/?p=160#comment691
Tue, 03 Nov 2009 13:16:00 -0600http://blog.hyperjeff.net/?p=160#comment691Martin
http://blog.hyperjeff.net/?p=160#comment692
Wed, 04 Nov 2009 07:15:33 -0600http://blog.hyperjeff.net/?p=160#comment692rui As a python 'newbie' & after many hours...I suceeded to follow untill 'numpy' installatiion. I did not complete the installation of 'scipy' nor 'mpl'. No apparent problems with 'ipython' installation.
Any further suggestions ? Perhaps another relevant question is what is the most effective way of verifying & cleaning previously installed python/numpy/mlp/ipython installations ?
The error in the scipy instalation seems to be related with the architecture type: ..... lipo: can't figure out the architecture type of: /var/tmp//cchBKN4l.out error: Command "c++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -Iscipy/interpolate/src -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c scipy/interpolate/src/_interpolate.cpp -o build/temp.macosx-10.3-fat-2.6/scipy/interpolate/src/_interpolate.o" failed with exit status 1
...Similar issues seem to occur in mpl installation process: .... ld: warning: in /sw/lib/libfreetype.dylib, file is not of required architecture ld: in /sw/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//ccyJmjBJ.out (No such file or directory) error: command 'c++' failed with exit status 1 ]]>
http://blog.hyperjeff.net/?p=160#comment693
Fri, 06 Nov 2009 15:40:07 -0600http://blog.hyperjeff.net/?p=160#comment693colourful.jp
This article is helpful to me.]]>
http://blog.hyperjeff.net/?p=160#comment694
Fri, 06 Nov 2009 22:58:28 -0600http://blog.hyperjeff.net/?p=160#comment694Jeff You guys are also putting my little blog system to a good test, so let me know if you think there is some particularly useful feature that it could use to make discussions such as this be smoother. For instance, I'll add email subscriptions to the forum discussions, but if you have a good idea, email me using the link at the very top of the page.]]>
http://blog.hyperjeff.net/?p=160#comment695
Sat, 07 Nov 2009 21:15:12 -0600http://blog.hyperjeff.net/?p=160#comment695Jeff As with Johnny, I have been unable to compile SciPy from any source while the /System NumPy is in place. Changes to PYTHONPATH, which do help python to use the right NumPy when I was testing things, are insufficient for me to compile SciPy. The only solution, which is surely wrong, has been to move the /System NumPy out of the way temporarily. I run into exactly the same show-stopping error mentioned by rui otherwise.
I have tried the method mentioned of compiling matplotlib by updating setupext.py, but then found that there was no libfreetype to link against, leading to errors like those found by Niall, so I stuck with my method of editing the make.osx file and things like import matplotlib.pyplot then work fine. (This should also fix rui's libfreetype error.)
I have also noted and used syncolo's edits to make sure that gfortran creates 32/64-bit binaries and have updated the article accordingly. Not sure if this ends up making a difference here, but it's good to get things correct.
That said, as Richard brought up way up there, one still cannot get this stack to run with python in 32-bit mode. Drivin' me crazy. Anyone able to figure this out?
Xavier, sorry about losing some of your comments to the spam filter, but happy that things are working. Let me know (anyone) if comments get lost and I can dig them out if desired.
I should mention, for those following the RSS feed for this discussion forum, that the SciPy SuperPack is now available for 64-bit Snow Leopard builds, and is really fantastically simple to install. Had it been available for me, I'd have never ended up writing this entry, but at least I learned a lot and can now boldly build other things in this area, and of course be of help to others.]]>
http://blog.hyperjeff.net/?p=160#comment696
Tue, 10 Nov 2009 03:41:41 -0600http://blog.hyperjeff.net/?p=160#comment696Stefan I wanted to report that I had success with the idea to put
'darwin' : ,
to get the freetype headers in the compliation of matplotlib. Niall's command did not cause a crash and the commands from the frontpage of the matplotlib homepage produce a histogram as they should.
gfortran chocked on "-arch ppc" but applying the patch from [link] or upgrading to latest version of gfortran fixed that.
Running np.test() produced no errors but scipy.test() produced 8 but I got rid of seven of them by applying the changes suggested here [link] (with np instead of nm). I didn't investigate the remaining error.
Finally, it is possible that the problems you had with the quad tutorial examples simply stem from the line
from math import exp
which would more robustly be
from numpy import exp]]>
http://blog.hyperjeff.net/?p=160#comment697
Mon, 16 Nov 2009 15:58:40 -0600http://blog.hyperjeff.net/?p=160#comment697Darren
//Build Verdict with shared libraries. BUILD_SHARED_LIBS:BOOL=ON
//Build architectures for OSX CMAKE_OSX_ARCHITECTURES:STRING=x86_64
//Minimum OS X version to target for deployment (at runtime); newer // APIs weak linked. Set to empty string for default value. CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6
//Build shared libraries with rpath. This makes it easy to run // executables from the build tree when using shared libraries, // but removes install support. VTK_USE_RPATH:BOOL=ON
//Wrap VTK classes into the Python language. VTK_WRAP_PYTHON:BOOL=ON
//Arguments passed to "python setup.py install ..." during installation. VTK_PYTHON_SETUP_ARGS:STRING=
Next, I ran "export MACOSX_DEPLOYMENT_TARGET=10.6", but this may not have been necessary. Run "make -j 2" Run "sudo make install"
After that I was able to install Mayavi in the usual way.]]>
http://blog.hyperjeff.net/?p=160#comment701
Thu, 19 Nov 2009 10:52:28 -0600http://blog.hyperjeff.net/?p=160#comment701Darren
http://blog.hyperjeff.net/?p=160#comment702
Thu, 19 Nov 2009 11:07:05 -0600http://blog.hyperjeff.net/?p=160#comment702Christian Regarding the comment from Sergei, I had the same problem that the matplotlib library was not found. I saw that it was placed in the folder /usr/local/lib/python2.6/site-packages instead of the PYTHONPATH at /Library/Python/2.6/site-packages.
I made the quick and dirty fix by copying the files into this folder as well, and now everything works like a charm. Thanks very much. I can be productive again!]]>
http://blog.hyperjeff.net/?p=160#comment703
Fri, 20 Nov 2009 06:44:18 -0600http://blog.hyperjeff.net/?p=160#comment703Darren
http://blog.hyperjeff.net/?p=160#comment704
Fri, 20 Nov 2009 13:47:58 -0600http://blog.hyperjeff.net/?p=160#comment704Michael lipo: can't figure out the architecture type of: /var/tmp//ccmaLUEy.out error: Command "c++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -Iscipy/interpolate/src -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c scipy/interpolate/src/_interpolate.cpp -o build/temp.macosx-10.3-fat-2.6/scipy/interpolate/src/_interpolate.o" failed with exit status 1
It appears that for some reason the scipy install is not looking for the right version of one of the compilers (or something along those lines).
Does anyone have any ideas?
thanks.
]]>
http://blog.hyperjeff.net/?p=160#comment705
Tue, 24 Nov 2009 02:16:29 -0600http://blog.hyperjeff.net/?p=160#comment705Jeff
http://blog.hyperjeff.net/?p=160#comment706
Tue, 24 Nov 2009 02:44:24 -0600http://blog.hyperjeff.net/?p=160#comment706Michael
http://blog.hyperjeff.net/?p=160#comment707
Tue, 24 Nov 2009 03:09:39 -0600http://blog.hyperjeff.net/?p=160#comment707Jeff
http://blog.hyperjeff.net/?p=160#comment708
Tue, 24 Nov 2009 22:17:29 -0600http://blog.hyperjeff.net/?p=160#comment708Michael Now, unfortunately I am having another problem. Everything built properly, but I can't seem to import what I need from actual python code. I get the following error:
from scipy.linalg import norm, inv File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/linalg/__init__.py", line 8, in from basic import * File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/linalg/basic.py", line 17, in from lapack import get_lapack_funcs File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/linalg/lapack.py", line 17, in from scipy.linalg import flapack ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/linalg/flapack.so, \ 2): Symbol not found: _f2pywrapdlamch_ Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/linalg/flapack.so Expected in: dynamic lookup
Does this look familiar?
Thanks for all of your help.]]>
http://blog.hyperjeff.net/?p=160#comment711
Tue, 24 Nov 2009 22:31:24 -0600http://blog.hyperjeff.net/?p=160#comment711Martin
Zachary Voase's blog.]]>
http://blog.hyperjeff.net/?p=160#comment712
Tue, 24 Nov 2009 22:37:56 -0600http://blog.hyperjeff.net/?p=160#comment712Mark
http://blog.hyperjeff.net/?p=160#comment713
Wed, 25 Nov 2009 00:23:27 -0600http://blog.hyperjeff.net/?p=160#comment713Lisa I've been able to install matplotlib following these steps. However, I am having a problem plotting. I get the following error when I try to do a simple plot (i.e. plot()):
File "/Users/lisa/.local/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 158, in __init__ master=self._tkcanvas, width=w, height=h) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 3284, in __init__ Image.__init__(self, 'photo', name, cnf, master, **kw) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 3240, in __init__ self.tk.call(('image', 'create', imgtype, name,) + options) TclError: integer value too large to represent
Does anyone know what is causing my problem?
Thanks.]]>
http://blog.hyperjeff.net/?p=160#comment714
Fri, 04 Dec 2009 11:23:00 -0600http://blog.hyperjeff.net/?p=160#comment714Jun T. As pointed out by may people here, sudo resets PYTHONPATH and causes some problems, unless you modify sudoers as suggested by Darren.
I just want to point out that, if you are using Apple's python, and if you have an admin privilege then you need not sudo when you do 'setup.py install'; admin group has write permission of /Library/Python/ (and its sub directories).
Forgive me if this is well known.]]>
http://blog.hyperjeff.net/?p=160#comment715
Wed, 16 Dec 2009 03:41:27 -0600http://blog.hyperjeff.net/?p=160#comment715Jun T.
http://blog.hyperjeff.net/?p=160#comment716
Wed, 16 Dec 2009 03:44:07 -0600http://blog.hyperjeff.net/?p=160#comment716Jun T.
stops the boldface...]]>
http://blog.hyperjeff.net/?p=160#comment717
Wed, 16 Dec 2009 03:47:10 -0600http://blog.hyperjeff.net/?p=160#comment717Jeff (I quickly edited your 1st comment to fix the bold tag issue. I do need to add a preview to comments. Perhaps even a nice "live" preview. Again, when I get some free time.)]]>
http://blog.hyperjeff.net/?p=160#comment718
Wed, 16 Dec 2009 03:49:10 -0600http://blog.hyperjeff.net/?p=160#comment718Chris http://projects.scipy.org/numpy/ticket/1343
Until this is fixed, and I have little reason to be optimistic that it will, there will be no new builds of the Scipy Superpack.]]>
http://blog.hyperjeff.net/?p=160#comment721
Sun, 27 Dec 2009 19:01:45 -0600http://blog.hyperjeff.net/?p=160#comment721Jeff
http://blog.hyperjeff.net/?p=160#comment722
Sun, 27 Dec 2009 19:28:37 -0600http://blog.hyperjeff.net/?p=160#comment722Domingo I had the MacPython distribution installed and it made impossible to compile PyQt4. After uninstalling MacPython everything went fine.
To uninstall MacPython: Remove /Library/Frameworks/Python.framework and everything in it; remove /Applications/MacPython-2.3 and everything in it; in /usr/local/bin, remove idle, idle2.5, pydoc, pydoc2.5, python, python-config, python2.5, python2.5-config, pythonw, pythonw2.5, smtpd.py, smtpd2.5.py.
(Taken from [link] and [link] )]]>
http://blog.hyperjeff.net/?p=160#comment724
Fri, 29 Jan 2010 10:34:39 -0600http://blog.hyperjeff.net/?p=160#comment724Franck Seriously, I'm completely new to mac (with a fair experience with Linux), and have been pulling my hair to get all that to work. Followed your post step by step and it worked perfectly. You just saved my sanity, thanks !!]]>
http://blog.hyperjeff.net/?p=160#comment725
Thu, 11 Feb 2010 09:46:06 -0600http://blog.hyperjeff.net/?p=160#comment725Jeff
http://blog.hyperjeff.net/?p=160#comment726
Thu, 11 Feb 2010 12:22:20 -0600http://blog.hyperjeff.net/?p=160#comment726Tomek
http://blog.hyperjeff.net/?p=160#comment727
Mon, 22 Feb 2010 16:02:51 -0600http://blog.hyperjeff.net/?p=160#comment727Adam I get the following error: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/_path.so, 2): Symbol not found: ___emutls_get_address
Any tips? I've been trying to hunt this down for hours and am now just frustrated.
Thanks.]]>
http://blog.hyperjeff.net/?p=160#comment735
Thu, 04 Mar 2010 22:55:44 -0600http://blog.hyperjeff.net/?p=160#comment735ChrisC Thanks so much for this. After a bit of messing around, and largely thanks to this excellent tutorial, I've got things working well.
Quick question. I'm currently running python 2.6.1. Being a python newbie, I'm not sure if upgrading python to 2.6.4 (or 3) will break everything so far. Is it possible to upgrade and still use numpy and scipy? Or will upgrading require a complete rebuild? ]]>
http://blog.hyperjeff.net/?p=160#comment736
Sun, 07 Mar 2010 06:40:32 -0600http://blog.hyperjeff.net/?p=160#comment736Tsuname
http://blog.hyperjeff.net/?p=160#comment741
Thu, 11 Mar 2010 03:09:50 -0600http://blog.hyperjeff.net/?p=160#comment741Marcelo python setup.py build --fcompiler=gnu95
The message was:
"Cannot compiler 'Python.h'. Perhaps you need to "\ SystemError: Cannot compiler 'Python.h'. Perhaps you need to install python-dev|python-devel.
Thanks a lot ! Marcelo]]>
http://blog.hyperjeff.net/?p=160#comment742
Mon, 15 Mar 2010 00:41:09 -0500http://blog.hyperjeff.net/?p=160#comment742Renaud
http://blog.hyperjeff.net/?p=160#comment743
Mon, 15 Mar 2010 21:49:23 -0500http://blog.hyperjeff.net/?p=160#comment743Prasanna Kumar Thiagarajan
The prob that I get while installing the matplot is :
REQUIRED DEPENDENCIES numpy: 2.0.0.dev8307 freetype2: found, but unknown version (no pkg-config) * WARNING: Could not find 'freetype2' headers in any * of '.', './freetype2'. and after this I get a list of errors while trying to build all the '.h' and '.cpp' files resulting in spitting out " make: *** Error 1" finally.
I tried all that was posted about regarding freetype2 , but the prob still exists.. Kindly help me out here.
Many thanks. Prasanna]]>
http://blog.hyperjeff.net/?p=160#comment746
Tue, 30 Mar 2010 17:35:16 -0500http://blog.hyperjeff.net/?p=160#comment746Ben fyi, for matplotlib, i just did sudo make -f make.osx mpl_build mpl_install. I had all the dependencies installed and it gave me problems when i tried fetch and deps
Also, for 64-bit python, I had to compile (2.6.5) from source with ./configure --enable-framework --enable-universalsdk=/ --with-universal-archs=intel make sudo make install]]>
http://blog.hyperjeff.net/?p=160#comment747
Sat, 03 Apr 2010 20:33:41 -0500http://blog.hyperjeff.net/?p=160#comment747Ben CFLAGS=-isysroot /Developer/SDKs/MacOSX10.6u.sdk -arch i386 -arch x86_64 -I/usr/local/include -I/usr/local/include/freetype2 LDFLAGS=-arch i386 -arch x86_64 -L/usr/local/lib
edit makefile, remove zlib from freetype and png edit setupext.py, change darwin path to '/usr/local',/usr/local/lib' edit setupext.py to include this change
def add_ft2font_flags(module): 'Add the module flags to ft2font extension' add_numpy_flags(module) if not get_pkgconfig(module, 'freetype2'): module.libraries.extend() add_base_flags(module)
basedirs = module.include_dirs # copy the list to avoid inf loop! # include dir is wrong, set manually #for d in basedirs: # module.include_dirs.append(os.path.join(d, 'freetype2')) # p = os.path.join(d, 'lib/freetype2/include') # if os.path.exists(p): module.include_dirs.append(p) # p = os.path.join(d, 'lib/freetype2/include/freetype2') # if os.path.exists(p): module.include_dirs.append(p) p = '/usr/local/include/freetype2'
then build everything
sudo make -f make.osx fetch freetype png mpl_build mpl_install sudo python setup.py install]]>
http://blog.hyperjeff.net/?p=160#comment748
Sun, 04 Apr 2010 00:52:58 -0500http://blog.hyperjeff.net/?p=160#comment748Megan Using gfortran 4.5 I was receiving the following error when I tried to import any of the scipy sub-packages:
dlopen(/Users/mkaralus/lib/python/scipy/odr/__odrpack.so, 2): no suitable image found. Did find: /Users/mkaralus/lib/python/scipy/odr/__odrpack.so: mach-o, but wrong architecture
After I reverted the gfortran compiler, deleted all previous installs and source directories, re-downloaded, re-built and re-installed numpy and scipy (after re-making UMFPACK) I successfully ridded myself of the error. It's too bad gfortran is buggy like that. ]]>
http://blog.hyperjeff.net/?p=160#comment749
Mon, 05 Apr 2010 14:48:48 -0500http://blog.hyperjeff.net/?p=160#comment749Faye Thank you for the helpful tips. Everything is fine until make matplotlib. I got the following errors:
And I use OS X 10.6.2, matplotlib 0.99.1.1. Please help me. Many thanks.
Faye ]]>
http://blog.hyperjeff.net/?p=160#comment750
Thu, 15 Apr 2010 00:22:40 -0500http://blog.hyperjeff.net/?p=160#comment750Souheil Inati
UMFPACK_CONFIG = -DNCHOLMOD at line 154 of UFconfig/UFconfig.mk
Has anyone else seen this behavior?
-Souheil ]]>
http://blog.hyperjeff.net/?p=160#comment751
Wed, 21 Apr 2010 12:28:19 -0500http://blog.hyperjeff.net/?p=160#comment751Megan (1) Use the stable distribution from sourceforge, not what's pulled from the subversion repository.
(2) Change ZLIBVERSION=1.2.5 (The 1.2.3 version pulled from the zlib website won't uncompress properly)
(3) If you have installed numpy 2.0 you must change setupext.py. The way the code checks for the proper numpy verison (greater than 1.1) is buggy for version 2.0. i.e. For 2.0, 2>=1 but 0 isn't yet 2.0 is definitely greater than 1.1. Change Line 495 from
if not (int(nn) >= 1 and int(nn) >= 1):
to
if not (int(nn) >= 1):
Make the same change on line 149 in lib/matplotlib/__init__.py
Now run the make command listed above.
Good luck!]]>
http://blog.hyperjeff.net/?p=160#comment752
Wed, 21 Apr 2010 20:02:42 -0500http://blog.hyperjeff.net/?p=160#comment752S.V. 1) Update the Python to the version 2.6.5 in your machine.
Python 2.6.5 Mac OS X Installer Disk Image (for Mac OS X 10.3 through 10.6) [link] /> 2) Modify the environment variable $PATH in order that the first entry be: /Library/Frameworks/Python.framework/Versions/2.6/bin
3)In the terminal, type: which python This is a check to see if step 2 was done correctly.
4)Download the package setuptools-0.6c11-py2.6.egg http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086
5)In the terminal, type: sh setuptools-0.6c11-py2.6.egg
6)In the terminal, type: which easy_install-2.6
7)Download the package ipython-0.10-py2.6.egg http://ipython.scipy.org/dist/0.10/ipython-0.10-py2.6.egg
8)In the terminal, type: easy_install-2.6 ipython-0.10-py2.6.egg
9)Download and install the package numpy http://sourceforge.net/projects/numpy/files/NumPy/1.4.1/numpy-1.4.1-py2.6-python.org.dmg/download
10)Download and install the package scipy http://sourceforge.net/projects/scipy/files/scipy/0.7.2/scipy-0.7.2-py2.6-python.org.dmg/download
11)Install the package matplotlib http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/matplotlib-0.99.1.1-py2.6-macosx10.5.dmg/download ]]>
http://blog.hyperjeff.net/?p=160#comment759
Sun, 23 May 2010 17:03:05 -0500http://blog.hyperjeff.net/?p=160#comment759PV
Thanks]]>
http://blog.hyperjeff.net/?p=160#comment760
Fri, 04 Jun 2010 20:36:41 -0500http://blog.hyperjeff.net/?p=160#comment760Marco
The trick was to build matplotlib using universal (32b & 64b) versions of libpng,zlib, and freetype. I obtained this packages using macports. For instance to install freetype I use sudo port install freetype +universal Try it and have fun! Marco]]>
http://blog.hyperjeff.net/?p=160#comment761
Sat, 05 Jun 2010 00:31:32 -0500http://blog.hyperjeff.net/?p=160#comment761Ranjit ../Source/umf_cholmod.c:18:21: error: cholmod.h: No such file or directory ../Source/umf_cholmod.c: In function ‘umf_i_cholmod’: ../Source/umf_cholmod.c:58: error: ‘cholmod_sparse’ undeclared (first use in this function) ../Source/umf_cholmod.c:58: error: (Each undeclared identifier is reported only once ../Source/umf_cholmod.c:58: error: for each function it appears in.) ../Source/umf_cholmod.c:58: error: expected ‘;’ before ‘Amatrix’ ../Source/umf_cholmod.c:59: error: ‘cholmod_factor’ undeclared (first use in this function) ../Source/umf_cholmod.c:59: error: ‘L’ undeclared (first use in this function) ../Source/umf_cholmod.c:60: error: ‘cholmod_common’ undeclared (first use in this function) ../Source/umf_cholmod.c:60: error: expected ‘;’ before ‘cm’ ../Source/umf_cholmod.c:81: error: ‘cm’ undeclared (first use in this function) ../Source/umf_cholmod.c:82: error: ‘CHOLMOD_SIMPLICIAL’ undeclared (first use in this function) ../Source/umf_cholmod.c:93: error: ‘CHOLMOD_AMD’ undeclared (first use in this function) ../Source/umf_cholmod.c:93: error: ‘CHOLMOD_COLAMD’ undeclared (first use in this function) ../Source/umf_cholmod.c:100: error: ‘CHOLMOD_METIS’ undeclared (first use in this function) ../Source/umf_cholmod.c:110: error: ‘CHOLMOD_NATURAL’ undeclared (first use in this function) ../Source/umf_cholmod.c:120: error: ‘CHOLMOD_NESDIS’ undeclared (first use in this function) ../Source/umf_cholmod.c:144: error: ‘A’ undeclared (first use in this function) ../Source/umf_cholmod.c:144: error: ‘Amatrix’ undeclared (first use in this function) ../Source/umf_cholmod.c:157: error: ‘CHOLMOD_INT’ undeclared (first use in this function) ../Source/umf_cholmod.c:158: error: ‘CHOLMOD_PATTERN’ undeclared (first use in this function) ../Source/umf_cholmod.c:159: error: ‘CHOLMOD_DOUBLE’ undeclared (first use in this function) ../Source/umf_cholmod.c:170: error: ‘AT’ undeclared (first use in this function) ../Source/umf_cholmod.c:171: error: ‘S’ undeclared (first use in this function) ../Source/umf_cholmod.c:202: error: ‘CHOLMOD_GIVEN’ undeclared (first use in this function) ../Source/umf_cholmod.c:18:21: error: cholmod.h: No such file or directory ../Source/umf_cholmod.c: In function ‘umf_i_cholmod’: ../Source/umf_cholmod.c:58: error: ‘cholmod_sparse’ undeclared (first use in this function) ../Source/umf_cholmod.c:58: error: (Each undeclared identifier is reported only once ../Source/umf_cholmod.c:58: error: for each function it appears in.) ../Source/umf_cholmod.c:58: error: expected ‘;’ before ‘Amatrix’ ../Source/umf_cholmod.c:59: error: ‘cholmod_factor’ undeclared (first use in this function) ../Source/umf_cholmod.c:59: error: ‘L’ undeclared (first use in this function) ../Source/umf_cholmod.c:60: error: ‘cholmod_common’ undeclared (first use in this function) ../Source/umf_cholmod.c:60: error: expected ‘;’ before ‘cm’ ../Source/umf_cholmod.c:81: error: ‘cm’ undeclared (first use in this function) ../Source/umf_cholmod.c:82: error: ‘CHOLMOD_SIMPLICIAL’ undeclared (first use in this function) ../Source/umf_cholmod.c:93: error: ‘CHOLMOD_AMD’ undeclared (first use in this function) ../Source/umf_cholmod.c:93: error: ‘CHOLMOD_COLAMD’ undeclared (first use in this function) ../Source/umf_cholmod.c:100: error: ‘CHOLMOD_METIS’ undeclared (first use in this function) ../Source/umf_cholmod.c:110: error: ‘CHOLMOD_NATURAL’ undeclared (first use in this function) ../Source/umf_cholmod.c:120: error: ‘CHOLMOD_NESDIS’ undeclared (first use in this function) ../Source/umf_cholmod.c:144: error: ‘A’ undeclared (first use in this function) ../Source/umf_cholmod.c:144: error: ‘Amatrix’ undeclared (first use in this function) ../Source/umf_cholmod.c:157: error: ‘CHOLMOD_INT’ undeclared (first use in this function) ../Source/umf_cholmod.c:158: error: ‘CHOLMOD_PATTERN’ undeclared (first use in this function) ../Source/umf_cholmod.c:159: error: ‘CHOLMOD_DOUBLE’ undeclared (first use in this function) ../Source/umf_cholmod.c:170: error: ‘AT’ undeclared (first use in this function) ../Source/umf_cholmod.c:171: error: ‘S’ undeclared (first use in this function) ../Source/umf_cholmod.c:202: error: ‘CHOLMOD_GIVEN’ undeclared (first use in this function) lipo: can't figure out the architecture type of: /var/folders/70/70pV-+FxFmyoJ7Qp1QdRcE+++TM/-Tmp-//ccrxhS1q.out make: *** Error 1 make: *** Error 2]]>
http://blog.hyperjeff.net/?p=160#comment765
Fri, 25 Jun 2010 13:43:59 -0500http://blog.hyperjeff.net/?p=160#comment765Theo
http://blog.hyperjeff.net/?p=160#comment766
Sat, 26 Jun 2010 20:34:25 -0500http://blog.hyperjeff.net/?p=160#comment766Jeff
Ranjit and Theo. I wonder what has changed to have excluded the umf_cholmod.c file. I'll try to track this down. This must be something that has happened recently.]]>
http://blog.hyperjeff.net/?p=160#comment767
Sat, 26 Jun 2010 20:47:19 -0500http://blog.hyperjeff.net/?p=160#comment767Theo
I didn't try installing CHOLMOD yet, but setting UMFPACK_CONFIG = -DNCHOLMOD does fix my problem. ]]>
http://blog.hyperjeff.net/?p=160#comment768
Sat, 26 Jun 2010 21:41:29 -0500http://blog.hyperjeff.net/?p=160#comment768Grace I've been trying to setup numpy and scipy to use pytables. I tried a dozen methods, including the ones that are list in Jeff's blog. SV's method is the only current working method. I would not suggest trying to compile numpy on snow leopard from source. See below for details.
I am running Snow Leopard 10.6.4 Running python 2.6.1
First, just to confirm some of the other posters from around May-June 2010, yes I also could not compile UMFPACK because of the missing ../Source/umf_cholmod.c:18:21: error: cholmod.h It used to work once upon a time, but then I guess stuff happened. Someone needs to submit a patch for it :)
Second, I"ve tried installing numpy-1.4.1 using easy_install on top of python v2.6.1. This fails miserably when compiling, even after I installed gfortran successfully and setting the architecture to x86_64 etc. Although easy_install seems to indicate that it 'installed' (if you ignore the billions of warnings), only numpy version 1.2.1 can be imported.
Then I tried install numpy-1.4.1 dmg ontop of python 2.6.1, but I get the 'need System python at version 2.6' error from the installer.
Furthermore, I've also installed python 2.7 from python.org for mac os x. Note: numpy dmg works ONLY at 2.6 not 2.6 or greater. Trying to compile numpy from source or using easy_install-2.7 etc still fails probably because of UMFPACK not being able to compile properly.
FINALLY, the solution that worked was SV's solution (Date (Sun, May 23rd, 2010, 5:03pm CDT)) The key was upgrading to python 2.6.5. That seemed to have worked.]]>
http://blog.hyperjeff.net/?p=160#comment782
Wed, 28 Jul 2010 10:23:24 -0500http://blog.hyperjeff.net/?p=160#comment782Rahul
Was trying for oh so long to get scipy to work on Snow Leopard. ]]>
http://blog.hyperjeff.net/?p=160#comment783
Thu, 29 Jul 2010 14:13:18 -0500http://blog.hyperjeff.net/?p=160#comment783Matthew curl -O [link] /> instead of:
curl -O [link] />]]>
http://blog.hyperjeff.net/?p=160#comment786
Thu, 26 Aug 2010 05:41:10 -0500http://blog.hyperjeff.net/?p=160#comment786Google Reklamları
Was trying for oh so long to get scipy to work on Snow Leopard. ]]>
http://blog.hyperjeff.net/?p=160#comment789
Sun, 05 Sep 2010 18:26:10 -0500http://blog.hyperjeff.net/?p=160#comment789web tasarım ankara
Thank you so much S.V. for your instructions. Was trying for oh so long to get scipy to work on Snow Leopard.
It helps me to build my fftw-3.2.2, numpy1.4.1 and scipy0.8.0 package from source in Opensue 11.1. My system has python2.4.4, numpy1.4.1 and scipy0.8.0 now.
I have gfortran4.3 installed in my system. Only set environment variables using export CFLAG='-m64' epxort FFLAG='-m64' when build scipy.
Yi ]]>
http://blog.hyperjeff.net/?p=160#comment791
Tue, 05 Oct 2010 11:53:01 -0500http://blog.hyperjeff.net/?p=160#comment791Gilles First, thank you S.V. for the description!
Second, I was wondering if any of you experienced a modification of Snow Leopard after having installed all these packages. My computer is now taking ages to start ! The first part of the boot (the one until the login menu) seems to take the same time, but after having login, Snow Leopard is freezing.
Note that when using the safe mode, the boot time after login comes back to normal.
Does anybody know the reason for that, and a possible solution ?!
Thanks in advance for your answer, Gilles]]>
http://blog.hyperjeff.net/?p=160#comment796
Thu, 28 Oct 2010 03:56:51 -0500http://blog.hyperjeff.net/?p=160#comment796Joe
http://blog.hyperjeff.net/?p=160#comment798
Sun, 28 Nov 2010 11:45:04 -0600http://blog.hyperjeff.net/?p=160#comment798John Harrison All of this has taken me about a day and a half. The state of these tools on snow leopard is really unfortunate.]]>
http://blog.hyperjeff.net/?p=160#comment807
Wed, 27 Apr 2011 14:48:16 -0500http://blog.hyperjeff.net/?p=160#comment807ankara web tasarım
http://blog.hyperjeff.net/?p=160#comment808
Tue, 17 May 2011 07:20:46 -0500http://blog.hyperjeff.net/?p=160#comment808ankara düğün salonu
Was trying for oh so long to get scipy to work on Snow Leopard.]]>
http://blog.hyperjeff.net/?p=160#comment810
Sat, 04 Jun 2011 02:58:41 -0500http://blog.hyperjeff.net/?p=160#comment810ankara dalgıç pompa
http://blog.hyperjeff.net/?p=160#comment811
Sat, 04 Jun 2011 02:59:14 -0500http://blog.hyperjeff.net/?p=160#comment811google reklam ankara
http://blog.hyperjeff.net/?p=160#comment812
Sun, 19 Jun 2011 19:42:55 -0500http://blog.hyperjeff.net/?p=160#comment812Marcel When I try to install on my Mac OS 10.6.7 and Python 2.6.5 , it gives an error in the compilation of UMFPACK:
(This was on Lion but should be the same on Snow Leopard.)
[code]]]>
http://blog.hyperjeff.net/?p=160#comment820
Fri, 18 Nov 2011 04:47:02 -0600http://blog.hyperjeff.net/?p=160#comment820Marcelino Suzuki
curl -O [link] />since this does not exists any longer
So I also tried instructions from [link] and kept getting the error:
ld: library not found for -lrt
basically I dowload the current version of Suitesparse at
Save the file and replace it as SuiteSparse_config.mk
THIS LAST STEP IS QUITE IMPORTANT, since just changing the SuiteSparse to include the SuiteSparse/SuiteSparse_config_Mac.mk will keep giving the annoying error:
ld: library not found for -lrt
I then edited the makefile to compile just - ( cd SuiteSparse_config/xerbla && $(MAKE) ) - ( cd SuiteSparse_config && $(MAKE) ) - ( cd UMFPACK && $(MAKE) )
then
make make hb make install
]]>
http://blog.hyperjeff.net/?p=160#comment850
Fri, 21 Sep 2012 06:53:17 -0500http://blog.hyperjeff.net/?p=160#comment850Subito All of this has taken me about a day and a half. The state of these tools on snow leopard is really unfortunate.]]>
http://blog.hyperjeff.net/?p=160#comment851
Mon, 19 Nov 2012 19:19:29 -0600http://blog.hyperjeff.net/?p=160#comment851seth williams
http://blog.hyperjeff.net/?p=160#comment869
Thu, 28 Aug 2014 09:59:07 -0500http://blog.hyperjeff.net/?p=160#comment869