[pygr-notify] [pygr commit] r232 - Edited wiki page through web user interface.
codesite-noreply at google.com
codesite-noreply at google.com
Fri May 15 15:50:24 PDT 2009
Author: marecki
Date: Fri May 15 14:16:44 2009
New Revision: 232
Modified:
wiki/PygrOnWindows.wiki
Log:
Edited wiki page through web user interface.
Modified: wiki/PygrOnWindows.wiki
==============================================================================
--- wiki/PygrOnWindows.wiki (original)
+++ wiki/PygrOnWindows.wiki Fri May 15 14:16:44 2009
@@ -58,52 +58,37 @@
=== Details ===
-TBA
+After installing MinGW make sure its _bin_ directory is present in your
search path: open System Properties from the Control Panel, go to the
tab "Advanced" and click "Environment Variables". If "PATH" contains
something along the lines of _C:\MinGW\bin_, appropriate for where you
installed MinGW on your system, you are okay; otherwise, click "Edit" and
add it by hand.
-
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
-*Step 4.* Add Path Environment. Open "System Properties", go to "Advanced"
tab and click "Environment Variables". Click "PATH" and press "Edit". Add
+Windows packages of Python versions older than 2.5 doen't come with
MinGW-compatible import libraries in spite of their distutils being
MinGW-aware; weird but true. Fortunately, it is quite easy to produce such
import libraries (not just for Python, as the procedure is always the same):
+ * download
[http://www.emmestech.com/software/pexports-0.43/pexports-0.43.zip
PExports] and extract the executable file somewhere you can run it (the
MinGW _bin_ directory is not a bad place, since it's already in the paths
and you will likely want to keep pexports.exe around);
+ * locate _python2X.dll_, where X is the relevant Python branch number, on
your hard drive; it will likely be in the _system32_ subdirectory of your
Windows directory;
+ * launch the Windows command prompt and run (make sure you've got write
access to where the .def file is to be stored)
{{{
-;C:\Python24;C:\cygwin\bin;C:\MinGW\bin
+pexports \path\to\python2X.dll > python2X.def
}}}
-to your path (use Python25 if you installed Python2.5)
-
-*Step 5.* pexports trick!
-
-*Step 6.* Create and edit the file C:\Python2X\Lib\distutils\distutils.cfg
(X = version number)
+to extract symbols from the DLL;
+ * create the import library by running
{{{
-[build]
-compiler = mingw32
+dlltool --dllname python2X.dll --def \path\to\python2X.def --output-lib
c:\python2X\libs\libpython2X.a
}}}
+making sure your destination directory is correct (it should be the same
one as where _python2X.lib_, the Microsoft Visual C++ import library, is.
Note that the argument of _--dllname_ should *not* contain the path, even
if the DLL is not in your current directory. In case you were wondering,
_dlltool_ is bundled with MinGW.
-*Step 7.* Download latest version of pygr from
[http://bioinformatics.ucla.edu/pygr Pygr Home]
-
-*Step 8.* You may have to do this manually create .c files from .pyx using
pyrex. If your *pyrexc* executable is in your PATH then you may proceed to
the next step
-
-*Step 9.* Go to pygr directory and run setup.py
-
-To build the C extensions only run:
+Now all that remains is to tell distutils we want to use MinGW. To make it
the system-wide default, create or edit the file
_C:\Python2X\Lib\distutils\distutils.cfg_ and make it contain the following
option:
{{{
-# ONLY FOR C EXTENSION
-python setup.py build_ext
+[build]
+compiler = mingw32
}}}
+Conversely, you can just specify the command-line option _-c mingw32_
whenever you run _python setup.py build_, _build_ext_ and the likes. Note
that using the command-line option means you must always run _build_ and
the likes before you run _install_, as the latter doesn't understand the
_-c_ option.
-To build the entire package run:
-{{{
-# BUILD PYGR, WILL BE SAVED IN BUILD DIRECTORY
-python setup.py build
-}}}
+With everything set up, follow the [BuildingAndTestingPygr standard build
procedure] to get Pygr ready.
-To install execute:
+Finally, if you want to create an installer package of Pygr instead of
having install itself, run the following:
{{{
-# INSTALL PYGR PACKAGES IN YOUR MACHINE
-python setup.py install
+python setup.py bdist_wininst
}}}
-
-*Step 10.* Use pygr. Now you can import pygr.
-
+to produce an EXE file or, if you use Python 2.6 or newer,
{{{
->>> import pygr
+python setup.py bdist_msi
}}}
-
+to produce a Microsoft Installer package.
\ No newline at end of file
More information about the pygr-notify
mailing list