... I currently cannot test this, as I then run into other lxml compilation problems, see below.
However, I see these other problems also with gcc 4.2.1, so they don't seem related
to the compiler version, but rather be either an lxml-specific or a more general cython
problem.
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/apps/prod//include -I/apps/prod//include/libxml2 -I/apps/prod/include/libxml2 -I/apps/prod/include -I/apps/pydev/include/python2.4 -c src/lxml/lxml.objectify.c -o build/temp.solaris-2.8-sun4u-2.4/src/lxml/lxml.objectify.o -w
In file included from src/lxml/lxml.objectify.c:52:
src/lxml/lxml.etree_api.h: In function `import_lxml__etree':
src/lxml/lxml.etree_api.h:219: sizeof applied to an incomplete type
src/lxml/lxml.etree_api.h:220: sizeof applied to an incomplete type
src/lxml/lxml.etree_api.h:221: sizeof applied to an incomplete type
src/lxml/lxml.etree_api.h:222: sizeof applied to an incomplete type
src/lxml/lxml.etree_api.h:223: sizeof applied to an incomplete type
src/lxml/lxml.etree_api.h:224: sizeof applied to an incomplete type
src/lxml/lxml.etree_api.h:225: sizeof applied to an incomplete type
src/lxml/lxml.etree_api.h:226: sizeof applied to an incomplete type
src/lxml/lxml.objectify.c: At top level:
src/lxml/lxml.objectify.c:248: field `__pyx_base' has incomplete type
src/lxml/lxml.objectify.c:260: field `__pyx_base' has incomplete type
src/lxml/lxml.objectify.c:274: field `__pyx_base' has incomplete type
src/lxml/lxml.objectify.c:286: field `__pyx_base' has incomplete type
src/lxml/lxml.objectify.c:310: field `__pyx_base' has incomplete type
src/lxml/lxml.objectify.c:322: field `__pyx_base' has incomplete type
src/lxml/lxml.objectify.c:334: field `__pyx_base' has incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get__':
src/lxml/lxml.objectify.c:1150: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:1150: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:1165: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:1216: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_pf_4lxml_9objectify_18ObjectifiedElement___setattr__':
src/lxml/lxml.objectify.c:1714: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_pf_4lxml_9objectify_18ObjectifiedElement___setitem__':
src/lxml/lxml.objectify.c:2349: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_f_4lxml_9objectify__lookupChild':
src/lxml/lxml.objectify.c:3438: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:3513: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_f_4lxml_9objectify__buildChildTag':
src/lxml/lxml.objectify.c:3702: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:3702: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_f_4lxml_9objectify__replaceElement':
src/lxml/lxml.objectify.c:3781: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:3781: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:3897: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_f_4lxml_9objectify__appendValue':
src/lxml/lxml.objectify.c:3937: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:3937: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4043: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_f_4lxml_9objectify__setElementValue':
src/lxml/lxml.objectify.c:4136: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4285: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4298: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_f_4lxml_9objectify__setSlice':
src/lxml/lxml.objectify.c:4497: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4497: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4521: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4841: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4853: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4867: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4867: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4867: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:4940: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c:5026: dereferencing pointer to incomplete type
src/lxml/lxml.objectify.c: In function `__pyx_f_4lxml_9objectify__strValueOf':
src/lxml/lxml.objectify.c:8097: dereferencing pointer to incomplete type
if (__Pyx_ImportFunction(module, "previousElement", (void**)&previousElement, "xmlNode *(xmlNode *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "appendChild", (void**)&appendChild, "void (struct LxmlElement *, struct LxmlElement *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "pyunicode", (void**)&pyunicode, "PyObject *(char *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "utf8", (void**)&utf8, "PyObject *(PyObject *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "getNsTag", (void**)&getNsTag, "PyObject *(PyObject *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "namespacedName", (void**)&namespacedName, "PyObject *(xmlNode *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "namespacedNameFromNsName", (void**)&namespacedNameFromNsName, "PyObject *(char *, char *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "iteratorStoreNext", (void**)&iteratorStoreNext, "void (struct LxmlElementIterator *, struct LxmlElement *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "initTagMatch", (void**)&initTagMatch, "void (struct LxmlElementTagMatcher *, PyObject *)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "findOrBuildNodeNsPrefix", (void**)&findOrBuildNodeNsPrefix, "xmlNs *(struct LxmlDocument *, xmlNode *, char *, char *)") < 0) goto bad;
Py_DECREF(module); module = 0;
__pyx_ptype_4lxml_5etree__Document = __Pyx_ImportType("lxml.etree", "_Document", sizeof(struct LxmlDocument)); if (!__pyx_ptype_4lxml_5etree__Document) goto bad;
__pyx_ptype_4lxml_5etree__Element = __Pyx_ImportType("lxml.etree", "_Element", sizeof(struct LxmlElement)); if (!__pyx_ptype_4lxml_5etree__Element) goto bad;
__pyx_ptype_4lxml_5etree__ElementTree = __Pyx_ImportType("lxml.etree", "_ElementTree", sizeof(struct LxmlElementTree)); if (!__pyx_ptype_4lxml_5etree__ElementTree) goto bad;
__pyx_ptype_4lxml_5etree__ElementTagMatcher = __Pyx_ImportType("lxml.etree", "_ElementTagMatcher", sizeof(struct LxmlElementTagMatcher)); if (!__pyx_ptype_4lxml_5etree__ElementTagMatcher) goto bad;
__pyx_ptype_4lxml_5etree__ElementIterator = __Pyx_ImportType("lxml.etree", "_ElementIterator", sizeof(struct LxmlElementIterator)); if (!__pyx_ptype_4lxml_5etree__ElementIterator) goto bad;
__pyx_ptype_4lxml_5etree_ElementBase = __Pyx_ImportType("lxml.etree", "ElementBase", sizeof(struct LxmlElementBase)); if (!__pyx_ptype_4lxml_5etree_ElementBase) goto bad;
__pyx_ptype_4lxml_5etree_ElementClassLookup = __Pyx_ImportType("lxml.etree", "ElementClassLookup", sizeof(struct LxmlElementClassLookup)); if (!__pyx_ptype_4lxml_5etree_ElementClassLookup) goto bad;
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup = __Pyx_ImportType("lxml.etree", "FallbackElementClassLookup", sizeof(struct LxmlFallbackElementClassLookup)); if (!__pyx_ptype_4lxml_5etree_FallbackElementClassLookup) goto bad;
return 0;
bad:
Py_XDECREF(module);
return -1;
}
While I *think* this should be a trivial fix for the problem:
diff -r e005b58d83b8 Cython/ Compiler/ ModuleNode. py Compiler/ ModuleNode. py Tue Apr 08 01:25:09 2008 -0700 Compiler/ ModuleNode. py Tue Apr 15 14:22:51 2008 +0200 Nodes.Node, Nodes.Block
code. putln(" %s; /*proto*/" % header)
code. putln(" %s {" % header) var_declaration s(env.temp_ entries)
code. putln(" static int __Pyx_unique = 0;")
code. putln(" if (__Pyx_unique==1) return;")
code. putln(" __Pyx_unique = 1;") var_declaration s(env.temp_ entries)
code. putln(" /*--- Execution code ---*/")
code. mark_pos( None)
self. body.generate_ execution_ code(code)
--- a/Cython/
+++ b/Cython/
@@ -1443,10 +1443,10 @@ class ModuleNode(
header = "PyMODINIT_FUNC init2%s(void)" % env.module_name
+ code.put_
- code.put_
... I currently cannot test this, as I then run into other lxml compilation problems, see below.
However, I see these other problems also with gcc 4.2.1, so they don't seem related
to the compiler version, but rather be either an lxml-specific or a more general cython
problem.
gcc -fno-strict- aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/apps/ prod//include -I/apps/ prod//include/ libxml2 -I/apps/ prod/include/ libxml2 -I/apps/ prod/include -I/apps/ pydev/include/ python2. 4 -c src/lxml/ lxml.objectify. c -o build/temp. solaris- 2.8-sun4u- 2.4/src/ lxml/lxml. objectify. o -w lxml.objectify. c:52: lxml.etree_ api.h: In function `import_ lxml__etree' : lxml.etree_ api.h:219: sizeof applied to an incomplete type lxml.etree_ api.h:220: sizeof applied to an incomplete type lxml.etree_ api.h:221: sizeof applied to an incomplete type lxml.etree_ api.h:222: sizeof applied to an incomplete type lxml.etree_ api.h:223: sizeof applied to an incomplete type lxml.etree_ api.h:224: sizeof applied to an incomplete type lxml.etree_ api.h:225: sizeof applied to an incomplete type lxml.etree_ api.h:226: sizeof applied to an incomplete type lxml.objectify. c: At top level: lxml.objectify. c:248: field `__pyx_base' has incomplete type lxml.objectify. c:260: field `__pyx_base' has incomplete type lxml.objectify. c:274: field `__pyx_base' has incomplete type lxml.objectify. c:286: field `__pyx_base' has incomplete type lxml.objectify. c:310: field `__pyx_base' has incomplete type lxml.objectify. c:322: field `__pyx_base' has incomplete type lxml.objectify. c:334: field `__pyx_base' has incomplete type lxml.objectify. c: In function `__pyx_ pf_4lxml_ 9objectify_ 18ObjectifiedEl ement_8_ _dict__ ___get_ _': lxml.objectify. c:1150: dereferencing pointer to incomplete type lxml.objectify. c:1150: dereferencing pointer to incomplete type lxml.objectify. c:1165: dereferencing pointer to incomplete type lxml.objectify. c:1216: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ pf_4lxml_ 9objectify_ 18ObjectifiedEl ement__ _setattr_ _': lxml.objectify. c:1714: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ pf_4lxml_ 9objectify_ 18ObjectifiedEl ement__ _setitem_ _': lxml.objectify. c:2349: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ f_4lxml_ 9objectify_ _lookupChild' : lxml.objectify. c:3438: dereferencing pointer to incomplete type lxml.objectify. c:3513: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ f_4lxml_ 9objectify_ _buildChildTag' : lxml.objectify. c:3702: dereferencing pointer to incomplete type lxml.objectify. c:3702: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ f_4lxml_ 9objectify_ _replaceElement ': lxml.objectify. c:3781: dereferencing pointer to incomplete type lxml.objectify. c:3781: dereferencing pointer to incomplete type lxml.objectify. c:3897: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ f_4lxml_ 9objectify_ _appendValue' : lxml.objectify. c:3937: dereferencing pointer to incomplete type lxml.objectify. c:3937: dereferencing pointer to incomplete type lxml.objectify. c:4043: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ f_4lxml_ 9objectify_ _setElementValu e': lxml.objectify. c:4136: dereferencing pointer to incomplete type lxml.objectify. c:4285: dereferencing pointer to incomplete type lxml.objectify. c:4298: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ f_4lxml_ 9objectify_ _setSlice' : lxml.objectify. c:4497: dereferencing pointer to incomplete type lxml.objectify. c:4497: dereferencing pointer to incomplete type lxml.objectify. c:4521: dereferencing pointer to incomplete type lxml.objectify. c:4841: dereferencing pointer to incomplete type lxml.objectify. c:4853: dereferencing pointer to incomplete type lxml.objectify. c:4867: dereferencing pointer to incomplete type lxml.objectify. c:4867: dereferencing pointer to incomplete type lxml.objectify. c:4867: dereferencing pointer to incomplete type lxml.objectify. c:4940: dereferencing pointer to incomplete type lxml.objectify. c:5026: dereferencing pointer to incomplete type lxml.objectify. c: In function `__pyx_ f_4lxml_ 9objectify_ _strValueOf' : lxml.objectify. c:8097: dereferencing pointer to incomplete type ImportFunction( module, "previousElement", (void** )&previousEleme nt, "xmlNode *(xmlNode *)") < 0) goto bad; ImportFunction( module, "appendChild", (void** )&appendChild, "void (struct LxmlElement *, struct LxmlElement *)") < 0) goto bad; ImportFunction( module, "pyunicode", (void**)&pyunicode, "PyObject *(char *)") < 0) goto bad; ImportFunction( module, "utf8", (void**)&utf8, "PyObject *(PyObject *)") < 0) goto bad; ImportFunction( module, "getNsTag", (void**)&getNsTag, "PyObject *(PyObject *)") < 0) goto bad; ImportFunction( module, "namespacedName", (void** )&namespacedNam e, "PyObject *(xmlNode *)") < 0) goto bad; ImportFunction( module, "namespacedName FromNsName" , (void** )&namespacedNam eFromNsName, "PyObject *(char *, char *)") < 0) goto bad; ImportFunction( module, "iteratorStoreN ext", (void** )&iteratorStore Next, "void (struct LxmlElementIterator *, struct LxmlElement *)") < 0) goto bad; ImportFunction( module, "initTagMatch", (void** )&initTagMatch, "void (struct LxmlElementTagM atcher *, PyObject *)") < 0) goto bad; ImportFunction( module, "findOrBuildNod eNsPrefix" , (void** )&findOrBuildNo deNsPrefix, "xmlNs *(struct LxmlDocument *, xmlNode *, char *, char *)") < 0) goto bad; module) ; module = 0; ptype_4lxml_ 5etree_ _Document = __Pyx_ImportTyp e("lxml. etree", "_Document", sizeof(struct LxmlDocument)); if (!__pyx_ ptype_4lxml_ 5etree_ _Document) goto bad; ptype_4lxml_ 5etree_ _Element = __Pyx_ImportTyp e("lxml. etree", "_Element", sizeof(struct LxmlElement)); if (!__pyx_ ptype_4lxml_ 5etree_ _Element) goto bad; ptype_4lxml_ 5etree_ _ElementTree = __Pyx_ImportTyp e("lxml. etree", "_ElementTree", sizeof(struct LxmlElementTree)); if (!__pyx_ ptype_4lxml_ 5etree_ _ElementTree) goto bad; ptype_4lxml_ 5etree_ _ElementTagMatc her = __Pyx_ImportTyp e("lxml. etree", "_ElementTagMat cher", sizeof(struct LxmlElementTagM atcher) ); if (!__pyx_ ptype_4lxml_ 5etree_ _ElementTagMatc her) goto bad; ptype_4lxml_ 5etree_ _ElementIterato r = __Pyx_ImportTyp e("lxml. etree", "_ElementIterator", sizeof(struct LxmlElementIter ator)); if (!__pyx_ ptype_4lxml_ 5etree_ _ElementIterato r) goto bad; ptype_4lxml_ 5etree_ ElementBase = __Pyx_ImportTyp e("lxml. etree", "ElementBase", sizeof(struct LxmlElementBase)); if (!__pyx_ ptype_4lxml_ 5etree_ ElementBase) goto bad; ptype_4lxml_ 5etree_ ElementClassLoo kup = __Pyx_ImportTyp e("lxml. etree", "ElementClassLo okup", sizeof(struct LxmlElementClas sLookup) ); if (!__pyx_ ptype_4lxml_ 5etree_ ElementClassLoo kup) goto bad; ptype_4lxml_ 5etree_ FallbackElement ClassLookup = __Pyx_ImportTyp e("lxml. etree", "FallbackElemen tClassLookup" , sizeof(struct LxmlFallbackEle mentClassLookup )); if (!__pyx_ ptype_4lxml_ 5etree_ FallbackElement ClassLookup) goto bad; module) ;
In file included from src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
src/lxml/
if (__Pyx_
if (__Pyx_
if (__Pyx_
if (__Pyx_
if (__Pyx_
if (__Pyx_
if (__Pyx_
if (__Pyx_
if (__Pyx_
if (__Pyx_
Py_DECREF(
__pyx_
__pyx_
__pyx_
__pyx_
__pyx_
__pyx_
__pyx_
__pyx_
return 0;
bad:
Py_XDECREF(
return -1;
}