From b402626509070764b2c6e0302e19c7b779372fe0 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 16 Sep 2018 12:43:36 +0200 Subject: [PATCH 1/3] Do not use the new TLS code for non-threaded builds even if USE_TLS is set Workaround for #1761 as that exposed a problem in the new code (which was intended to speed up multithreaded code only anyway). --- driver/others/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index 9d4ab19f5..e73d53fa2 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -73,7 +73,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "common.h" -#if defined(USE_TLS) +#if defined(USE_TLS) && defined(SMP) #define COMPILE_TLS #if defined(__GLIBC_PREREQ) #if !__GLIBC_PREREQ(2,20) From 1ad1e79062d40cc9445e5c2098e15b8c45081a75 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 19 Sep 2018 18:03:43 +0200 Subject: [PATCH 2/3] Catch inadvertent USE_TLS=0 declaration for #1766 --- driver/others/memory.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/driver/others/memory.c b/driver/others/memory.c index e73d53fa2..0019253c0 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -75,6 +75,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if defined(USE_TLS) && defined(SMP) #define COMPILE_TLS + +#if USE_TLS != 1 +#undef COMPILE_TLS +#endif + #if defined(__GLIBC_PREREQ) #if !__GLIBC_PREREQ(2,20) #undef COMPILE_TLS From 288aeea8a285da8551c465681c7b9330a5486e7e Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 19 Sep 2018 18:08:31 +0200 Subject: [PATCH 3/3] Fix default settings - USE_TLS and USE_SIMPLE_THREADED_LEVEL3 should both be off --- Makefile.rule | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.rule b/Makefile.rule index 25ed0357d..8c651412e 100644 --- a/Makefile.rule +++ b/Makefile.rule @@ -107,13 +107,13 @@ BUILD_LAPACK_DEPRECATED = 1 # BUILD_RELAPACK = 1 # If you want to use legacy threaded Level 3 implementation. -USE_SIMPLE_THREADED_LEVEL3 = 1 +# USE_SIMPLE_THREADED_LEVEL3 = 1 # If you want to use the new, still somewhat experimental code that uses # thread-local storage instead of a central memory buffer in memory.c # Note that if your system uses GLIBC, it needs to have at least glibc 2.21 # for this to work. -USE_TLS = 1 +# USE_TLS = 1 # If you want to drive whole 64bit region by BLAS. Not all Fortran # compiler supports this. It's safe to keep comment it out if you