From e394c7459cb8e9ab3166b72cb37f96f559b2981f Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Wed, 1 May 2019 19:13:00 -0500 Subject: [PATCH] Define _POSIX_C_SOURCE in bli_system.h. Details: - Added #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #endif to bli_system.h so that an application that uses BLIS (specifically, an application that #includes blis.h) does not need to remember to #define the macro itself (either on the command line or in the code that includes blis.h) in order to activate things like the pthreads. Thanks to Christos Psarras for reporting this issue and suggesting this fix. - Commented out #include in bli_system.h, since I don't think this header is used/needed anymore. - Comment update to function macro for bli_?normiv_unb_var1() in frame/util/bli_util_unb_var1.c. --- frame/include/bli_system.h | 9 ++++++++- frame/util/bli_util_unb_var1.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frame/include/bli_system.h b/frame/include/bli_system.h index 084999ab5..d91df6803 100644 --- a/frame/include/bli_system.h +++ b/frame/include/bli_system.h @@ -36,6 +36,12 @@ #ifndef BLIS_SYSTEM_H #define BLIS_SYSTEM_H +// NOTE: If not yet defined, we define _POSIX_C_SOURCE to make sure that +// various parts of POSIX are defined and made available. +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif + #include #include #include @@ -111,7 +117,8 @@ #elif BLIS_OS_OSX #include #else - #include + //#include + #include #endif diff --git a/frame/util/bli_util_unb_var1.c b/frame/util/bli_util_unb_var1.c index 32197819a..a12cdbd5c 100644 --- a/frame/util/bli_util_unb_var1.c +++ b/frame/util/bli_util_unb_var1.c @@ -466,7 +466,7 @@ void PASTEMAC(ch,varname) \ /* If the absolute value of the current element exceeds that of the previous largest, save it and its index. If NaN is encountered, then treat it the same as if it were a valid - value that was smaller than any previously seen. This + value that was larger than any previously seen. This behavior mimics that of LAPACK's ?lange(). */ \ if ( abs_chi1_max < abs_chi1 || bli_isnan( abs_chi1 ) ) \ { \