Skip to content

Commit 2966845

Browse files
authored
Merge pull request #2925 from martin-frbg/issue2911-2
Add binutils version check as prerequisite for POWER10 in DYNAMIC_ARCH build
2 parents ee83e29 + 1a0f57c commit 2966845

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Makefile.system

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,18 +641,22 @@ DYNAMIC_CORE += POWER8
641641
ifneq ($(C_COMPILER), GCC)
642642
DYNAMIC_CORE += POWER9
643643
DYNAMIC_CORE += POWER10
644+
CCOMMON_OPT += -DHAVE_P10_SUPPORT
644645
endif
645646
ifeq ($(C_COMPILER), GCC)
646647
ifeq ($(GCCVERSIONGT5), 1)
647648
DYNAMIC_CORE += POWER9
648649
else
649650
$(info, OpenBLAS: Your gcc version is too old to build the POWER9 kernels.)
650651
endif
651-
ifeq ($(GCCVERSIONGTEQ11), 1)
652+
LDVERSIONGTEQ35 := $(shell expr `ld --version | head -1 | cut -f2 -d "." | cut -f1 -d "-"` >= 35)
653+
ifeq ($(GCCVERSIONGTEQ11)$(LDVERSIONGTEQ35), 11)
652654
DYNAMIC_CORE += POWER10
655+
CCOMMON_OPT += -DHAVE_P10_SUPPORT
653656
else ifeq ($(GCCVERSIONGTEQ10), 1)
654-
ifeq ($(GCCMINORVERSIONGTEQ2), 1)
657+
ifeq ($(GCCMINORVERSIONGTEQ2)$(LDVERSIONGTEQ35), 11)
655658
DYNAMIC_CORE += POWER10
659+
CCOMMON_OPT += -DHAVE_P10_SUPPORT
656660
endif
657661
else
658662
$(info, OpenBLAS: Your gcc version is too old to build the POWER10 kernels.)

cmake/arch.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if (DYNAMIC_ARCH)
4949

5050
if (POWER)
5151
set(DYNAMIC_CORE POWER6 POWER8 POWER9 POWER10)
52+
set(CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_P10_SUPPORT")
5253
endif ()
5354

5455
if (X86)

driver/others/dynamic_power.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ extern gotoblas_t gotoblas_POWER8;
66
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
77
extern gotoblas_t gotoblas_POWER9;
88
#endif
9-
#if (!defined __GNUC__) || ( __GNUC__ >= 11) \
10-
|| (__GNUC__ == 10 && __GNUC_MINOR__ >= 2)
11-
#define HAVE_P10_SUPPORT 1
12-
#endif
9+
//#if (!defined __GNUC__) || ( __GNUC__ >= 11) \
10+
// || (__GNUC__ == 10 && __GNUC_MINOR__ >= 2)
11+
//#define HAVE_P10_SUPPORT 1
12+
//#endif
1313
#ifdef HAVE_P10_SUPPORT
1414
extern gotoblas_t gotoblas_POWER10;
1515
#endif

0 commit comments

Comments
 (0)