I'm forwarding the following mail from Ryan Hinton ([email protected]), because he's not subscribed to the list:
[begin forwarded email] I'm having problems with C header #include order, and maybe something more. The easiest way I know to reproduce the bug is to add from sage.rings.polynomial.polynomial_gf2x cimport Polynomial_GF2X near the top of a random .pyx file in the Sage source. I used sage/finance/fractal.pyx and got $ sage -b ---------------------------------------------------------- sage: Building and installing modified Sage library files. Installing c_lib scons: `install' is up to date. Updating Cython code.... Building modified file sage/finance/fractal.pyx. python2.5 `which cython` --embed-positions --incref-local-binop -I/home/ryan/sage/devel/sage-sage-patches -o sage/finance/fractal.c sage/finance/fractal.pyx sage/finance/fractal.pyx --> /home/ryan/sage/local//lib/python/site-packages//sage/finance/fractal.pyx Time to execute 1 commands: 7.48708200455 seconds Finished compiling Cython code (time = 8.25148797035 seconds) running install running build running build_py running build_ext building 'sage.finance.fractal' extension gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ryan/sage/local//include -I/home/ryan/sage/local//include/csage -I/home/ryan/sage/devel//sage/sage/ext -I/home/ryan/sage/local/include/python2.5 -c sage/finance/fractal.c -o build/temp.linux-i686-2.5/sage/finance/fractal.o -w In file included from sage/finance/fractal.c:112: /home/ryan/sage/local//include/csage/ntl_wrap.h:47: error: expected ‘)’ before ‘*’ token /home/ryan/sage/local//include/csage/ntl_wrap.h:48: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token /home/ryan/sage/local//include/csage/ntl_wrap.h:90: error: expected ‘)’ before ‘*’ token sage/finance/fractal.c:397: error: field ‘x’ has incomplete type error: command 'gcc' failed with exit status 1 sage: There was an error installing modified sage library code. Looking at the generated C code, it appears that ntl_wrap.h is included before gmp.h, but ntl_wrap.h uses the mpz_t type defined in gmp.h. The second error I have since fixed -- it requires the #clang c++ directive. Please copy me on any follow-ups as I am not (yet) subscribed to the list. Enjoy! --- Ryan Hinton PhD candidate, electrical engineering University of Virginia _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
