From: SourceForge.net <no...@so...> - 2011-05-11 17:24:48
|
Bugs item #3300614, was opened at 2011-05-11 13:24 Message generated for change (Tracker Item Submitted) made by dynamphorous You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: octave Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: dynamphorous (dynamphorous) Assigned to: Xavier Delacour (xavier98) Summary: swig doesn't work with Octave Initial Comment: I have opened this on stack overflow as well at http://stackoverflow.com/questions/5887494/using-swig-to-create-octave-file But thus far no responses there of any merit. Here is what happens. Even the most simple C or C++ program wont compile for Ocatve using swig. The documentation appears to be wrong for this, so either I'm doing something wrong, or the documentation is out of date. The commands I use are: swig -octave -o swig_test_wrap.cpp swig_test.i mkoctfile swig_test_wrap.cpp swig_test.c The order of the -o and the .i file is backwards from the docs, but otherwise it complains that swig_test.i is an unrecognized command when entered the same way as the documentation. The other thing it complains about is mkoctfile returns 4 errors consistently swig_test_wrap.cpp:1449:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_type::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' swig_test_wrap.cpp:1657:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_ref::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' I am assuming that this is a SWIG bug, not an octave bug, mostly because SWIG wants to natively produce a .cxx file, which when you feed it the -octave parameter, it seems that someone should have known that mkoctfile cant take a file of type .cxx. It only works with .cpp .C and .cc. The contents of my test_swig.c and test_swig.i are not important to include, since they are just the example code given in the SWIG documentation. And I have tried little changes too, to no avail. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 |
From: SourceForge.net <no...@so...> - 2011-05-13 12:35:00
|
Bugs item #3300614, was opened at 2011-05-11 19:24 Message generated for change (Comment added) made by kwwette You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: octave Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: dynamphorous (dynamphorous) Assigned to: Xavier Delacour (xavier98) Summary: swig doesn't work with Octave Initial Comment: I have opened this on stack overflow as well at http://stackoverflow.com/questions/5887494/using-swig-to-create-octave-file But thus far no responses there of any merit. Here is what happens. Even the most simple C or C++ program wont compile for Ocatve using swig. The documentation appears to be wrong for this, so either I'm doing something wrong, or the documentation is out of date. The commands I use are: swig -octave -o swig_test_wrap.cpp swig_test.i mkoctfile swig_test_wrap.cpp swig_test.c The order of the -o and the .i file is backwards from the docs, but otherwise it complains that swig_test.i is an unrecognized command when entered the same way as the documentation. The other thing it complains about is mkoctfile returns 4 errors consistently swig_test_wrap.cpp:1449:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_type::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' swig_test_wrap.cpp:1657:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_ref::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' I am assuming that this is a SWIG bug, not an octave bug, mostly because SWIG wants to natively produce a .cxx file, which when you feed it the -octave parameter, it seems that someone should have known that mkoctfile cant take a file of type .cxx. It only works with .cpp .C and .cc. The contents of my test_swig.c and test_swig.i are not important to include, since they are just the example code given in the SWIG documentation. And I have tried little changes too, to no avail. ---------------------------------------------------------------------- Comment By: Karl Wette (kwwette) Date: 2011-05-13 14:34 Message: Hi, You do need to put the .i file at the end of the command line - this seems to be an odd quirk in how SWIG processes its command line arguments. The .cxx problem is more a bug in mkoctfile, which for some reason doesn't recognize .cxx as a valid extension for a C++ file. As for the compilation errors - I'm guessing you're using a newish version of Octave? I think at some point the class "Octave_map" was renamed to "octave_map" in Octave - but this hasn't been changed in the SWIG Octave module yet. You could try adding this to your .i file: %begin %{ #define Octave_map octave_map %} If that doesn't work, try downgrading to v3.2.4, which I've been using successfully with SWIG. Cheers, Karl PS: the SWIG mailing list might be a better place to address questions in future (http://www.swig.org/mail.html) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 |
From: SourceForge.net <no...@so...> - 2011-05-13 15:59:29
|
Bugs item #3300614, was opened at 2011-05-11 13:24 Message generated for change (Comment added) made by dynamphorous You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: octave Group: None Status: Open >Resolution: Accepted Priority: 5 Private: No Submitted By: dynamphorous (dynamphorous) Assigned to: Xavier Delacour (xavier98) Summary: swig doesn't work with Octave Initial Comment: I have opened this on stack overflow as well at http://stackoverflow.com/questions/5887494/using-swig-to-create-octave-file But thus far no responses there of any merit. Here is what happens. Even the most simple C or C++ program wont compile for Ocatve using swig. The documentation appears to be wrong for this, so either I'm doing something wrong, or the documentation is out of date. The commands I use are: swig -octave -o swig_test_wrap.cpp swig_test.i mkoctfile swig_test_wrap.cpp swig_test.c The order of the -o and the .i file is backwards from the docs, but otherwise it complains that swig_test.i is an unrecognized command when entered the same way as the documentation. The other thing it complains about is mkoctfile returns 4 errors consistently swig_test_wrap.cpp:1449:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_type::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' swig_test_wrap.cpp:1657:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_ref::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' I am assuming that this is a SWIG bug, not an octave bug, mostly because SWIG wants to natively produce a .cxx file, which when you feed it the -octave parameter, it seems that someone should have known that mkoctfile cant take a file of type .cxx. It only works with .cpp .C and .cc. The contents of my test_swig.c and test_swig.i are not important to include, since they are just the example code given in the SWIG documentation. And I have tried little changes too, to no avail. ---------------------------------------------------------------------- >Comment By: dynamphorous (dynamphorous) Date: 2011-05-13 11:59 Message: Karl, Thank you for responding to me. I had tried using the mailing list a few days ago, and I have also tried stackoverflow and a few other resources. You are by far the most helpful thus far. So I tried what you suggested, and I just got a bunch of errors telling me that octave_map is not defined. You were compltely correct about me using a rather new version of Octave, (3.4.0) and when I downgraded to 3.2.4-r3 I found that it works just fine. Thank you for your time, I appreciate the help. Sincerely -Dan ---------------------------------------------------------------------- Comment By: Karl Wette (kwwette) Date: 2011-05-13 08:34 Message: Hi, You do need to put the .i file at the end of the command line - this seems to be an odd quirk in how SWIG processes its command line arguments. The .cxx problem is more a bug in mkoctfile, which for some reason doesn't recognize .cxx as a valid extension for a C++ file. As for the compilation errors - I'm guessing you're using a newish version of Octave? I think at some point the class "Octave_map" was renamed to "octave_map" in Octave - but this hasn't been changed in the SWIG Octave module yet. You could try adding this to your .i file: %begin %{ #define Octave_map octave_map %} If that doesn't work, try downgrading to v3.2.4, which I've been using successfully with SWIG. Cheers, Karl PS: the SWIG mailing list might be a better place to address questions in future (http://www.swig.org/mail.html) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 |
From: SourceForge.net <no...@so...> - 2011-05-21 21:36:14
|
Bugs item #3300614, was opened at 2011-05-11 17:24 Message generated for change (Comment added) made by wsfulton You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: octave Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: dynamphorous (dynamphorous) Assigned to: Xavier Delacour (xavier98) Summary: swig doesn't work with Octave Initial Comment: I have opened this on stack overflow as well at http://stackoverflow.com/questions/5887494/using-swig-to-create-octave-file But thus far no responses there of any merit. Here is what happens. Even the most simple C or C++ program wont compile for Ocatve using swig. The documentation appears to be wrong for this, so either I'm doing something wrong, or the documentation is out of date. The commands I use are: swig -octave -o swig_test_wrap.cpp swig_test.i mkoctfile swig_test_wrap.cpp swig_test.c The order of the -o and the .i file is backwards from the docs, but otherwise it complains that swig_test.i is an unrecognized command when entered the same way as the documentation. The other thing it complains about is mkoctfile returns 4 errors consistently swig_test_wrap.cpp:1449:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_type::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' swig_test_wrap.cpp:1657:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_ref::map_value() const' /usr/include/octave-3.4.0/octave/../octave/ov-base.h:560:22: error: overriding 'virtual octave_map octave_base_value::map_value() const' I am assuming that this is a SWIG bug, not an octave bug, mostly because SWIG wants to natively produce a .cxx file, which when you feed it the -octave parameter, it seems that someone should have known that mkoctfile cant take a file of type .cxx. It only works with .cpp .C and .cc. The contents of my test_swig.c and test_swig.i are not important to include, since they are just the example code given in the SWIG documentation. And I have tried little changes too, to no avail. ---------------------------------------------------------------------- >Comment By: William Fulton (wsfulton) Date: 2011-05-21 21:36 Message: Octave 3.4.0 is now working with swig-2.0.4 ---------------------------------------------------------------------- Comment By: dynamphorous (dynamphorous) Date: 2011-05-13 15:59 Message: Karl, Thank you for responding to me. I had tried using the mailing list a few days ago, and I have also tried stackoverflow and a few other resources. You are by far the most helpful thus far. So I tried what you suggested, and I just got a bunch of errors telling me that octave_map is not defined. You were compltely correct about me using a rather new version of Octave, (3.4.0) and when I downgraded to 3.2.4-r3 I found that it works just fine. Thank you for your time, I appreciate the help. Sincerely -Dan ---------------------------------------------------------------------- Comment By: Karl Wette (kwwette) Date: 2011-05-13 12:34 Message: Hi, You do need to put the .i file at the end of the command line - this seems to be an odd quirk in how SWIG processes its command line arguments. The .cxx problem is more a bug in mkoctfile, which for some reason doesn't recognize .cxx as a valid extension for a C++ file. As for the compilation errors - I'm guessing you're using a newish version of Octave? I think at some point the class "Octave_map" was renamed to "octave_map" in Octave - but this hasn't been changed in the SWIG Octave module yet. You could try adding this to your .i file: %begin %{ #define Octave_map octave_map %} If that doesn't work, try downgrading to v3.2.4, which I've been using successfully with SWIG. Cheers, Karl PS: the SWIG mailing list might be a better place to address questions in future (http://www.swig.org/mail.html) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3300614&group_id=1645 |