rickardp / splitstream

Continuous object splitter for C and Python
Apache License 2.0
44 stars 9 forks source link

not building on windows 7 #4

Closed arcanosam closed 7 years ago

arcanosam commented 7 years ago

I could not build the package

I'm using:

links helped me:

log of building:

C:\Users\IEUser\Downloads\splitstream>c:\python34\python.exe setup.py build
running build
running build_ext
building 'splitstream' extension
creating build
creating build\temp.win32-3.4
creating build\temp.win32-3.4\Release
creating build\temp.win32-3.4\Release\src
creating build\temp.win32-3.4\Release\src\python
c:\Program Files\Microsoft Visual Studio 10.0\VC\Bin\cl.exe /c /nologo /Ox /MD /
W3 /GS- /DNDEBUG -Ic:\python34\include -Ic:\python34\include /Tcsrc/pyth
on/splitstream_py.c /Fobuild\temp.win32-3.4\Release\src/python/splitstream_py.ob
j
splitstream_py.c
src/python/splitstream_py.c(98) : error C2099: initializer is not a constant
src/python/splitstream_py.c(115) : error C2143: syntax error : missing ';' before 'type'
src/python/splitstream_py.c(126) : error C2065: 'kwarg_list' : undeclared identifier
src/python/splitstream_py.c(126) : warning C4047: 'function' : 'char **' differs in levels of indirection from 'int'
src/python/splitstream_py.c(126) : warning C4024: 'PyArg_ParseTupleAndKeywords': different types for formal and actual parameter 4
src/python/splitstream_py.c(228) : error C2143: syntax error : missing '{' before '*'
src/python/splitstream_py.c(229) : error C2371: 'splitstream_generator_new' : redefinition; different basic types
        src/python/splitstream_py.c(42) : see declaration of 'splitstream_generator_new'
src/python/splitstream_py.c(239) : warning C4133: 'return' : incompatible types- from 'Generator *' to 'int *'
src/python/splitstream_py.c(274) : error C2275: 'PyObject' : illegal use of this type as an expression
        c:\python34\include\object.h(109) : see declaration of 'PyObject'
src/python/splitstream_py.c(274) : error C2065: 'readargs' : undeclared identifier
src/python/splitstream_py.c(275) : error C2275: 'PyObject' : illegal use of this type as an expression
        c:\python34\include\object.h(109) : see declaration of 'PyObject'
src/python/splitstream_py.c(275) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(284) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(284) : warning C4047: '=' : 'int' differs in levelsof indirection from 'PyObject *'
src/python/splitstream_py.c(294) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(294) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
src/python/splitstream_py.c(304) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(304) : warning C4047: '=' : 'int' differs in levels of indirection from 'void *'
src/python/splitstream_py.c(309) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(309) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
src/python/splitstream_py.c(316) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(316) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
src/python/splitstream_py.c(323) : error C2065: 'readargs' : undeclared identifier
src/python/splitstream_py.c(323) : warning C4047: 'function' : 'PyObject *' differs in levels of indirection from 'int'
src/python/splitstream_py.c(323) : warning C4024: 'splitfile_pure_once' : different types for formal and actual parameter 3
src/python/splitstream_py.c(324) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(324) : warning C4047: '=' : 'int' differs in levelsof indirection from 'void *'
src/python/splitstream_py.c(327) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(327) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
src/python/splitstream_py.c(334) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(334) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
src/python/splitstream_py.c(339) : error C2065: 'readargs' : undeclared identifier
src/python/splitstream_py.c(341) : error C2065: 'ret' : undeclared identifier
src/python/splitstream_py.c(341) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int'
error: command 'c:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\Bin\\cl.exe
' failed with exit status 2

other log building:

C:\python34\Scripts>..\python.exe -m pip install splitstream
Collecting splitstream
  Using cached splitstream-1.2.1.tar.gz
Installing collected packages: splitstream
  Running setup.py install for splitstream ... error
    Complete output from command C:\python34\python.exe -u -c "import setupt
ools, tokenize;__file__='C:\\Users\\IEUser\\AppData\\Local\\Temp\\pip-build-5_lp
h0n_\\splitstream\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.
read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" in
stall --record C:\Users\IEUser\AppData\Local\Temp\pip-m3ik0w3g-record\install-re
cord.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'splitstream' extension
    creating build
    creating build\temp.win32-3.4
    creating build\temp.win32-3.4\Release
    creating build\temp.win32-3.4\Release\src
    creating build\temp.win32-3.4\Release\src\python
    c:\Program Files\Microsoft Visual Studio 10.0\VC\Bin\cl.exe /c /nologo /Ox /
MD /W3 /GS- /DNDEBUG -IC:\python34\include -IC:\python34\include /Tcsrc/
python/splitstream_py.c /Fobuild\temp.win32-3.4\Release\src/python/splitstream_p
y.obj
    splitstream_py.c
    src/python/splitstream_py.c(106) : error C2099: initializer is not a constant
    src/python/splitstream_py.c(123) : error C2143: syntax error : missing ';' before 'type'
    src/python/splitstream_py.c(134) : error C2065: 'kwarg_list' : undeclared identifier
    src/python/splitstream_py.c(134) : warning C4047: 'function' : 'char **' differs in levels of indirection from 'int'
    src/python/splitstream_py.c(134) : warning C4024: 'PyArg_ParseTupleAndKeywords' : different types for formal and actual parameter 4
    src/python/splitstream_py.c(236) : error C2143: syntax error : missing '{' before '*'
    src/python/splitstream_py.c(237) : error C2371: 'splitstream_generator_new': redefinition; different basic types
            src/python/splitstream_py.c(42) : see declaration of 'splitstream_generator_new'
    src/python/splitstream_py.c(247) : warning C4133: 'return' : incompatible types - from 'Generator *' to 'int *'
    src/python/splitstream_py.c(282) : error C2275: 'PyObject' : illegal use of this type as an expression
            c:\python34\include\object.h(109) : see declaration of 'PyObject'
    src/python/splitstream_py.c(282) : error C2065: 'readargs' : undeclared identifier
    src/python/splitstream_py.c(283) : error C2275: 'PyObject' : illegal use ofthis type as an expression
            c:\python34\include\object.h(109) : see declaration of 'PyObject'
    src/python/splitstream_py.c(283) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(292) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(292) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
    src/python/splitstream_py.c(302) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(302) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
    src/python/splitstream_py.c(312) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(312) : warning C4047: '=' : 'int' differs in levels of indirection from 'void *'
    src/python/splitstream_py.c(317) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(317) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
    src/python/splitstream_py.c(324) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(324) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
    src/python/splitstream_py.c(331) : error C2065: 'readargs' : undeclared identifier
    src/python/splitstream_py.c(331) : warning C4047: 'function' : 'PyObject *' differs in levels of indirection from 'int'
    src/python/splitstream_py.c(331) : warning C4024: 'splitfile_pure_once' : different types for formal and actual parameter 3
    src/python/splitstream_py.c(332) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(332) : warning C4047: '=' : 'int' differs in levels of indirection from 'void *'
    src/python/splitstream_py.c(335) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(335) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
    src/python/splitstream_py.c(342) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(342) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *'
    src/python/splitstream_py.c(347) : error C2065: 'readargs' : undeclared identifier
    src/python/splitstream_py.c(349) : error C2065: 'ret' : undeclared identifier
    src/python/splitstream_py.c(349) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int'
    error: command 'c:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\Bin\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\IEUser\\AppData\\Local\\Temp\\pip-build-5_lph0n_\\splitstream\\setup
.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\IEUser\AppData\Local\Temp\pip-m3ik0w3g-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\IEUser\AppData\Local\Temp\pip-build-5_lph0n_\splitstream\
rickardp commented 7 years ago

Than you for reporting! It looks like Visual Studio is not allowing C99 syntax. This is indeed something that should work "out of the box" if pip install does this. I will try to reproduce on a clean VM, as I don't have a working Windows installation right now.

arcanosam commented 7 years ago

Hi!

I'm using MS isos: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

Thanks!

arcanosam commented 7 years ago

Hi!

So, this could be the real problem? VS 2010 compiler do not support C99?

https://stackoverflow.com/a/7614436

thanks!

rickardp commented 7 years ago

Oh that is seriously bad, I didn't know that (they were only lagging ten years behind the C standard..), I would have guessed there was just a compiler flag missing.

Is there a reason you have to use VS2010 when compiling, or could you use a more recent VS version?

Currently my idea is that the library should be buildable on a still-supported version of Windows running the dev tools available for download from Microsoft (currently VS2017).

arcanosam commented 7 years ago

my python app must running on windows 7 32 bits.

I try to compiling using visual studio build tools 2015, but give me an error, telling me that visual studio 2010 not found and are required.

I think it's because the version of Python I'm using: 3.4.4. I need to use this version because in windows 7 I don't need to install VC++ Redistributable, so I can use cx_freeze to packing and distribute my app without any third party installation.

Did you think in remake your code using cython?

Could this way be more quickly and more "portable" (for missing a better word) your code?

thanks for your return, hope I'm be help in some way..

Samuel

rickardp commented 7 years ago

The sad story is that Python 2.7 on Windows does not support using C99 as it is hard coded to use a specific compiler (http://aka.ms/vcpython27).

I don't plan on porting this library from C99 to something that the obsolete VC++ 9.0 supports. The unfortunate fact of this is that Python 2.7 is not, and will not, be supported on Windows.

Contributions are of course always welcome, but I am documenting this as a known limitation for now.