[SciPy-user] weave and mingw on win xp sp2 bug?
Sun Dec 30 17:01:22 CST 2007
Thanks for the info on this. Sorry I was slow at responding to your email. I did compile my notes as to how I got weave.inline to work. I know that when I was working on this before and trying a million different combinations, I also changed the location of my temp directory in the environment variables to C:/Temp. I have learned that everything tends to work best when there are no spaces in directories and ISO standards are followed. I will go ahead and post my notes on what I did but it sounds like you have everything working so feel free to ignore.
Like I mentioned I was only
able to get weave.inline to work with python 2.5.1 and mingw 5.0.3. I tried
python 2.4.1 and 2.4.4 with visual studio compilers and mingw. I hope this
information is of some help. This process was new for me so it may not be the
best solution or accurate but it does work for me.
OS: Windows XP SP2
I suggest you check that MinGW
is installed correctly by following the directions on their website. A summary
of these directions include: First install MSYS, say, to directory C:\msys\1.0.
Then install MinGW to C:\msys\1.0\mingw directory. If you choose to install
MinGW to C:\mingw as the installer suggests by default then you have to create
a file C:\msys\1.0\etc\fstab containing c:/mingw /mingw and then restart your
computer so that /mingw will be mounted. Once this is done you might test the
compiler on something to eliminate this as a source of error. Then make sure
you add the MinGW path to PYTHONPATH environment variable (e.g., % PYTHONPATH%;
I then had to modify the numpy
distutils exec_command.py. This is likely found in
I commented out this code starting on line 67 or
fdir,fn = os.path.split(pythonexe)
pythonexe = os.path.join(fdir,fn)
os.path.isfile(pythonexe), '%r is not a file' % (pythonexe,)
And then I replaced with these lines:
exe = 'python.exe'
for p in
pythonexe = fn
###End of MOD edits
edits worked for me.
was never successful in using VS2003 toolkit or VS2005 Express. I was able to
install these and compile some python modules successfully so they did work as
compilers. However, changes to the SDK had to be implemented in order for these
to work as well. I am not sure why I could not get weave to work with these
compilers but once I got something to work I gave up trying to understand due
to my time constraints. The alterations I made to the compilers are included
below. Apparently the problem has to do with Microsoft and Express. The full software
package of visual studio apparently does not have these problems. Here are the
edits I made to get these to compile python modules (weave still did not work
Source for this info: http://www.codeproject.com/KB/wtl/WTLExpress.aspx
1. cd C:\Program
Files\Microsoft Platform SDK\include\atl
Change SetChainEntry function
at line 1725 of atlwin.h - define "int i" at the first line of the
dwChainID, CMessageMap* pObject, DWORD
dwMsgMapID = 0)
// first search for an existing entry
for(i = 0; i < m_aChainEntry.GetSize();
and FreeStdCallThunk at line 287 of atlbase.h to the new macros
/* Comment it
PVOID __stdcall __AllocStdCallThunk(VOID);
HeapFree(GetProcessHeap(), 0, p)
3. Download and install WTL
cd to WTL\AppWiz folder, double click
setup80x.js (or appropriate version to install the WTL Wizard into VC Express
----- Original Message ----
From: mani sabri <firstname.lastname@example.org>
To: SciPy Users List <email@example.com>
Sent: Sunday, December 30, 2007 2:34:18 AM
Subject: Re: [SciPy-user] weave and mingw on win xp sp2 bug?
>Behalf Of Michael ODonnell
>Sent: Saturday, December 29, 2007 6:04 PM
>To: SciPy Users List
>Hi sorry I did not reply about your inquiry of using weave. It took me
>quite a bit of time to get this to work and I never got any responses.
>Unfortunately, I am heading out the door so I will keep this extremely
>short until I can provide a more complete response tonight or tomorrow
>morning. I was able to get weave inline to work using python 2.5.1 and
>mingw 5.0.3. The path to this needs to be added to your pythonpath
>and you need to specify 'gcc' as your compiler. I also worked with
>and VS2005 Express. And I worked with python 2.4.1 and 2.4.4. None of
>combinations worked. There was also a problem in numpy with finding
>python.exe file. I cannot remember if this error was given with VS
>or both VS and MingW.
I managed to run/compile my Time Wrapping function with weave and
2.4.4 an hour ago. Although the weave.tests continues to show ugly
"Permission Denied" message I had no problem with my func. (and like
windows users I don't care about that message! Its windows! ;) )
As I remember it is the python24.a file in 2.4.4 that makes the whole
difference because gcc don't know anything about Microsoft lib files.
Anyhow here is a brief state of my system:
- scipy 0.6.0
- numpy 1.0.4
- Python in c:\python24 (no spaces in path! Its important)
- environment variables:
python_lib = c:\Python24\libs\python24.a
pythonpath = c:\Python24;C:\PROGRAM FILES\Pyrex-0.9.6.4;
swig_lib = C:\PROGRAM FILES\swingwin-1.3.27\python
python_include = C:\Python24\include;
path = C:\MINGW\BIN;C:\CYGWIN\BIN; C:\PROGRAM FILES\swingwin-
p.s: I saw some posts about cleaning up weave.tests in scipy-dev these
I hope they take a look at weave.example directory.
SciPy-user mailing list
Never miss a thing. Make Yahoo your home page.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user