[Distutils] building with static dependencies

Sridhar Ratnakumar sridharr at activestate.com
Fri Apr 30 21:36:52 CEST 2010


On 2010-04-30, at 5:58 AM, Chris Withers wrote:

> Sridhar Ratnakumar wrote:
>> Similar to "STATICDEPS=True python setup.py bdist_egg" in lxml?
> 
> If that lets me build and egg that I can then shove onto another box of the same OS and install with easy_install without installing any other dependencies, then yes, sure :-)

Only lxml is aware of the STATICDEPS environment variable (see buildliblxml.py) and builds dependencies with static linking accordingly. AFAIK, no other package does this .. though I imagine someone can work on one of the following:

  1. [PEP] Infrastructure to automatically build dependencies with shared or static linking
  2. A cross-platform Macports/Portage like system to build 'external' dependencies for Python packages (Enthought may have something similar to this, as they have .egg for non-Python packages)

>> and build atlas yourself on linux. 
> 
> Is there really no simpler way than following the huge and convolute process described here:
> 
> http://www.scipy.org/Installing_SciPy/Linux#head-eecf834fad12bf7a625752528547588a93f8263c

Yes, no other simpler documented process that I know of. The ActiveState PyPM repository does come with scipy/numpy linked with the ATLAS libraries (except Windows 64-bit which apparently does not work with ATLAS yet; and perhaps requires MKL). You will need the non-free Business Edition subscription to access these modules.  Like virtualenv, you can install these modules on any virtualenv ("pypm -E /tmp/myvenv install scipy numpy") and any Linux/Windows/Mac machine. http://www.activestate.com/business_solutions/compare/ (Try it with the free 'pil' package, if you are interested)

>> In both cases, setup.cfg has to be modified to point to these ATLAS libraries. ATLAS will be statically linked.
> 
> ...which is why I guess you can't rely on the operating system supplied ATLAS libraries if you want them to be statically linked?
> 
>> To statically link libgfortran: on Mac, take a look at the libgfotran.a copying hack in pavement.py (scipy trunk); on Linux, I haven't yet figured out a way to reliably link libgfortran statically to numpy.]]
> 
> We're on Windows, Linux and maybe Mac...

Recently I figured out that to link with libgfortran (GPL) on Linux, you have to use GCC 4.3 or later, rebuild ATLAS with it and use the -static-libgfortran flag to the gfortran compiler. 

-srid



More information about the Distutils-SIG mailing list