SIP python

Hi Guys.

I finally could make it. I’ve work it out and compiled using the python
support and everything else.

Now that it works, I’m trying to use some scripting through SIP. I’ve tried
to compile the ones exiting on trunk/sip. The configure.py worked but when I
try to make, I got this output:

color.sip:6:28: error: avogadro/color.h: No such file or directory
primitive.sip:6:32: error: avogadro/primitive.h: No such file or directory
engine.sip:6:29: error: avogadro/engine.h: No such file or directory
painterdevice.sip:6:36: error: avogadro/painterdevice.h: No such file or
directory
primitivelist.sip:6:36: error: avogadro/primitivelist.h: No such file or
directory
camera.sip:6:29: error: avogadro/camera.h: No such file or directory
painter.sip:6:30: error: avogadro/painter.h: No such file or directory
eigen.sip:10:33: error: Numeric/arrayobject.h: No such file or directory
glwidget.sip:6:31: error: avogadro/glwidget.h: No such file or directory
plugin.sip:6:29: error: avogadro/plugin.h: No such file or directory
sipAvoSIPcmodule.cpp:486: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:486: error: expected constructor, destructor, or type
conversion before ‘’ token
sipAvoSIPcmodule.cpp:502: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:502: error: expected ‘,’ or ‘…’ before '
’ token
sipAvoSIPcmodule.cpp: In function ‘void sipVH_AvoSIP_3(sip_gilstate_t,
PyObject*, int)’:
sipAvoSIPcmodule.cpp:504: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp: At global scope:
sipAvoSIPcmodule.cpp:502: warning: unused parameter 'Color’
sipAvoSIPcmodule.cpp:515: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:515: error: expected ‘,’ or ‘…’ before ‘’ token
sipAvoSIPcmodule.cpp: In function 'void sipVH_AvoSIP_4(sip_gilstate_t,
PyObject
, int)’:
sipAvoSIPcmodule.cpp:517: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp: At global scope:
sipAvoSIPcmodule.cpp:515: warning: unused parameter 'Primitive’
sipAvoSIPcmodule.cpp:528: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:528: error: expected constructor, destructor, or type
conversion before ‘’ token
sipAvoSIPcmodule.cpp:560: error: expected ‘,’ or ‘…’ before ‘::’ token
sipAvoSIPcmodule.cpp:560: error: ISO C++ forbids declaration of 'Avogadro’
with no type
sipAvoSIPcmodule.cpp: In function 'double sipVH_AvoSIP_7(sip_gilstate_t,
PyObject
, int)’:
sipAvoSIPcmodule.cpp:563: error: expected type-specifier before ‘Avogadro’
sipAvoSIPcmodule.cpp:563: error: expected >' before 'Avogadro' sipAvoSIPcmodule.cpp:563: error: expected(’ before 'Avogadro’
sipAvoSIPcmodule.cpp:563: error: ‘Avogadro’ is not a class or namespace
sipAvoSIPcmodule.cpp:563: error: expected primary-expression before '>'
token
sipAvoSIPcmodule.cpp:563: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp:563: error: expected type-specifier before ‘Avogadro’
sipAvoSIPcmodule.cpp:563: error: expected >' before 'Avogadro' sipAvoSIPcmodule.cpp:563: error: expected(’ before 'Avogadro’
sipAvoSIPcmodule.cpp:563: error: ‘Avogadro’ is not a class or namespace
sipAvoSIPcmodule.cpp:563: error: expected primary-expression before '>‘
token
sipAvoSIPcmodule.cpp:563: error: ‘a1’ was not declared in this scope
sipAvoSIPcmodule.cpp:563: error: expected )' before ';' token sipAvoSIPcmodule.cpp: At global scope: sipAvoSIPcmodule.cpp:560: warning: unused parameter 'Avogadro' sipAvoSIPcmodule.cpp:576: error: expected ',' or '...' before '::' token sipAvoSIPcmodule.cpp:576: error: ISO C++ forbids declaration of 'Avogadro' with no type sipAvoSIPcmodule.cpp: In function 'void sipVH_AvoSIP_8(sip_gilstate_t, PyObject*, int)': sipAvoSIPcmodule.cpp:578: error: expected type-specifier before 'Avogadro' sipAvoSIPcmodule.cpp:578: error: expected>’ before ‘Avogadro’
sipAvoSIPcmodule.cpp:578: error: expected (' before 'Avogadro' sipAvoSIPcmodule.cpp:578: error: 'Avogadro' is not a class or namespace sipAvoSIPcmodule.cpp:578: error: expected primary-expression before '>' token sipAvoSIPcmodule.cpp:578: error: 'a0' was not declared in this scope sipAvoSIPcmodule.cpp: At global scope: sipAvoSIPcmodule.cpp:576: warning: unused parameter 'Avogadro' sipAvoSIPcmodule.cpp:589: error: 'Avogadro' has not been declared sipAvoSIPcmodule.cpp:589: error: expected ',' or '...' before '*' token sipAvoSIPcmodule.cpp: In function 'bool sipVH_AvoSIP_9(sip_gilstate_t, PyObject*, int)': sipAvoSIPcmodule.cpp:592: error: 'a0' was not declared in this scope sipAvoSIPcmodule.cpp: At global scope: sipAvoSIPcmodule.cpp:589: warning: unused parameter 'PainterDevice' sipAvoSIPcmodule.cpp:605: error: 'Avogadro' has not been declared sipAvoSIPcmodule.cpp:605: error: expected initializer before '*' token sipAvoSIPcmodule.cpp:621: error: expected ',' or '...' before '::' token sipAvoSIPcmodule.cpp:621: error: ISO C++ forbids declaration of 'Avogadro' with no type sipAvoSIPcmodule.cpp: In function 'double sipVH_AvoSIP_11(sip_gilstate_t, PyObject*, int)': sipAvoSIPcmodule.cpp:624: error: expected type-specifier before 'Avogadro' sipAvoSIPcmodule.cpp:624: error: expected>’ before ‘Avogadro’
sipAvoSIPcmodule.cpp:624: error: expected (' before 'Avogadro' sipAvoSIPcmodule.cpp:624: error: 'Avogadro' is not a class or namespace sipAvoSIPcmodule.cpp:624: error: expected primary-expression before '>' token sipAvoSIPcmodule.cpp:624: error: 'a0' was not declared in this scope sipAvoSIPcmodule.cpp: At global scope: sipAvoSIPcmodule.cpp:621: warning: unused parameter 'Avogadro' sipAvoSIPcmodule.cpp:637: error: expected ',' or '...' before '::' token sipAvoSIPcmodule.cpp:637: error: ISO C++ forbids declaration of 'Avogadro' with no type sipAvoSIPcmodule.cpp: In function 'bool sipVH_AvoSIP_12(sip_gilstate_t, PyObject*, int)': sipAvoSIPcmodule.cpp:640: error: expected type-specifier before 'Avogadro' sipAvoSIPcmodule.cpp:640: error: expected>’ before ‘Avogadro’
sipAvoSIPcmodule.cpp:640: error: expected (' before 'Avogadro' sipAvoSIPcmodule.cpp:640: error: 'Avogadro' is not a class or namespace sipAvoSIPcmodule.cpp:640: error: expected primary-expression before '>' token sipAvoSIPcmodule.cpp:640: error: 'a0' was not declared in this scope sipAvoSIPcmodule.cpp: At global scope: sipAvoSIPcmodule.cpp:637: warning: unused parameter 'Avogadro' sipAvoSIPcmodule.cpp:653: error: 'Avogadro' has not been declared sipAvoSIPcmodule.cpp:653: error: expected constructor, destructor, or type conversion before '*' token sipAvoSIPcmodule.cpp:669: error: 'Avogadro' has not been declared sipAvoSIPcmodule.cpp:669: error: expected constructor, destructor, or type conversion before '*' token sipAvoSIPcmodule.cpp:876: error: expected ',' or '...' before '::' token sipAvoSIPcmodule.cpp:876: error: ISO C++ forbids declaration of 'Avogadro' with no type sipAvoSIPcmodule.cpp: In function 'void sipVH_AvoSIP_29(sip_gilstate_t, PyObject*, int)': sipAvoSIPcmodule.cpp:878: error: expected type-specifier before 'Avogadro' sipAvoSIPcmodule.cpp:878: error: expected>’ before ‘Avogadro’
sipAvoSIPcmodule.cpp:878: error: expected (' before 'Avogadro' sipAvoSIPcmodule.cpp:878: error: 'Avogadro' is not a class or namespace sipAvoSIPcmodule.cpp:878: error: expected primary-expression before '>' token sipAvoSIPcmodule.cpp:878: error: 'a0' was not declared in this scope sipAvoSIPcmodule.cpp: At global scope: sipAvoSIPcmodule.cpp:876: warning: unused parameter 'Avogadro' sipAvoSIPcmodule.cpp:889: error: 'Avogadro' has not been declared sipAvoSIPcmodule.cpp:889: error: expected ',' or '...' before 'a0' sipAvoSIPcmodule.cpp: In function 'void sipVH_AvoSIP_30(sip_gilstate_t, PyObject*, int)': sipAvoSIPcmodule.cpp:891: error: 'a0' was not declared in this scope sipAvoSIPcmodule.cpp:891: error: 'a1' was not declared in this scope sipAvoSIPcmodule.cpp: At global scope: sipAvoSIPcmodule.cpp:889: warning: unused parameter 'Type' sipAvoSIPcmodule.cpp:902: error: expected ',' or '...' before '::' token sipAvoSIPcmodule.cpp:902: error: ISO C++ forbids declaration of 'Avogadro' with no type sipAvoSIPcmodule.cpp: In function 'void sipVH_AvoSIP_31(sip_gilstate_t, PyObject*, int)': sipAvoSIPcmodule.cpp:904: error: expected type-specifier before 'Avogadro' sipAvoSIPcmodule.cpp:904: error: expected>’ before ‘Avogadro’
sipAvoSIPcmodule.cpp:904: error: expected `(’ before 'Avogadro’
sipAvoSIPcmodule.cpp:904: error: ‘Avogadro’ is not a class or namespace
sipAvoSIPcmodule.cpp:904: error: expected primary-expression before '>'
token
sipAvoSIPcmodule.cpp:904: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp: At global scope:
sipAvoSIPcmodule.cpp:902: warning: unused parameter 'Avogadro’
sipAvoSIPcmodule.cpp:915: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:915: error: expected ‘,’ or ‘…’ before ‘’ token
sipAvoSIPcmodule.cpp: In function 'void sipVH_AvoSIP_32(sip_gilstate_t,
PyObject
, int)’:
sipAvoSIPcmodule.cpp:917: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp: At global scope:
sipAvoSIPcmodule.cpp:915: warning: unused parameter 'Molecule’
sipAvoSIPcmodule.cpp:928: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:928: error: expected ‘,’ or ‘…’ before ‘’ token
sipAvoSIPcmodule.cpp: In function 'bool sipVH_AvoSIP_33(sip_gilstate_t,
PyObject
, int)’:
sipAvoSIPcmodule.cpp:931: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp: At global scope:
sipAvoSIPcmodule.cpp:928: warning: unused parameter 'GLWidget’
sipAvoSIPcmodule.cpp:944: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:944: error: expected ‘,’ or ‘…’ before ‘’ token
sipAvoSIPcmodule.cpp: In function 'QUndoCommand

sipVH_AvoSIP_34(sip_gilstate_t, PyObject*, int)’:
sipAvoSIPcmodule.cpp:947: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp:947: error: ‘a1’ was not declared in this scope
sipAvoSIPcmodule.cpp: At global scope:
sipAvoSIPcmodule.cpp:944: warning: unused parameter 'GLWidget’
sipAvoSIPcmodule.cpp:960: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:960: error: expected ‘,’ or ‘…’ before ‘’ token
sipAvoSIPcmodule.cpp: In function 'QUndoCommand

sipVH_AvoSIP_35(sip_gilstate_t, PyObject*, int)’:
sipAvoSIPcmodule.cpp:963: error: ‘a0’ was not declared in this scope
sipAvoSIPcmodule.cpp:963: error: ‘a1’ was not declared in this scope
sipAvoSIPcmodule.cpp: At global scope:
sipAvoSIPcmodule.cpp:960: warning: unused parameter 'GLWidget’
sipAvoSIPcmodule.cpp:992: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:992: error: expected constructor, destructor, or type
conversion before 'sipVH_AvoSIP_37’
sipAvoSIPcmodule.cpp:1008: error: ‘Avogadro’ has not been declared
sipAvoSIPcmodule.cpp:1008: error: expected constructor, destructor, or type
conversion before ‘*’ token
sipAvoSIPcmodule.cpp:1139: error: ‘sipVH_AvoSIP_2’ was not declared in this
scope
sipAvoSIPcmodule.cpp:1142: error: ‘sipVH_AvoSIP_5’ was not declared in this
scope
sipAvoSIPcmodule.cpp:1147: error: ‘sipVH_AvoSIP_10’ was not declared in this
scope
sipAvoSIPcmodule.cpp:1150: error: ‘sipVH_AvoSIP_13’ was not declared in this
scope
sipAvoSIPcmodule.cpp:1151: error: ‘sipVH_AvoSIP_14’ was not declared in this
scope
sipAvoSIPcmodule.cpp:1174: error: ‘sipVH_AvoSIP_37’ was not declared in this
scope
sipAvoSIPcmodule.cpp:1175: error: ‘sipVH_AvoSIP_38’ was not declared in this
scope
sipAvoSIPcmodule.cpp: In function ‘void initAvoSIP()’:
sipAvoSIPcmodule.cpp:1279: error: ‘Avogadro’ was not declared in this scope
sipAvoSIPcmodule.cpp:1279: error: parse error in template argument list
sipAvoSIPcmodule.cpp:1279: error: no matching function for call to
’qRegisterMetaType(const char [24])'
sipAvoSIPcmodule.cpp:1280: error: ‘Avogadro’ cannot appear in a
constant-expression
sipAvoSIPcmodule.cpp:1280: error: parse error in template argument list
sipAvoSIPcmodule.cpp:1280: error: no matching function for call to
’qRegisterMetaType(const char [16])'
make: *** [sipAvoSIPcmodule.o] Error 1

Actually, I’ve never used sip bindings before, and maybe I’m missing
something important here, am I?


Leandro A. Boscariol

Well, I’ve managed out and could pass by the first errors.

color.sip:6:28: error: avogadro/color.h: No such file or directory
primitive.sip:6:32: error: avogadro/primitive.h: No such file or directory
engine.sip:6:29: error: avogadro/engine.h: No such file or directory
painterdevice.sip:6:36: error: avogadro/painterdevice.h: No such file or
directory
primitivelist.sip:6:36: error: avogadro/primitivelist.h: No such file or
directory
camera.sip:6:29: error: avogadro/camera.h: No such file or directory
painter.sip:6:30: error: avogadro/painter.h: No such file or directory

To the ones related to avogadro/*.h, I just added in configure.py at
makefile.extra_include_dirs my avogadro local instalation include dir.

eigen.sip:10:33: error: Numeric/arrayobject.h: No such file or directory

Here, I could’t find anywere the Numeric package, so I’d digged it out a bit
and found that it was replaced by numpy, so, I did the same to the includes
on eigen.sip.

#include <numpy/arrayobject.h>

and added the numpy include dir to makefile.extra_include_dirs as well.

But now, compiling the sip bindings I got this:

/usr/lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:958:
warning: ‘int _import_array()’ defined but not used
/usr/lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:958:
warning: ‘int _import_array()’ defined but not used
/opt/avogadro/include/avogadro/camera.h: In member function
’Avogadro::Camera& Avogadro::camera::operator=(const Avogadro::Camera&)’:
/opt/avogadro/include/avogadro/camera.h:66: error: non-static const member
’Avogadro::CameraPrivate* const Avogadro::camera::d’, can’t use default
assignment operator
sipAvoSIPAvogadroCamera.cpp: In function ‘void assign_Avogadro_Camera(void*,
const void*)’:
sipAvoSIPAvogadroCamera.cpp:822: note: synthesized method ‘Avogadro::Camera&
Avogadro::camera::operator=(const Avogadro::Camera&)’ first required here
/usr/lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:
At global scope:
/usr/lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:958:
warning: ‘int _import_array()’ defined but not used
make: *** [sipAvoSIPAvogadroCamera.o] Error 1
make: *** Waiting for unfinished jobs…
/usr/lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:958:
warning: ‘int _import_array()’ defined but not used

And I don’t know what to do from now on. Its still something related to
includes and my local instalation?


Leandro A. Boscariol