Re-enable and fix 8e0c425 (BLIS_ENABLE_SYSTEM).

Details:
- Re-enable the changes originally made in 8e0c425 but quickly reverted
  in 2be78fc.
- Moved the #include of bli_config.h so that it occurs before the
  #include of bli_system.h. This allows the #define BLIS_ENABLE_SYSTEM
  or #define BLIS_DISABLE_SYSTEM in bli_config.h to be processed by the
  time it is needed in bli_system.h. This change should have been
  in the original 8e0c425, but was accidentally omitted. Thanks to Minh
  Quan Ho for catching this.
- Add #define BLIS_ENABLE_SYSTEM to config_detect.c so that the proper
  cpp conditional branch executes in bli_system.h when compiling the
  hardware detection binary. The changes made in 8e0c425 were an attempt
  to support the definition of BLIS_OS_NONE when configuring with
  --disable-system (in issue #532).  That commit failed because, aside
  from the required but omitted header reordering (second bullet above),
  AppVeyor was unable to compile the hardware detection binary as a
  result of missing Windows headers. This commit, which builds on PR
  #546, should help fix that issue. Thanks to Minh Quan Ho for his
  assistance and patience on this matter.
This commit is contained in:
Field G. Van Zee
2021-09-20 15:42:08 -05:00
parent 52f29f739d
commit fb93d242a4
3 changed files with 26 additions and 6 deletions

View File

@@ -33,8 +33,20 @@
*/
// The BLIS_ENABLE_SYSTEM macro must be defined so that the proper branches in
// bli_system.h are processed. (This macro is normally defined in bli_config.h.)
#define BLIS_ENABLE_SYSTEM
// Use C-style static inline functions for the static inline functions that are
// defined by the headers below. (This macro is normally defined in
// bli_config_macro_defs.h.)
#define BLIS_INLINE static
// Since we're not building a shared library, we can forego the use of the
// BLIS_EXPORT_BLIS annotations by #defining them to be nothing. (This macro is
// normally defined in bli_config_macro_defs.h.)
#define BLIS_EXPORT_BLIS
#include "bli_system.h"
#include "bli_type_defs.h"
#include "bli_arch.h"

View File

@@ -70,7 +70,7 @@
#endif
// Determine the target operating system.
//#if defined(BLIS_ENABLE_SYSTEM)
#if defined(BLIS_ENABLE_SYSTEM)
#if defined(_WIN32) || defined(__CYGWIN__)
#define BLIS_OS_WINDOWS 1
#elif defined(__gnu_hurd__)
@@ -94,9 +94,9 @@
#else
#error "Cannot determine operating system"
#endif
//#else // #if defined(BLIS_DISABLE_SYSTEM)
// #define BLIS_OS_NONE
//#endif
#else // #if defined(BLIS_DISABLE_SYSTEM)
#define BLIS_OS_NONE
#endif
// A few changes that may be necessary in Windows environments.
#if BLIS_OS_WINDOWS

View File

@@ -48,6 +48,15 @@ extern "C" {
// NOTE: PLEASE DON'T CHANGE THE ORDER IN WHICH HEADERS ARE INCLUDED UNLESS
// YOU ARE SURE THAT IT DOESN'T BREAK INTER-HEADER MACRO DEPENDENCIES.
// -- configure definitions --
// NOTE: bli_config.h header must be included before any BLIS header.
// It is bootstrapped by ./configure and does not depend on later
// headers. Moreover, these configuration variables are necessary to change
// some default behaviors (e.g. disable OS-detection in bli_system.h in case
// of --disable-system).
#include "bli_config.h"
// -- System and language-related headers --
// NOTE: bli_system.h header must be included before bli_config_macro_defs.h.
@@ -55,9 +64,8 @@ extern "C" {
#include "bli_lang_defs.h"
// -- configure definitions --
// -- configure default definitions --
#include "bli_config.h"
#include "bli_config_macro_defs.h"