Lapack compilation flags

Sylvestre Ledru sylvestre at debian.org
Wed Nov 14 07:37:28 UTC 2012


Hello,

On 14/11/2012 03:08, Victor Liu wrote:
> 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.
> 

I am not against adding this option but, first, could you share the
argument of lapack dev for not doing it by default ?

BTW, could you open a bug report on this subject ?

Thanks,
Sylvestre



More information about the debian-science-maintainers mailing list