On Jun 30, 2009, at 7:21 AM, Sébastien Barthélemy wrote:

> Hello,
>
> after a months-long pause, I'm giving a new try to libcdd wrappers,
> and have a few related questions.
>
> first, is it possible to put compile-time definitions (DEF) outside
> the file? As an option to cython or to the Cython.Distutil? It would
> be useful to reflect #ifdef option in cython from the build script and
> avoid some redundancy.

No, that's not possible.

>
> second, is there a way to acces the C file descriptor of python file
> types from cython? I could not find it in cython documentation nor in
> python C-API reference.

Yes, it's in the Python/C API refernce under "objects."

>
> Third, ... well..., it does not work, and I don't understand why. When
> I import my module, it fails with the following traceback.
>
>>>> import pycdd
> ImportError                               Traceback (most recent  
> call last)
> /home/seb/Devel/pypolyhedra/pycdd/<ipython console> in <module>()
> ImportError: ./pycdd.so: undefined symbol: __gmpq_init
>
> any idea of what might happen ?

My guess would be that you're declaring something wrong (given the  
amount of warnings below).

>
> here is the compile log.
>
> $ LANG=C python setup.py build_ext --inplace && ipython test.py
> running build_ext
> cythoning pygmp.pyx to pygmp.c
> building 'pygmp' extension
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c pygmp.c -o
> build/temp.linux-i686-2.6/pygmp.o
> gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
> build/temp.linux-i686-2.6/pygmp.o -lgmp -o pygmp.so
> cythoning pycdd.pyx to pycdd.c
> building 'pycdd' extension
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -Icddlib-094f/lib-src-gmp
> -I/usr/include/python2.6 -c pycdd.c -o
> build/temp.linux-i686-2.6/pycdd.o
> pycdd.c: In function '__pyx_pf_5pycdd_13CddPolyhedron_get_hrep':
> pycdd.c:1061: warning: passing argument 1 of
> '__pyx_convert__to_py_mpq_t' from incompatible pointer type
> pycdd.c:1168: warning: passing argument 1 of
> '__pyx_convert__to_py_mpq_t' from incompatible pointer type
> pycdd.c: In function '__pyx_f_5pycdd__hrep_to_cdd_matrix':
> pycdd.c:1533: warning: passing argument 1 of '__gmpq_set' from
> incompatible pointer type
> pycdd.c:1595: warning: passing argument 1 of '__gmpq_neg' from
> incompatible pointer type
> pycdd.c: In function '__pyx_convert__to_py_mpq_t':
> pycdd.c:2353: warning: label 'bad' defined but not used
> gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
> build/temp.linux-i686-2.6/pycdd.o -Lcddlib-094f/lib-src-gmp -lcddgmp
> -o pycdd.so
>
> The program is available in there:
>  http://perso.crans.org/barthelemy/pycdd.tar.gz
>  http://perso.crans.org/barthelemy/pycdd.git/
>
> but I'was expecting to get it a little bit further before asking  
> for a review.
>
> Thank you for any help !
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to