[Numpy-discussion] lock in LinearAlgebra when embedding

Michiel Jan Laurens de Hoon mdehoon at ims.u-tokyo.ac.jp
Tue Jun 22 05:22:17 EDT 2004


This may be related to patch 732520. The problem is that lapack_lite is not 
compiled correctly by setup.py; one part of it should be compiled without 
optimization, but is compiled with. On many platforms, this doesn't cause any 
problems, but on Cygwin (and therefore probably also on MinGW) the eigenvalues 
function hangs as a result. You can get more information by looking up the patch 
on sourceforge.

This issue has come up a couple of times. Maybe we should fix the 
Numeric/numarray source code with this patch or something similar?

--Michiel, U Tokyo.

Sebastien.deMentendeHorne at electrabel.com wrote:

> Hi,
> 
> There is a nasty behaviour in the LinearAlgebra package under windows NT.
> 
> When I run the following script from the command-line (python2.3 on windows
> Enthought edition but I had the same problem with the original python2.3 +
> Numeric 23.3), it returns without problem.
> #####################
> from LinearAlgebra import eigenvalues
> from Numeric import array
> a = array([[3,4],[1,6]])
> print eigenvalues(a)
> #####################
> Output
> [ 2.  7.]
> 
> However, when I evaluate the same script embedded in C, it hangs while
> consuming 100% of the CPU:
> /* C Code */
> #include <Python.h>
> 
> int
> main(int argc, char *argv[])
> {
>   Py_Initialize();
>   PyRun_SimpleString("from LinearAlgebra import eigenvalues\nfrom Numeric
> import array\na = array([[3,4],[1,6]])\nprint eigenvalues(a)\n");
> 
>   Py_Finalize();
>   return 0;
> }
> /* end of C code */
> 
> I compile the code with Mingw
> gcc embed.c -Ic:\python23\include -Lc:\python23 -lpython23
> and gcc -v gives
> 
> Reading specs from
> C:/Python23/Enthought/MingW/bin/../lib/gcc-lib/mingw32/3.2.3/specs
> Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
> --host=mingw32 --target=mingw32 --prefix=/mingw
>  --enable-threads --disable-nls --enable-languages=c++,f77,objc
> --disable-win32-registry --disable-shared --enable-sjlj-
> exceptions
> Thread model: win32
> gcc version 3.2.3 (mingw special 20030504-1)
> 
> I must recompile lapack_lite from source with Mingw in order to get the
> correct behaviour.
> 
> Any hint on a cleaner solution (not recompile lapack_lite whenever I install
> a new version of Numeric).
> 
> Seb
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & Training.
> Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
> digital self defense, top technical experts, no vendor pitches, 
> unmatched networking opportunities. Visit www.blackhat.com
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
> 
> 

-- 
Michiel de Hoon, Assistant Professor
University of Tokyo, Institute of Medical Science
Human Genome Center
4-6-1 Shirokane-dai, Minato-ku
Tokyo 108-8639
Japan
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon





More information about the NumPy-Discussion mailing list