Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmpfunc in Python 3.0.1 windows installer #49681

Closed
NigelGalloway mannequin opened this issue Mar 6, 2009 · 6 comments
Closed

cmpfunc in Python 3.0.1 windows installer #49681

NigelGalloway mannequin opened this issue Mar 6, 2009 · 6 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@NigelGalloway
Copy link
Mannequin

NigelGalloway mannequin commented Mar 6, 2009

BPO 5431
Nosy @loewis, @terryjreedy, @amauryfa
Files
  • BuildLog.htm: Output Log
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-03-14.00:44:46.665>
    created_at = <Date 2009-03-06.13:22:31.780>
    labels = ['type-bug', 'invalid']
    title = 'cmpfunc in Python 3.0.1 windows installer'
    updated_at = <Date 2009-03-14.00:44:46.657>
    user = 'https://bugs.python.org/NigelGalloway'

    bugs.python.org fields:

    activity = <Date 2009-03-14.00:44:46.657>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-03-14.00:44:46.665>
    closer = 'terry.reedy'
    components = []
    creation = <Date 2009-03-06.13:22:31.780>
    creator = 'Nigel Galloway'
    dependencies = []
    files = ['13254']
    hgrepos = []
    issue_num = 5431
    keywords = []
    message_count = 6.0
    messages = ['83242', '83246', '83247', '83253', '83432', '83553']
    nosy_count = 4.0
    nosy_names = ['loewis', 'terry.reedy', 'amaury.forgeotdarc', 'Nigel Galloway']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5431'
    versions = ['Python 3.0']

    @NigelGalloway
    Copy link
    Mannequin Author

    NigelGalloway mannequin commented Mar 6, 2009

    C:\Users\Nigel\myPython\iajaar>C:\Users\Nigel\swigwin-1.3.38\swig -
    c++ -python -py3 NigelzGLPK.swg

    generated a C++ wrapper and a Python file. When I attempted to compile
    the wrapper against Python 3.0.1 it failed see the output log at the
    end of this message.

    I decided to modify object.h from C:\Python30\include:

    typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
    typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
    typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
    typedef PyObject *(*reprfunc)(PyObject *);
    
    
    typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
    typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
    typedef int (*cmpfunc)(PyObject *, PyObject *);
    typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
    typedef PyObject *(*reprfunc)(PyObject *);

    adding the typedef for cmpfunc. It then compiles fine, AND appears to
    work.

    C:\Users\Nigel\myPython\iajaar\Python>c:\Python30\python
    sample.iajaar.3.py

    • 0: obj =  0.000000000e+000  infeas = 0.000e+000 (0)
      
    • 2: obj =  7.333333333e+002  infeas = 0.000e+000 (0)
      

    OPTIMAL SOLUTION FOUND
    Z = 733.333333333 ; x1 = 33.3333333333 ; x2 = 66.6666666667 ; x3 =
    0.0

    Is this good, or should I do something else?

    Compile Log:

    Build Log Rebuild started: Project: nigelzGLPK, Configuration:
    Release|Win32
    Command Lines Creating temporary
    file "c:\Users\Nigel\Documents\Visual Studio 2008
    \Projects\nigelzGLPK\nigelzGLPK\Release\RSP00001137523960.rsp" with
    contents
    [
    /O2 /Oi /GL /I "C:\Users\Nigel\Documents\Visual Studio 2008
    \Projects\glpk\include" /I "C:\Python30
    \include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "NIGELZG
    LPK_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy
    /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /c /Zi /TP "..\..\..\..\..\myP
    ython\iajaar\NigelzGLPK_wrap.cxx"
    ]
    Creating command line "cl.exe @"c:\Users\Nigel\Documents\Visual Studio
    2008
    \Projects\nigelzGLPK\nigelzGLPK\Release\RSP00001137523960.rsp" /nologo
    /errorReport:prompt"
    Output Window Compiling...
    NigelzGLPK_wrap.cxx
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1772) : error
    C2065: 'cmpfunc' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1772) : error
    C2146: syntax error : missing '}' before
    identifier 'SwigPyObject_compare'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1772) : error
    C2146: syntax error : missing ';' before
    identifier 'SwigPyObject_compare'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1817) : error
    C2059: syntax error : '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1818) : error
    C2065: 'tmp' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1825) : error
    C2059: syntax error : 'return'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1943) : error
    C2065: 'cmpfunc' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1943) : error
    C2146: syntax error : missing '}' before
    identifier 'SwigPyPacked_compare'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1943) : error
    C2146: syntax error : missing ';' before
    identifier 'SwigPyPacked_compare'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1988) : error
    C2059: syntax error : '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1989) : error
    C2065: 'tmp' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1996) : error
    C2059: syntax error : 'return'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1997) : error
    C2059: syntax error : '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1997) : error
    C2143: syntax error : missing ';' before '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1997) : error
    C2059: syntax error : '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2001) : error
    C2143: syntax error : missing ';' before '{'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2001) : error
    C2447: '{' : missing function header (old-style formal list?)
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2400) : error
    C3861: 'SwigPyPacked_New': identifier not found
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2635) : error
    C2059: syntax error : '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2635) : error
    C2143: syntax error : missing ';' before '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2635) : error
    C2059: syntax error : '}'
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2674) : error
    C2065: 'swig_types' : undeclared identifier
    c:\users\nigel\mypython\iajaar\iajaar.h(59) : warning C4290: C++
    exception specification ignored except to indicate a function is not
    __declspec(nothrow)
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3176) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3191) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3207) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3226) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3253) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3277) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3277) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3296) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3318) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3324) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3340) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3346) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3362) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3368) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3383) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3399) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3415) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3442) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3461) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3476) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3492) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3508) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3535) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3560) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3587) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3606) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3621) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3637) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3653) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3680) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3705) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3732) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3757) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3784) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3809) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3836) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3861) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3888) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3913) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3940) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3965) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(3992) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4017) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4044) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4069) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4096) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4121) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4148) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4173) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4200) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4225) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4252) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4277) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4282) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4311) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4317) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4330) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4345) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4361) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4377) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4404) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4429) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4456) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4481) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4508) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4533) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4560) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4585) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4612) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4637) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4664) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4689) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4716) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4741) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4768) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4793) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4820) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4845) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4872) : error
    C2065: 'swig_types' : undeclared identifier
    ..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(4872) : fatal error
    C1003: error count exceeds 100; stopping compilation
    Results Build log was saved
    at "file://c:\Users\Nigel\Documents\Visual Studio 2008
    \Projects\nigelzGLPK\nigelzGLPK\Release\BuildLog.htm"
    nigelzGLPK - 102 error(s), 1 warning(s)

    @NigelGalloway NigelGalloway mannequin added the type-bug An unexpected behavior, bug, or error label Mar 6, 2009
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Mar 6, 2009

    This is not a bug in Python; apparently, SWIG hasn't been ported to
    Python 3.0.1.

    @loewis loewis mannequin closed this as completed Mar 6, 2009
    @loewis loewis mannequin added the invalid label Mar 6, 2009
    @amauryfa
    Copy link
    Member

    amauryfa commented Mar 6, 2009

    I'm sure swig was ported to python 3.0.
    Is 3.0.1 allowed to break code developed with 3.0?

    http://svn.python.org/view/python/branches/release30-maint/Include/object.h?r1=69215&r2=69221

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Mar 6, 2009

    I'm sure swig was ported to python 3.0.
    Is 3.0.1 allowed to break code developed with 3.0?

    Of course it was! Removal of cmp support was a deliberate
    breakage made in 3.0.1, see bpo-1717. In any case,
    it isn't coming back.

    @NigelGalloway
    Copy link
    Mannequin Author

    NigelGalloway mannequin commented Mar 10, 2009

    Not quite an answer to the question. I have built this wrapper with
    the change to Python indicated. It seems to work. It does not complain
    about unresolved references. Is this satisfactory for 3.0.1, with
    perhaps a change to SWIG from 3.1. Or must I obtain Python 3.0 and
    start again?

    @NigelGalloway NigelGalloway mannequin reopened this Mar 10, 2009
    @terryjreedy
    Copy link
    Member

    This development issues tracker is for issues that might result in
    changes in future Python releases. This issue was properly closed and
    in the absence of a new proposal for future change, should have stayed
    closed, even with the addition of a comment.

    The only-half removal of the cmp family in 3.0 was an error. For better
    or for worse, and after much discussion, the developers decided to fix
    the error immediately in 3.0.1 in order to prevent more error-dependent
    portings that would need further fix in 3.1. In other words, better a
    little pain now than more pain in the future.

    What you do with your installation is up to you. If adding a line works
    for you as a temporary measure, great. Or help the SWIG folks to finish
    the port to Python 3 as intended and as it is in 3.0.1 and will be in
    the future.

    Further current-release usage questions should be directed to the
    python-list (or c.l.p or the gmane mirror) or other forums.

    PS. Your original post would have been more readable with the long error
    log severely snipped to just show the essential point.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants