Distributing prebuilt numpy and other extensions

Hello folks, I've developed some command-line tools for biologists using python/ numpy and some custom C and Fortran extensions, and I'm trying to figure out how to easily distribute them... For people using linux, I figure a source distribution is no problem at all. (Right?) On the other hand, for Mac users (whose computers by default don't have the dev tools, and even then would need to get a fortran compiler elsewhere) I'd like to figure out something a bit easier. I'd like to somehow provide an installer (double-clickable or python script) that does a version check and then installs an appropriate version of prebuilt binaries for numpy and my C and Fortran extensions. Is this possible within the bounds of the python or numpy distutils? Would setuptools be a better way to go? Preferably it would be a dead easy, one-step thing... Or is this whole idea problematic, and better to stick with source distribution in all cases? Thanks for any advice, Zach Pincus Program in Biomedical Informatics and Department of Biochemistry Stanford University School of Medicine

Hello folks,
I've developed some command-line tools for biologists using python/ numpy and some custom C and Fortran extensions, and I'm trying to figure out how to easily distribute them...
For people using linux, I figure a source distribution is no problem at all. (Right?) If they already have dependencies, and can easily install blas/lapack,
Zachary Pincus wrote: then it is indeed relatively easy. Incidentally, I am working on a system to build a complete self-contained numpy/scipy from sources, including LAPACK/BLAS/ATLAS if necessary, for reasons similar to you. On linux at least, I still think source distribution is the most reliable (compiler version mismatch, etc... makes it really difficult to distribute binaries across several distributions).
On the other hand, for Mac users (whose computers by default don't have the dev tools, and even then would need to get a fortran compiler elsewhere) I'd like to figure out something a bit easier.
I don't know much about Mac OS X, but PyMC distributes binaries for intel and ppc Mac in a way similar to what you are looking for: http://trichech.us/?page_id=3 Unfortunately, the build scripts are not included in the sources, but maybe the author of PyMC can give you some hints ? cheers, David

David Cournapeau wrote:
I don't know much about Mac OS X, but PyMC distributes binaries for intel and ppc Mac in a way similar to what you are looking for:
Or rather http://trichech.us/?page_id=4 Unfortunately, those builds are currently broken.
Unfortunately, the build scripts are not included in the sources, but maybe the author of PyMC can give you some hints ?
Primarily, you just use bdist_mpkg to generate the Installer.app packages. http://cheeseshop.python.org/pypi/bdist_mpkg/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

In article <D3A11D21-A268-41B3-9819-3C6F13D0A8B5@stanford.edu>, Zachary Pincus <zpincus@stanford.edu> wrote:
Hello folks,
I've developed some command-line tools for biologists using python/ numpy and some custom C and Fortran extensions, and I'm trying to figure out how to easily distribute them...
For people using linux, I figure a source distribution is no problem at all. (Right?) On the other hand, for Mac users (whose computers by default don't have the dev tools, and even then would need to get a fortran compiler elsewhere) I'd like to figure out something a bit easier.
I'd like to somehow provide an installer (double-clickable or python script) that does a version check and then installs an appropriate version of prebuilt binaries for numpy and my C and Fortran extensions. Is this possible within the bounds of the python or numpy distutils? Would setuptools be a better way to go? Preferably it would be a dead easy, one-step thing...
Or is this whole idea problematic, and better to stick with source distribution in all cases?
As Robert Kern said, using bdist_mpkg is a nice easy way to create a double-clickable Mac installer for python code. It builds an installer package using the normal setup.py file for your stuff. Lots of packages built this way are available at: <http://pythonmac.org/packages> But if you want one installer that installs everything then, you have to figure what to do if the user already has some of the your python packages installed (e.g. numpy). Overwrite the existing package? Somehow install it in parallel and have the user pick which version to use? None of this is automated in bdist_mpkg. It is set up to install one python package at a time. So... For your project I suspect you would be better off using easy_install <http://peak.telecommunity.com/DevCenter/EasyInstall> and packaging your project as a python "egg". easy_install is cross-platform, handles dependencies automatically and can install from source or precompiled binaries. That said, I've not actually used it except to install existing eggs, though I'd like to find some time to learn it. -- Russell
participants (4)
-
David Cournapeau
-
Robert Kern
-
Russell E. Owen
-
Zachary Pincus