[SciPy-user] weave inline progress/questions for a new error

Michael ODonnell odonnems@yahoo....
Wed Dec 5 17:02:30 CST 2007


I have recently been posting questions about how to implement scipy.weave.inline on a windows XP machine. I have finally made some progress on how to do this. Sorry for the lack of correct terminology and ignorance, but this is outside of my expertise and I only just learned last week what a .cpp and .obj file was.

First, I did not have my library, include and paths set up exactly right. These corrections allowed me to compile the object files.

Second, there is an error in the numpy/distutils/exec_command.py file with regard to finding the correct python executable file on an NT machine. The code was not right, probably due to differneces in python versions or something. I have altered this code, which has allowed me to run weave, but it then crashes at a later point. The program creates the c++ source file, the object file and the weave object file but appears to crash when converting this to a python dll file. I get the following output using verbose (Please skip below this for additional comments and questions):

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
No module named msvccompiler in numpy.distutils; trying from distutils
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e
running build_ext
running build_src
building extension "sc_552cccf5dbf4f6eadd273cdcbd5860520" sources
No module named msvccompiler in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
No module named msvccompiler in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_ext
building 'sc_552cccf5dbf4f6eadd273cdcbd5860520' extension
compiling C sources
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp\Michael
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp\Michael\python24_compiled
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib\site-packages
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib\site-packages\scipy
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib\site-packages\scipy\weave
creating c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib\site-packages\scipy\weave\scxx
C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -IC:\Python24\lib\site-packages\scipy\weave -IC:\Python24\lib\site-packages\scipy\weave\scxx -IC:\Python24\lib\site-packages\numpy\core\include -IC:\Python24\include -IC:\Python24\PC /Tpc:\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.cpp /Foc:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.obj /Zm1000
C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -IC:\Python24\lib\site-packages\scipy\weave -IC:\Python24\lib\site-packages\scipy\weave\scxx -IC:\Python24\lib\site-packages\numpy\core\include -IC:\Python24\include -IC:\Python24\PC /TpC:\Python24\lib\site-packages\scipy\weave\scxx\weave_imp.cpp /Foc:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib\site-packages\scipy\weave\scxx\weave_imp.obj /Zm1000
C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python24\libs /LIBPATH:C:\Python24\PCBuild /EXPORT:initsc_552cccf5dbf4f6eadd273cdcbd5860520 c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.obj c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib\site-packages\scipy\weave\scxx\weave_imp.obj /OUT:c:\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.pyd /IMPLIB:c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.lib
LINK : fatal error LNK1104: cannot open file 'msvcprt.lib'
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Documents and Settings\Michael\Application Data\ESRI\ArcToolbox\scripts\test_weave.py", line 349, in ?
    main()
  File "C:\Documents and Settings\Michael\Application Data\ESRI\ArcToolbox\scripts\test_weave.py", line 227, in main
    weave.inline('printf("%d\\n",a);',['a'], verbose=2, type_converters=converters.blitz)  #, compiler = 'msvc', verbose=2, type_converters=converters.blitz, auto_downcast=0) #'msvc' or 'gcc' or 'mingw32'
  File "C:\Python24\Lib\site-packages\scipy\weave\inline_tools.py", line 338, in inline
    auto_downcast = auto_downcast,
  File "C:\Python24\Lib\site-packages\scipy\weave\inline_tools.py", line 447, in compile_function
    verbose=verbose, **kw)
  File "C:\Python24\Lib\site-packages\scipy\weave\ext_tools.py", line 365, in compile
    verbose = verbose, **kw)
  File "C:\Python24\Lib\site-packages\scipy\weave\build_tools.py", line 269, in build_extension
    setup(name = module_name, ext_modules = [ext],verbose=verb)
  File "C:\Python24\Lib\site-packages\numpy\distutils\core.py", line 176, in setup
    return old_setup(**new_attr)
  File "C:\Python24\Lib\distutils\core.py", line 166, in setup
    raise SystemExit, "error: " + str(msg)
CompileError: error: Command "C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python24\libs /LIBPATH:C:\Python24\PCBuild /EXPORT:initsc_552cccf5dbf4f6eadd273cdcbd5860520 c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.obj c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\Python24\lib\site-packages\scipy\weave\scxx\weave_imp.obj /OUT:c:\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.pyd /IMPLIB:c:\temp\Michael\python24_intermediate\compiler_d41d8cd98f00b204e9800998ecf8427e\Release\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860520.lib" failed with exit status 1104
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The error seems to be this: LINK : fatal error LNK1104: cannot open file 'msvcprt.lib

Does anyone know what I may need to do to get this to work. I am writing a document that outlines all the details for what I have done in the event someone else is having these issues. I will post this once I get all this worked out. 

Thank you for those who have been corresponding with me as I muddle through this!!

Michael





      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071205/09679952/attachment.html 


More information about the SciPy-user mailing list