Stefan / cplusplus-sig,
Based on Stefan's encouragement, I developed a minimal complete test case
exhibiting this problem, contained in the attached files. The compilation
command I used was:
g++ -DBOOST_PYTHON_MAX_ARITY=40 -I/data/cmejia/install/boost_1_39_0
-I/data/include/python2.6
-c -o foo.o foo.cpp
As I explained earlier in the first message of this thread, this fails to
compile, but if I remove one double argument towards the end (i.e. edit out
one line of foo.hpp and two lines of foo.cpp) it does compile successfully.
I would appreciate any further insight into this problem, and
hopefully we can use this test case to make Boost.Python an even better
tool.
Thanks in advance,
--Chris
P.S. Unfortunately, I was unable to include preprocessed source from
"g++ ... -E foo.cpp" because the result was too large for the mailing list
system.
Christopher A Mejia wrote:
Stefan,
Thanks for your response. The API that I am trying to wrap is the
Data Client Server portion of the U.S. Naval Research Labs' SIMDIS
Analysis & Display Tool (simdis.nrl.navy.mil). This is free software,
but does require registration and there is a human in the loop of the
approval process. Anyway, I don't feel comfortable redistributing the
software (or preprocessed details), but if you're really interested
you could obtain it directly yourself.
Sorry, I'm not interested enough to register at this time. :-)
I merely tried to be helpful in debugging the issue.
Apparently this API is a good test case for pushing some of the limits
of Boost.Python. Since you agree that this is probably a compiler
issue, it's unlikely that you or anyone else would be able to
reproduce the same errors anyway.
The only compiler issue I mentioned was a misleading error message. I
still believe the real issue might be inside boost.python (where some
code may not support your high arity, and can't be configured with
BOOST_PYTHON_MAX_ARITY), but I lack details to be able to confirm this.
I came up with a workaround, which is to wrap a version of the
function without the last three arguments, i.e. from Python I am OK
with always having those last three parameters set to their default
values. But if anyone has any other ideas to try, I'd like to hear them.
It would really be best to construct the proverbial "minimal complete
test case" that allows others to reproduce the issue. You may consider
writing some stand-alone test using similar calls as in your code, which
you then may freely send do this list, or file as an issue to the boost
tracker.
Regards,
Stefan
--
...ich hab' noch einen Koffer in Berlin...
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
The following line is added for your protection and will be used for
analysis if this message is reported as spam:
(Raytheon Analysis: IP=82.94.164.166;
e-from=cplusplus-sig-bounces+camejia=raytheon....@python.org;
from=seef...@sympatico.ca; date=Jun 8, 2009 2:39:33 PM; subject=Re:
[C++-sig] g++ compiler limitations other
than -ftemplate-depth-n and -DBOOST_PYTHON_MAX_ARITY ?)
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "foo.hpp"
namespace bp = boost::python;
BOOST_PYTHON_MODULE(foo_ext){
bp::class_< foo >( "foo" )
.def("bar", (bool(::foo::*)(double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double,
double))(&::foo::bar),
(bp::arg("aaa"),
bp::arg("bbb"),
bp::arg("ccc"),
bp::arg("ddd")=0,
bp::arg("eee")=0,
bp::arg("fff")=0,
bp::arg("ggg")=0,
bp::arg("hhh")=0,
bp::arg("iii")=0,
bp::arg("jjj")=0,
bp::arg("kkk")=0,
bp::arg("lll")=0,
bp::arg("mmm")=0,
bp::arg("nnn")=0,
bp::arg("ooo")=0,
bp::arg("ppp")=0,
bp::arg("qqq")=0,
bp::arg("rrr")=0,
bp::arg("sss")=0,
bp::arg("ttt")=0,
bp::arg("uuu")=0,
bp::arg("vvv")=0,
bp::arg("www")=0,
bp::arg("xxx")=0,
bp::arg("yyy")=0,
bp::arg("zzz")=0));
}
class foo
{
public:
foo();
bool bar(double aaa,
double bbb,
double ccc,
double ddd=0,
double eee=0,
double fff=0,
double ggg=0,
double hhh=0,
double iii=0,
double jjj=0,
double kkk=0,
double lll=0,
double mmm=0,
double nnn=0,
double ooo=0,
double ppp=0,
double qqq=0,
double rrr=0,
double sss=0,
double ttt=0,
double uuu=0,
double vvv=0,
double www=0,
double xxx=0,
double yyy=0,
double zzz=0);
};
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig