![](https://secure.gravatar.com/avatar/034c45818b28060dd0fce40e84781fa7.jpg?s=120&d=mm&r=g)
Hi, I got a new job, and a new mac book pro on which I just installed Mac OS X 10.8. I need to run SWIG to generate a shared object from C++ source that works with numpy.i. I'm considering installing the Scipy Superpack, but I have a question. If I install the Scipy Superpack, which has most of the packages I need, plus some others, will it be able to find "numpy/arrayobject.h" or do I need to install numpy source and build it myself? In other words, does "numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg" have the source files needed by gcc to compile the swig-generated C++ wrapper? Cheers, Tom
![](https://secure.gravatar.com/avatar/5dde29b54a3f1b76b2541d0a4a9b232c.jpg?s=120&d=mm&r=g)
On Mon, Aug 6, 2012 at 8:51 PM, Tom Krauss <thomas.p.krauss@gmail.com> wrote:
I got a new job, and a new mac book pro on which I just installed Mac OS X 10.8.
congrats -- on the job, and on an employer that gets you a mac!
I need to run SWIG to generate a shared object from C++ source that works with numpy.i. I'm considering installing the Scipy Superpack, but I have a question. If I install the Scipy Superpack, which has most of the packages I need, plus some others, will it be able to find "numpy/arrayobject.h"
It's probably there, yes, and you should be able to find it with: numpy.get_include() (use that in your setup.py)
the source files needed by gcc to compile the swig-generated C++ wrapper?
The trick here is which gcc -- Apple is fast to move forward, is on the bleeding edge with gcc -- the latest XCode uses LLVM, which is not compatible with older Python builds. I *think* the superpack is build against the pyton.org python builds (32 bit?) Anyway, the python,org 32 bit build requires an older gcc for building extensions -- you can get XCode 3from Apple Developer connection if you dig for it -- it works fine on 10.7, I hope it does on 10.8. I'm not totally sure about the 32/64 bit Intel build. The pythonmac list will be a help here. Good luck, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
![](https://secure.gravatar.com/avatar/4fc11d72fb1974e943174c8ca2fa8765.jpg?s=120&d=mm&r=g)
A little off-topic, but related: Which python version do you recommend to install in Mac OS X 10.8? The native one? The one from python.org? or the one compiled via homebrew? And do you think it's better to use the 32 or 64 bits? Thanks! On Tue, Aug 7, 2012 at 12:35 PM, Chris Barker <chris.barker@noaa.gov> wrote:
On Mon, Aug 6, 2012 at 8:51 PM, Tom Krauss <thomas.p.krauss@gmail.com> wrote:
I got a new job, and a new mac book pro on which I just installed Mac OS X 10.8.
congrats -- on the job, and on an employer that gets you a mac!
I need to run SWIG to generate a shared object from C++ source that works with numpy.i. I'm considering installing the Scipy Superpack, but I have a question. If I install the Scipy Superpack, which has most of the packages I need, plus some others, will it be able to find "numpy/arrayobject.h"
It's probably there, yes, and you should be able to find it with:
numpy.get_include()
(use that in your setup.py)
the source files needed by gcc to compile the swig-generated C++ wrapper?
The trick here is which gcc -- Apple is fast to move forward, is on the bleeding edge with gcc -- the latest XCode uses LLVM, which is not compatible with older Python builds.
I *think* the superpack is build against the pyton.org python builds (32 bit?)
Anyway, the python,org 32 bit build requires an older gcc for building extensions -- you can get XCode 3from Apple Developer connection if you dig for it -- it works fine on 10.7, I hope it does on 10.8.
I'm not totally sure about the 32/64 bit Intel build.
The pythonmac list will be a help here.
Good luck,
-Chris
--
Christopher Barker, Ph.D. Oceanographer
Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
![](https://secure.gravatar.com/avatar/5f88830d19f9c83e2ddfd913496c5025.jpg?s=120&d=mm&r=g)
On Tue, Aug 7, 2012 at 6:05 PM, Thiago Franco Moraes <totonixsame@gmail.com>wrote:
A little off-topic, but related: Which python version do you recommend to install in Mac OS X 10.8? The native one? The one from python.org? or the one compiled via homebrew? And do you think it's better to use the 32 or 64 bits?
Depends on what you want to do / what packages you want to use. Perhaps python.org + official installers (dmgs from Sourceforge), perhaps EPD / SciPy Superpack / .... Without knowing more, I would just advise to not use Apple Python, and to use binary installers (10.8 is so fresh, you'll likely run into a few issues with source installs). Ralf
![](https://secure.gravatar.com/avatar/034c45818b28060dd0fce40e84781fa7.jpg?s=120&d=mm&r=g)
I'm on 10.8 and am using the Apple Mac OS X Mountain Lion python (2.7.2). Here's what I ended up doing, FWIW: - I installed "pip" (sudu easy_install pip) - I installed virtualenv - created a new virtual environment [recommended since superpack installs a bunch of development versions of the packages and updates fairly often] - ran the scipy superpack install script - it installed DateUtils 0.5.2, which is way old - I removed it and installed 1.5 instead (with easy_install python-dateutil==1.5) Result: ipython and SWIG are now running just fine for my code, but I got some errors in the scipy tests which I need to follow up on. Also, I got a message that gfortran failed to install because I didn't sudo since I thought I didn't need to because I was installing to a virtual environment. Not sure if scipy errors are related to gfortran missing. Thanks to Mr. Chris Fonnesbeck for publishing the Scipy Superpack, you saved me a ton of time! The answer to my specific question is that yes, the arrayobject.h header is included in the numpy egg, which is easy to see since eggs are really just directories (last night I thought they were some kind of binary)! Further note, I had to change ipython's "pylab" setting to "osx". On Tue, Aug 7, 2012 at 1:07 PM, Ralf Gommers <ralf.gommers@gmail.com> wrote:
On Tue, Aug 7, 2012 at 6:05 PM, Thiago Franco Moraes < totonixsame@gmail.com> wrote:
A little off-topic, but related: Which python version do you recommend to install in Mac OS X 10.8? The native one? The one from python.org? or the one compiled via homebrew? And do you think it's better to use the 32 or 64 bits?
Depends on what you want to do / what packages you want to use. Perhaps python.org + official installers (dmgs from Sourceforge), perhaps EPD / SciPy Superpack / ....
Without knowing more, I would just advise to not use Apple Python, and to use binary installers (10.8 is so fresh, you'll likely run into a few issues with source installs).
Ralf
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
![](https://secure.gravatar.com/avatar/5f88830d19f9c83e2ddfd913496c5025.jpg?s=120&d=mm&r=g)
On Tue, Aug 7, 2012 at 5:35 PM, Chris Barker <chris.barker@noaa.gov> wrote:
On Mon, Aug 6, 2012 at 8:51 PM, Tom Krauss <thomas.p.krauss@gmail.com> wrote:
I got a new job, and a new mac book pro on which I just installed Mac OS X 10.8.
congrats -- on the job, and on an employer that gets you a mac!
I need to run SWIG to generate a shared object from C++ source that works with numpy.i. I'm considering installing the Scipy Superpack, but I have a question. If I install the Scipy Superpack, which has most of the packages I need, plus some others, will it be able to find "numpy/arrayobject.h"
It's probably there, yes, and you should be able to find it with:
numpy.get_include()
(use that in your setup.py)
the source files needed by gcc to compile the swig-generated C++ wrapper?
The trick here is which gcc -- Apple is fast to move forward, is on the bleeding edge with gcc -- the latest XCode uses LLVM, which is not compatible with older Python builds.
I *think* the superpack is build against the pyton.org python builds (32 bit?)
No, it says at http://fonnesbeck.github.com/ScipySuperpack/ that it's built against 64-bit Apple Python. Ralf
Anyway, the python,org 32 bit build requires an older gcc for building extensions -- you can get XCode 3from Apple Developer connection if you dig for it -- it works fine on 10.7, I hope it does on 10.8.
I'm not totally sure about the 32/64 bit Intel build.
The pythonmac list will be a help here.
Good luck,
-Chris
--
Christopher Barker, Ph.D. Oceanographer
Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (4)
-
Chris Barker
-
Ralf Gommers
-
Thiago Franco Moraes
-
Tom Krauss