[Python-Dev] Build Notes for building trunk with Visual Studio 2008 Express Edition
Chris Mellon
arkanes at gmail.com
Mon Nov 26 17:21:53 CET 2007
On Nov 23, 2007 8:53 AM, Paul Moore <p.f.moore at gmail.com> wrote:
> I have just built the current trunk version of Python on Windows,
> using the new PCBuild9 directory, and Visual Studio 2008 Express
> Edition.
>
> Everything went extremely well. I include below my notes on what I
> did, for reference. To be honest, there's nothing in here that really
> warrants a change to the readme.txt - to all intents and purposes, the
> process "just works".
>
> OK, here are my notes:
>
> Install Visual C++ 2008 Express Edition. Only select Silverlight from
> the options (no documentation or SQL Server - Silverlight probably
> isn't actually needed either).
> I already had the Platform SDK installed, but did nothing to tell VS
> about it, or to integrate it. I doubt this is relevant.
>
> I am using Python trunk at revision 59132. (But I hit an issue fixed
> in 59136, so better to use that).
>
> Start VC.
> Open project PCBuild9\pcbuild.sln
> Message "Solution Folders are not supported in this version of Visual
> Studio. Solution folder 'Solution Items' will be displayed as
> unavailable." Select OK.
>
> Select the release build (Build > Configuration Manager)
>
> Right click pythoncore > Build
> make_buildinfo - succeeded 1 warning (unlink vs _unlink)
> make_versioninfo - succeeded
> pythoncore - I hit an error in ast.c so I needed to svn up (to
> 59136). Succeeded.
>
> Right click python > Build. Succeeded.
> Right click pythonw > Build. Succeeded.
> Right click _socket > Build. Succeeded.
> Right click _testcapi > Build. Succeeded.
> Right click pyexpat > Build. Succeeded.
> Right click select > Build. Succeeded.
> Right click unicodedata > Build. Succeeded.
> Right click winsound > Build. Succeeded.
>
> At this point, we have finished the modules documented as "build out
> of the box" in PCBuild9\readme.txt.
>
> The modules _tkinter, bz2, _bsddb, _sqlite3, _ssl are documented as
> having dependencies. See below.
>
> Modules _ctypes, _ctypes_test, _elementtree, _msi, w9xpopen are not
> mentioned in readme.txt. They all build without error.
>
> bz2
> ---
>
> The include dir is a macro, and I can't work out how to override the
> default (which is bzip2-1.0.3). So I stuck to 1.0.3 and exported it
> from Python svn, as per the instructions.
>
> Built OK.
>
> _sqlite3
> --------
>
> Again, couldn't work out how to change the macro, so I stuck with the
> external from svn (sqlite-source-3.3.4).
>
> The pre-link step failed with an error about not finding TCL. I edited
> the prelink step to include a /DNO_TCL flag on the cl command. There
> may be a better approach - I don't know if not having TCL is an issue
> for Python's use of sqlite.
>
> _tkinter and _bsddb
> -------------------
>
> The instructions suggest using VS 2003 to build the dependencies. I
> don't have VS 2003 and don't have the time at the moment to
> investigate further.
>
> _ssl
> ----
>
> Christian has been making changes to allow this to build without Perl,
> so I gave it a try. I used openssl 0.9.8g, which I extracted to the
> build directory (I noticed afterwards that this is the same version as
> in Python svn, so I could have used the svn external!)
>
> I needed to download nasm (nasm.sf.net) version 2.00rc1, and rename
> nasm.exe to nasmw.exe and put it on my PATH.
>
> Build succeeded, no issues.
>
> Tests
> -----
>
> Running the tests, all succeed except test_tcl and test_bsddb, which
> are because I didn't build those two extensions, and test_os. The
> test_os failure is just because it looks for C:\pagefile.sys and my
> pagefile is on D:\.
>
> (There's also a problem with test_socket_ssl hanging, but this is
> present in the standard 2.6 snapshot build. I've raised a separate bug
> report for this).
>
I was able to build both 2.6 and py3k (trunk checkouts, revision 59136
and 59130 respectively) out of the box, except for openssl and tcl,
which I didn't try to install. The external libraries I placed as
sibling directories to the python source root dir, just as with the
previous PCBuild instructions. I didn't need to build in any specific
order, "Build solution" correctly resolved dependencies. I got the
alert box about solution folders but it didn't harm anything.
If anyone is curious, I ran pybench for both 2.6 and 3k build against
VS 2003 and VS 2008. This is using the out of the box settings, and no
PGO for 2008 (Express version doesn't have it). MSVC 9 was slightly
faster for 2.6, but somewhat slower for py3k. I'm not sure how
relevant that is, but (surprisingly to me) it's not an automatic speed
win over MSVC 7.1. The results of my pybench runs available here:
http://code.google.com/p/wxpsvg/wiki/PyBenchRuns
More information about the Python-Dev
mailing list