<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hello,<div><br class="webkit-block-placeholder"></div><div>I am trying to build a package of mine, and for some reason the build process with distutils is failing in Windows, but not in OS X (and I imagine also in Linux, but I haven't tested it).  I am not sure if this is a Pyrex problem, a distutils problem, or me doing something stupid problem.  :)</div><div><br class="webkit-block-placeholder"></div><div>I boiled it down to the simplest package that still fails.  My setup.py is:</div><div><br class="webkit-block-placeholder"></div><div><div>from distutils.core import setup</div><div>from distutils.extension import Extension</div><div>from Pyrex.Distutils import build_ext</div><div><br class="webkit-block-placeholder"></div><div>setup(</div><div>  name = 'myproject',</div><div>  version='0.0.1',</div><div>  description="Here is a description",</div><div>  author="Brian Blais",</div><div>  ext_modules=[ </div><div>    Extension("myproject/train",["myproject/train.pyx"]),</div><div>    ],</div><div>    </div><div>  packages=['myproject'],</div><div>  </div><div>  cmdclass = {'build_ext': build_ext}</div><div>)</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>and my project has one directory, myproject, with two files.  train.pyx is:</div><div><br class="webkit-block-placeholder"></div><div><div>def func(blah):</div><div>    </div><div>    print blah</div><div>    </div><div><br class="webkit-block-placeholder"></div><div>and an __init__.py, which has the single line:</div><div><br class="webkit-block-placeholder"></div><div>import train</div><div><br class="webkit-block-placeholder"></div><div><br></div><div>So, in OS X, I can do</div><div><br class="webkit-block-placeholder"></div><div>python setup.py build</div><div><br class="webkit-block-placeholder"></div><div>and the build goes through.  In windows, with the same basic setup (version numbers all below), I get:</div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">[Desktop\test]|5&gt; !python setup.py build</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">running build</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">running build_py</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">creating build</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">creating build\lib.win32-2.5</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">creating build\lib.win32-2.5\myproject</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">copying myproject\__init__.py -&gt; build\lib.win32-2.5\myproject</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">running build_ext</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">building 'myproject/train' extension</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">creating build\temp.win32-2.5</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">creating build\temp.win32-2.5\Release</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">creating build\temp.win32-2.5\Release\myproject</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ic:\python25\include -Ic:\pytho</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">n25\PC -c myproject/train.c -o build\temp.win32-2.5\Release\myproject\train.o</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">writing build\temp.win32-2.5\Release\myproject\train.def</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">c:\mingw\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.5\Release\myproje</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ct\train.o build\temp.win32-2.5\Release\myproject\train.def -Lc:\python25\libs -</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Lc:\python25\PCBuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\myproject/train</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">.pyd</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Cannot export initmyproject/train: symbol not defined</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">collect2: ld returned 1 exit status</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">error: command 'gcc' failed with exit status 1</div><div><br class="webkit-block-placeholder"></div></div></div></div><div><br><br></div><div>On both the Mac and the PC I have:</div><div><br class="webkit-block-placeholder"></div><div>Python 2.5.1 </div><div>Pyrex version 0.9.5.1a</div><div>distutils 2.5.1</div><div><br></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>am I doing something wrong?</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>thanks,<br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>Brian Blais<br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Monaco; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>-- </div><div>Brian Blais</div><div><a href="mailto:bblais@bryant.edu">bblais@bryant.edu</a></div><div><a href="http://web.bryant.edu/~bblais">http://web.bryant.edu/~bblais</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span> </div><br></div></body></html>