Lapack compilation flags

Victor Liu vkl at stanford.edu
Wed Nov 14 02:08:07 UTC 2012


Dear Science Maintainers,

About two years ago, I reported a problem with Lapack and 
multithreading, which has been accepted into the current errata:

http://www.netlib.org/lapack/Errata/index2.html#_strong_span_class_red_bug0061_span_strong_zgehrd_f_is_overflowing

Since the developers have not addressed the issue yet, a relatively 
simple fix for it on the packaging side is to simply add the 
"-frecursive" flag to gfortran, forcing all local arrays to be allocated 
on the stack (even if they are huge). This would make the compiled 
Lapack library truly thread-safe, and save me much frustration. The only 
adverse effect of this flag that I can think of is that potentially more 
stack space is required. However, the largest single array size is 
around 64 KB, while the typical stack limit is several MB, so this 
should not pose a problem (there are already large arrays just under the 
32 KB default gfortran limit that slip through). With the current 
repository libraries, it is impossible to perform certain computations 
in a multithreaded environment due to memory corruption from variables 
that get statically allocated by the compiler.

Please let me know if you have any concerns, since I seem to be the only 
one actively seeking a solution to this problem. I have submitted a 
partial code fix to the developers, but I don't know if it will be 
accepted or how long it would take to make it into a release.

-- 
Victor Liu
Stanford University
Ph.D. Candidate, Dept. of Electrical Engineering
Ginzton Laboratory, Spilker Building
Mail Code 4088
348 Via Pueblo Mall, Stanford, CA 94305-4088
Phone: (408) 482-6910
Web: http://cylith.dyndns.org/



More information about the debian-science-maintainers mailing list