> From: Christoph Gohlke [mailto:cgoh...@uci.edu] 
> Sent: Wednesday, August 17, 2011 04:49
> 
> On 8/16/2011 11:12 PM, Eric Firing wrote:
> >
> > The releases/win32/ tree is also unmaintained since 0.99.0.rc1.  Who
> > does the Windows builds these days?  Christophe?
> >
> > It would be nice to have a maintained record of how release builds are
> > done, or better yet, up-to-date scripts that fully automate it.
> 
> IIRC Stan West has updated those build scripts to work with Visual 
> Studio 2008 Express.

I started down that path, but I ended up using a simple CMD script instead of
a Makefile.  It takes the approach you described below of preparing include
and link flags and then calling "python setup...".  I've attached it as an
example for the mailing list, but note that the paths are specific to my
directory layout and to how I prepared the dependencies.  I've also attached
my notes from building the dependencies.  The versions described there are
circa November 2010.

> I use Visual Studio and Windows SDK compilers, whatever is the 
> officially documented and supported compiler by the targeted Python 
> version. I don't use anything from the mpl/releases/win32 tree but 
> follow the instructions at 
> <http://matplotlib.sourceforge.net/users/installing.html> and 
> <http://docs.python.org/distutils/builtdist.html>: run `python setup.py 
> bdist_wininst` after customizing setup.cfg and manually 
> building/installing all required and optional dependencies, making sure 
> they can be found by setup.py (e.g. via environment variables). I don't 
> think it is reasonable or necessary to fully automate this process 
> involving 10 python versions, ~10 dependencies, 4 compilers, and several 
> helper programs (CMake, nasm, git, tar, zip, miktex, Ghostscript). The 
> only thing worth providing might be the prebuilt static link libraries 
> and header files for zlib, libpng, and freetype for the 4 different MSC 
> compilers/runtime libraries.
@echo off
setlocal

rem  Configure Python.
rem
(set PYDIR=C:\Devel\Python26)
(set PYTHON=%PYDIR%\python.exe)

rem  Configure dependencies.
rem
(set ZLIBVERSION=1.2.5)
(set PNGVERSION=1.4.4)
(set FREETYPEVERSION=2.4.3)
(set TCLTKVERSION=8.5.2)
(set WINSRCDIR=C:\Devel)
(set ZLIBDIR=%WINSRCDIR%\zlib-%ZLIBVERSION%)
(set PNGDIR=%WINSRCDIR%\libpng-%PNGVERSION%)
(set FREETYPEDIR=%WINSRCDIR%\freetype-%FREETYPEVERSION%)
(set TCLDIR=%WINSRCDIR%\tcl%TCLTKVERSION%)
(set TKDIR=%WINSRCDIR%\tk%TCLTKVERSION%)
(set GTKDIR=%WINSRCDIR%\GTK)
(set PKG_CONFIG_PATH=%GTKDIR%\lib\pkgconfig;%PYDIR%\Lib\pkgconfig)

rem  Configure setup.py options.
rem
(set 
PY_INCLUDE="%ZLIBDIR%\include;%PNGDIR%;%FREETYPEDIR%\include;%TCLDIR%\generic;%TCLDIR%\win;%TKDIR%\generic;%TKDIR%\win;%TKDIR%\xlib")
(set PY_LINKER="%ZLIBDIR%\lib;%PNGDIR%;%FREETYPEDIR%;%PYDIR%\tcl")

rem  Build.
rem
%PYTHON% setup.py build_ext --compiler=msvc -I %PY_INCLUDE% -L %PY_LINKER% 
bdist_wininst --user-access-control=auto
rem %PYTHON% setupegg.py build_ext --compiler=msvc -I %PY_INCLUDE% -L 
%PY_LINKER% develop

endlocal & exit /b %errorlevel%
FreeType
  • Downloaded "http://download.savannah.gnu.org/releases/freetype/ft243.zip".
  • Extracted contents to "C:\Devel\freetype-2.4.3".
  • Opened a command prompt there and executed:
    • vcvarsall.bat
    • vcbuild builds\win32\vc2008\freetype.vcproj Release
    • mklink /h freetype.lib objs\win32\vc2008\freetype243.lib
zlib
  • Downloaded "http://zlib.net/zlib125.zip".
  • Extracted contents to "C:\Devel\zlib-1.2.5".
  • Opened a command prompt there and executed:
    • del zconf.h
    • mkdir build-vs9
    • cd build-vs9
    • cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX=..\ ..\
    • vcbuild zlib.vcproj "Release"
    • vcbuild INSTALL.vcproj "Release"
    • cd ..\lib
    • mklink /h z.lib zlib.lib
libpng
  • Downloaded "http://sourceforge.net/projects/libpng/files/01-libpng-master/1.4.4/lpng144.7z".
  • Extracted contents to "C:\Devel\libpng-1.4.4" (ignoring the "lpng144" subdirectory in the archive).
  • Opened a command prompt there and executed:
    • vcvarsall.bat
    • vcbuild /upgrade projects\visualc71\libpng.vcproj
    • vcbuild projects\visualc71\libpng.vcproj "LIB Release"
    • mklink /h png.lib projects\visualc71\Win32_LIB_Release\libpng.lib
  • (Instead of the above, one might try to build with CMake as was done above for zlib.)
Tcl
  • Downloaded "http://sourceforge.net/projects/tcl/files/Tcl/8.5.2/tcl852-src.zip".
  • Extracted contents to "C:\Devel\tcl8.5.2".
Tk
  • Downloaded "http://sourceforge.net/projects/tcl/files/Tcl/8.5.2/tk852-src.zip".
  • Extracted contents to "C:\Devel\tk8.5.2".
GTK
  • Downloaded "http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.16/gtk+-bundle_2.16.6-20100207_win32.zip".
  • Extracted contents to "C:\Devel\GTK".
  • Added "C:\Devel\GTK\bin" to the system PATH.
PyGTK, PyGObject, PyCairo
  • Downloaded:
    • http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.16/pygtk-2.16.0+glade.win32-py2.6.exe
    • http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.20/pygobject-2.20.0.win32-py2.6.exe
    • http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.6.win32-py2.6.exe
  • Executed them.

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to