initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
From ece3ce581e3ec530eaccfe7f284c52e115ec7aa9 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
|
||||
Date: Wed, 10 Feb 2021 14:22:59 +0100
|
||||
Subject: [PATCH] Strip parenthesized (pkgversion) data from GCC version string
|
||||
to avoid misinterpretation
|
||||
|
||||
See https://github.com/xianyi/OpenBLAS/issues/3099 for details.
|
||||
|
||||
Upstream-status: backport
|
||||
|
||||
[for import into Buildroot]
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
|
||||
|
||||
---
|
||||
f_check | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/f_check b/f_check
|
||||
index e9aca4ff9..ffe9c6b46 100644
|
||||
--- a/f_check
|
||||
+++ b/f_check
|
||||
@@ -75,6 +75,7 @@ if ($compiler eq "") {
|
||||
|
||||
} elsif ($data =~ /GNU/ || $data =~ /GCC/ ) {
|
||||
|
||||
+ $data =~ s/\(+.*?\)+//g;
|
||||
$data =~ /(\d+)\.(\d+).(\d+)/;
|
||||
$major = $1;
|
||||
$minor = $2;
|
||||
@@ -0,0 +1,47 @@
|
||||
From 4d3829fa52240c2b7e48770ab19584db33ba7863 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Date: Fri, 5 Mar 2021 11:17:59 +0100
|
||||
Subject: [PATCH] Makefile: fix support for passing FFLAGS on the make
|
||||
command line
|
||||
|
||||
When openblas is built while passing FFLAGS on the make command line, the
|
||||
compilation of lapack objects will not contain the flags specified in
|
||||
Makefile but _only_ those passed in FFLAGS.
|
||||
|
||||
This can lead to build failure, e.g. because -fPIC is not passed to the
|
||||
compilation of most lapack objects, but is given to the link command:
|
||||
|
||||
.../buildroot/output/host/bin/x86_64-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=4 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.9\" -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I.. -shared -o ../libopenblas_nehalem-r0.3.9.so \
|
||||
-Wl,--whole-archive ../libopenblas_nehalem-r0.3.9.a -Wl,--no-whole-archive \
|
||||
-Wl,-soname,libopenblas.so.0 -lm -lgfortran -lm -lgfortran
|
||||
.../buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/9.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: ../libopenblas_nehalem-r0.3.9.a(sbdsvdx.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
|
||||
|
||||
In the initial support for this principle, added in commit
|
||||
d0e731e8b825e7a554f245aa8f1118dcec9e2728, the flags specified in the
|
||||
makefile were appended to the flags specified on the command-line.
|
||||
|
||||
Fix this situation by using 'override' for 'FFLAGS' in
|
||||
lapack-netlib/make.inc. The flags passed on the command-line are already
|
||||
part of the LAPACK_FFLAGS variable, so no '+=' is needed here.
|
||||
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index fc5fe3f5..8ae1ff47 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -248,7 +248,7 @@ prof_lapack : lapack_prebuild
|
||||
lapack_prebuild :
|
||||
ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
|
||||
-@echo "FC = $(FC)" > $(NETLIB_LAPACK_DIR)/make.inc
|
||||
- -@echo "FFLAGS = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
|
||||
+ -@echo "override FFLAGS = $(LAPACK_FFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
|
||||
-@echo "POPTS = $(LAPACK_FPFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
|
||||
-@echo "FFLAGS_NOOPT = -O0 $(LAPACK_NOOPT)" >> $(NETLIB_LAPACK_DIR)/make.inc
|
||||
-@echo "PNOOPT = $(LAPACK_FPFLAGS) -O0" >> $(NETLIB_LAPACK_DIR)/make.inc
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From ced08de1ad74811bc23d74121751537bfd8e9556 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Date: Fri, 5 Mar 2021 11:15:52 +0100
|
||||
Subject: [PATCH] Makefile: also consider -O, -Og and -Os when stripping flags
|
||||
|
||||
gcc also supports -O, -Og and -Os as optimization flags.
|
||||
They may be given on the make command-line by users.
|
||||
|
||||
For the calculation of LAPACK_NOOPT, all such flags should be considered.
|
||||
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index a22e16ba..fc5fe3f5 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -32,7 +32,7 @@ export NOFORTRAN
|
||||
export NO_LAPACK
|
||||
endif
|
||||
|
||||
-LAPACK_NOOPT := $(filter-out -O0 -O1 -O2 -O3 -Ofast,$(LAPACK_FFLAGS))
|
||||
+LAPACK_NOOPT := $(filter-out -O0 -O1 -O2 -O3 -Ofast -O -Og -Os,$(LAPACK_FFLAGS))
|
||||
|
||||
SUBDIRS_ALL = $(SUBDIRS) test ctest utest exports benchmark ../laswp ../bench cpp_thread_test
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 6d1c1350977d74fb2239f765bd92a5763cd3bb73 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Date: Fri, 5 Mar 2021 14:09:23 +0100
|
||||
Subject: [PATCH] Makefile.system: don't specify optimization level
|
||||
[buildroot-specific]
|
||||
|
||||
Buildroot will pass an optimization level, but it is ignored because the
|
||||
openblas makefiles _append_ to the flags passed on the command-line.
|
||||
|
||||
The CFLAGS/FFLAGS would e.g. contain '-Os -O2' in which -O2 survives.
|
||||
|
||||
Remove the optimization level specified in openblas itself.
|
||||
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
|
||||
---
|
||||
Makefile.system | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile.system b/Makefile.system
|
||||
index 1e30d05a..04b0be16 100644
|
||||
--- a/Makefile.system
|
||||
+++ b/Makefile.system
|
||||
@@ -1216,11 +1216,11 @@ FCOMMON_OPT += -g
|
||||
endif
|
||||
|
||||
ifndef COMMON_OPT
|
||||
-COMMON_OPT = -O2
|
||||
+COMMON_OPT =
|
||||
endif
|
||||
|
||||
ifndef FCOMMON_OPT
|
||||
-FCOMMON_OPT = -O2 -frecursive
|
||||
+FCOMMON_OPT = -frecursive
|
||||
endif
|
||||
|
||||
override CFLAGS += $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR)
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
config BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET
|
||||
string
|
||||
default "P2" if BR2_x86_pentium2
|
||||
default "KATMAI" if BR2_x86_pentium3
|
||||
default "NORTHWOOD" if BR2_x86_pentium4
|
||||
default "PRESCOTT" if BR2_x86_prescott || BR2_x86_nocona
|
||||
default "BANIAS" if BR2_x86_pentium_m
|
||||
default "CORE2" if BR2_x86_core2
|
||||
default "NEHALEM" if BR2_x86_corei7 || BR2_x86_silvermont || BR2_x86_westmere
|
||||
default "SANDYBRIDGE" if BR2_x86_corei7_avx
|
||||
default "HASWELL" if BR2_x86_core_avx2
|
||||
default "ATOM" if BR2_x86_atom
|
||||
default "ATHLON" if BR2_x86_athlon || BR2_x86_athlon_4
|
||||
default "OPTERON" if BR2_x86_opteron
|
||||
default "OPTERON_SSE3" if BR2_x86_opteron_sse3
|
||||
default "BARCELONA" if BR2_x86_barcelona
|
||||
default "BOBCAT" if BR2_x86_jaguar
|
||||
default "STEAMROLLER" if BR2_x86_steamroller
|
||||
default "VIAC3" if BR2_x86_c3 || BR2_x86_c32
|
||||
default "POWER4" if BR2_powerpc_power4
|
||||
default "POWER5" if BR2_powerpc_power5
|
||||
default "POWER6" if BR2_powerpc_power6
|
||||
default "POWER7" if BR2_powerpc_power7
|
||||
default "POWER8" if BR2_powerpc_power8
|
||||
default "PPCG4" if BR2_powerpc_7400 || BR2_powerpc_7450
|
||||
default "PPC970" if BR2_powerpc_970
|
||||
default "PPC440" if BR2_powerpc_440
|
||||
default "PPC440FP2" if BR2_powerpc_440fp
|
||||
# P5600 is built with MSA support which is only available in Codescape toolchains
|
||||
default "P5600" if BR2_mips_p5600 && BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS
|
||||
default "SICORTEX" if BR2_MIPS_CPU_MIPS64
|
||||
# I6400 is built with MSA support which is only available in Codescape toolchains
|
||||
default "I6400" if BR2_mips_i6400 && BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS
|
||||
# OpenBLAS assumes SPARC=Sparc v9
|
||||
default "SPARC" if BR2_sparc_v9
|
||||
# Cortex-A15 always have a VFPv4
|
||||
default "CORTEXA15" if (BR2_cortex_a15 && BR2_ARM_EABIHF)
|
||||
# Cortex-A9 have an optional VFPv3, so we need to make sure it
|
||||
# is available
|
||||
default "CORTEXA9" if (BR2_cortex_a9 && BR2_ARM_EABIHF && \
|
||||
BR2_ARM_CPU_HAS_VFPV3)
|
||||
default "ARMV5" if BR2_ARM_CPU_ARMV5
|
||||
# On ARMv6, OpenBLAS assumes that a VFP is available, and
|
||||
# EABIhf is used
|
||||
default "ARMV6" if (BR2_ARM_CPU_ARMV6 && BR2_ARM_EABIHF && \
|
||||
BR2_ARM_CPU_HAS_VFPV2)
|
||||
# On ARMv7, OpenBLAS assumes that a full VFPv3+ is available
|
||||
# (and not the more limited D16 variant), and that EABIhf is
|
||||
# used.
|
||||
default "ARMV7" if (BR2_ARM_CPU_ARMV7A && BR2_ARM_EABIHF && \
|
||||
BR2_ARM_CPU_HAS_VFPV3)
|
||||
default "ARMV8" if BR2_aarch64 || BR2_aarch64_be
|
||||
help
|
||||
OpenBLAS target CPU. See TargetList.txt in the source tree for
|
||||
the possible target strings. A possible value is set
|
||||
automatically based on your Target Architecture Variant.
|
||||
|
||||
config BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET != ""
|
||||
|
||||
config BR2_PACKAGE_OPENBLAS
|
||||
bool "openblas"
|
||||
depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS
|
||||
help
|
||||
An optimized BLAS library based on GotoBLAS2 1.13 BSD version.
|
||||
|
||||
https://www.openblas.net/
|
||||
|
||||
if BR2_PACKAGE_OPENBLAS
|
||||
|
||||
config BR2_PACKAGE_OPENBLAS_TARGET
|
||||
string "OpenBLAS target CPU"
|
||||
default BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET
|
||||
|
||||
config BR2_PACKAGE_OPENBLAS_USE_THREAD
|
||||
bool "use multithreading"
|
||||
default y
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on !BR2_STATIC_LIBS
|
||||
help
|
||||
Tell OpenBLAS to use multithreading, by passing USE_THREAD=1.
|
||||
|
||||
config BR2_PACKAGE_OPENBLAS_USE_LOCKING
|
||||
bool "use locking"
|
||||
default y
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on !BR2_PACKAGE_OPENBLAS_USE_THREAD
|
||||
help
|
||||
Tell OpenBLAS to use locking, by passing USE_LOCKING=1.
|
||||
Locking is implicitly enabled when USE_THREAD=1.
|
||||
However, if USE_THREAD=0 (i.e. OpenBLAS itself will run in
|
||||
single-threaded mode) but an application makes OpenBLAS
|
||||
function calls from multiple threads, then locking is
|
||||
mandatory for correct operation.
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 17d4677264dfbc4433e97076220adc79b050e4f8a083ea3f853a53af253bc380 openblas-0.3.9.tar.gz
|
||||
sha256 190b5a9c8d9723fe958ad33916bd7346d96fab3c5ea90832bb02d854f620fcff LICENSE
|
||||
@@ -0,0 +1,79 @@
|
||||
################################################################################
|
||||
#
|
||||
# openblas
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPENBLAS_VERSION = 0.3.9
|
||||
OPENBLAS_SITE = $(call github,xianyi,OpenBLAS,v$(OPENBLAS_VERSION))
|
||||
OPENBLAS_LICENSE = BSD-3-Clause
|
||||
OPENBLAS_LICENSE_FILES = LICENSE
|
||||
OPENBLAS_INSTALL_STAGING = YES
|
||||
|
||||
# Initialise OpenBLAS make options to $(TARGET_CONFIGURE_OPTS)
|
||||
OPENBLAS_MAKE_OPTS = $(TARGET_CONFIGURE_OPTS)
|
||||
|
||||
# Enable cross-compiling
|
||||
OPENBLAS_MAKE_OPTS += CROSS=1
|
||||
|
||||
# Set OpenBLAS target
|
||||
OPENBLAS_MAKE_OPTS += TARGET=$(BR2_PACKAGE_OPENBLAS_TARGET)
|
||||
|
||||
# When Fortran is not available, only build the C version of BLAS
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),)
|
||||
OPENBLAS_MAKE_OPTS += ONLY_CBLAS=1
|
||||
endif
|
||||
|
||||
# Enable/Disable multi-threading (not for static-only since it uses dlfcn.h)
|
||||
ifeq ($(BR2_PACKAGE_OPENBLAS_USE_THREAD),y)
|
||||
OPENBLAS_MAKE_OPTS += USE_THREAD=1
|
||||
else
|
||||
OPENBLAS_MAKE_OPTS += USE_THREAD=0
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENBLAS_USE_LOCKING),y)
|
||||
OPENBLAS_MAKE_OPTS += USE_LOCKING=1
|
||||
else
|
||||
# not passing USE_LOCKING=0 as this could be confusing: its effect is implicit
|
||||
# in case of USE_THREAD=1.
|
||||
endif
|
||||
|
||||
# We don't know if OpenMP is available or not, so disable
|
||||
OPENBLAS_MAKE_OPTS += USE_OPENMP=0
|
||||
|
||||
# Static-only/Shared-only toggle
|
||||
# Note: static library is always generated so that applications can link
|
||||
# statically for size reduction, even if BR2_STATIC_LIBS is not set.
|
||||
ifeq ($(BR2_STATIC_LIBS),y)
|
||||
OPENBLAS_MAKE_OPTS += NO_SHARED=1
|
||||
endif
|
||||
|
||||
# binutils version <= 2.23.2 has a bug
|
||||
# (https://sourceware.org/bugzilla/show_bug.cgi?id=14887) where
|
||||
# whitespaces in ARM register specifications such as [ r1, #12 ] or [
|
||||
# r2 ] cause the assembler to reject the code. Since there are
|
||||
# numerous instances of such cases in the code, we use sed rather than
|
||||
# a patch. We simply replace [ foobar ] by [foobar] to work around the
|
||||
# problem.
|
||||
define OPENBLAS_FIXUP_ARM_ASSEMBLY
|
||||
$(SED) 's%\[\s*%\[%;s%\s*\]%\]%' $(@D)/kernel/arm/*.S
|
||||
endef
|
||||
|
||||
OPENBLAS_POST_PATCH_HOOKS += OPENBLAS_FIXUP_ARM_ASSEMBLY
|
||||
|
||||
define OPENBLAS_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(OPENBLAS_MAKE_OPTS) \
|
||||
-C $(@D)
|
||||
endef
|
||||
|
||||
define OPENBLAS_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(OPENBLAS_MAKE_OPTS) \
|
||||
-C $(@D) install PREFIX=$(STAGING_DIR)/usr
|
||||
endef
|
||||
|
||||
define OPENBLAS_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(OPENBLAS_MAKE_OPTS) \
|
||||
-C $(@D) install PREFIX=$(TARGET_DIR)/usr
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user