Hi, I asked a question on this mailing list few days ago but nobody could help me. So I wonder if it is more appropriate to post this question on the Scipy-Dev mailing list or to fill a bug repport. Thank you !
KB ----------------- original post : Hi, I'd like to ask for your help regarding the use of SWIG with numpy. ** problem description ** While I can compile successfully the examples provided in ./numpy/doc/swig I can't compile the first example provided in the Cookbook. http://www.scipy.org/Cookbook/SWIG_NumPy_examples "A simple ARGOUT_ARRAY1 example" I have this error: ezrange_wrap.c: In function ‘SWIG_AsVal_long’: ezrange_wrap.c:3227: error: initializer element is not constant ** hypothesis and ugly workaround ** Comparing the examples from ./numpy/doc/swig and from the Cookbook, I noticed the main difference lies in the fact the first are in C++ while the latter in plain C. I "converted" the example from the Coobook to look like a c++ project. Essentially I renamed the .c file with a .cxx extension and I modified setup.py accordingly. This time it compiles successfully and the module is usable in python. ** questions ** 1/ What should I do to compile the Cookbook example with a C compiler? 2/ If it appears swig is now only compatible with the C++ compiler, do you have a practical workaround to propose? (without renaming the C files with a .cxx extension) ? ** configuration ** debian testing i686 swig version 1.3.40 python-numpy version 1.5.1 (I also tried 1.4.1) python version 2.6 _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion