This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author klo.uo
Recipients Ramchandra Apte, eric.araujo, klo.uo, loewis, serhiy.storchaka, tarek
Date 2013-01-09.18:15:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <49237470.20130109191545@gmail.com>
In-reply-to <1357748878.53.0.223103031822.issue16907@psf.upfronthosting.co.za>
Content
> klo.uo: can you kindly provide a working (or, rather, failing)
> example? A trivial "hello-world" kind of package could do, along
> with a report what path you unpacked it in, and what error you get.

As mentioned in opening thread, this doesn't happen with Cython's 
"hello world" example, as `gcc` somehow doesn't trigger this problem. 
Maybe because it's handled by Cython's own distutils copies, maybe it's 
handled by Numpy's distutils version or it could be by Python's 
distutils.

I noticed this issue while using Numpy with Cython. Here is simple example:

C:\Documents and Settings\klo\My Documents\code\python\misc\test.pyx:
========================================
cimport numpy

def sum(x):
    cdef numpy.ndarray[int, ndim=1] arr = x
    cdef int i, s = 0
    for i in range(arr.shape[0]):
        s += arr[i]
    return s
========================================

C:\Documents and Settings\klo\My Documents\code\python\misc\setup.py:
========================================
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from numpy.distutils.misc_util import get_numpy_include_dirs

setup(
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("test", ["test.pyx"], include_dirs=get_numpy_include_dirs())]
    )
========================================

command line: `python setup.py build_ext --inplace`

MinGW result:
========================================
...
g++ -shared build\temp.win32-2.7\Release\test.o -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o C:\Documents and Settings\klo\My Documents\code\python\misc\test.pyd
Found executable C:\MinGW\bin\g++.exe
g++.exe: error: and: No such file or directory
g++.exe: error: Settings\klo\My: No such file or directory
g++.exe: error: Documents\code\python\misc\test.pyd: No such file or directory
error: Command "g++ -shared build\temp.win32-2.7\Release\test.o -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o C:\Documents and Settings\klo\My Documents\code\python\misc\test.pyd" failed with exit status 1
========================================

Similar result if I use MSVC compiler:

MSVC result:
========================================
building 'test' extension
c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC /Tctest.c /Fobuild\temp.win32-2.7\Release\test.obj
Found executable c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe
c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild /EXPORT:inittest build\temp.win32-2.7\Release\test.obj /OUT:C:\Documents and Settings\klo\My Documents\code\python\misc\test.pyd /IMPLIB:build\temp.win32-2.7\Release\test.lib /MANIFESTFILE:build\temp.win32-2.7\Release\test.pyd.manifest /MANIFEST
Found executable c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.exe
LINK : fatal error LNK1181: cannot open input file 'and.obj'
error: Command "c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild /EXPORT:inittest build\temp.win32-2.7\Release\test.obj /OUT:C:\Documents and Settings\klo\My Documents\code\python\misc\test.pyd /IMPLIB:build\temp.win32-2.7\Release\test.lib /MANIFESTFILE:build\temp.win32-2.7\Release\test.pyd.manifest /MANIFEST" failed with exit status 1181
========================================

So issue is with unquoted path for output file, and not for LIBDIR as I wrote
previously (perhaps I misread the logs, as I was trying to fix similar issue
for Theano, at the same time)

> Your patch is not applicable to Python, since it requires the win32
> extensions, which we cannot assume to be present.

Yes, I provided patch that worked for me temporarily, as I'm not 
familiar with distutils, and that's as far as I went.
But source issue is probably elsewhere, as Serhiy suggested.
History
Date User Action Args
2013-01-09 18:15:50klo.uosetrecipients: + klo.uo, loewis, tarek, eric.araujo, Ramchandra Apte, serhiy.storchaka
2013-01-09 18:15:50klo.uolinkissue16907 messages
2013-01-09 18:15:49klo.uocreate