Skip to contentSkip to conversation

openblas: new package

PATCH Superseded Vicente Olivert Riera 2 participants 2 messages Jun 24, 2016 – Jun 26, 2016

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 openblas: new package

OpenBLAS is optimised for specific CPU models, which don't fully match with the GCC code generation options. Therefore, we can't automatically select BR2_PACKAGE_OPENBLAS_TARGET based on the CPU choice. Instead, let the user select the TARGET name, but offer a sensible default. Other possible solutions were deemed too complicated: adding choice options in the ambiguous cases, or only making the option user-visible when there is ambiguity.

---
Changes v6 -> v7:
- Change license to BSD-3c. (Baruch)
- Fix indentation for ARM variants. (Yann)
- Don't use += for the first OPENBLAS_MAKE_OPTS assignment. (Yann)
- Use ':' as a separator instead of 'x'. (Yann)
- Move CROSS=1 and TARGET=$(BR2_PACKAGE_OPENBLAS_TARGET) in OPENBLAS_MAKE_OPTS. (Yann)
- Use BR2_ARM_CPU_ARMV7A for ARMV7 OpenBLAS target. (Thomas)
- Use BR2_X86_CPU_HAS_SSE for SSE_GENERIC OpenBLAS target. (Arnout)
- Improve commit log. (Arnout)
- Improve help text for BR2_PACKAGE_OPENBLAS_TARGET. (Arnout)
- Add ARMV5 and ARMV6 OpenBLAS targets. (Arnout)

Changes v5 -> v6:
- Add BR2_PACKAGE_OPENBLAS_ARCH_SUPPORT
- Put openblas targets that depend on "Target Architecture" at bottom. We want the ones depeding on "Target Architecture Variant" first as they are more specific and Buildroot will use the one that matches first.
Changes v4 -> v5:
- Do not use a huge choice with new Buildroot options for every OpenBLAS target. Instead, use a string option with a default value depending on the existing options in arch/Config.in*.

Changes v3 -> v4:
- Disable Fortran by default. It can be added back in the future when we have a BR2_TOOLCHAIN_HAS_FORTRAN hidden symbol.
- Bump version so we can get rid of the patch.
- Match OpenBLAS target cores with Buildroot target cores as much as possible, and drop the ones unsupported in Buildroot.
- Drop the OpenMP bits in the openblas.mk file. It can be added back in the future when we have a BR2_TOOLCHAIN_HAS_OPENMP hidden symbol.

Changes v2 -> v3:
- Switch version to HEAD of develop branch as it contains support for MIPS32.
- Add a patch to fix build failure of P5600 and I6400 targets.
- Add support for OpenMP when toolchain has NPTL threads.

Changes v1 -> v2:
- Multi-threading is not available for static-only since it uses dlfcn.h, so modify the "ifeq" statement accordingly.

 package/Config.in              |  1 +
 package/openblas/Config.in     | 62 ++++++++++++++++++++++++++++++++++++++++++
 package/openblas/openblas.hash |  2 ++
 package/openblas/openblas.mk   | 52 +++++++++++++++++++++++++++++++++++
 4 files changed, 117 insertions(+)
 create mode 100644 package/openblas/Config.in
 create mode 100644 package/openblas/openblas.hash
 create mode 100644 package/openblas/openblas.mk
package/Config.in +1 -0
index 171f4ad..eefc7e1 100644
@@ -1293,6 +1293,7 @@ endif
 	source "package/msgpack/Config.in"
 	source "package/mtdev2tuio/Config.in"
 	source "package/netbsd-queue/Config.in"
+	source "package/openblas/Config.in"
 	source "package/orc/Config.in"
 	source "package/p11-kit/Config.in"
 	source "package/poco/Config.in"
package/openblas/Config.in new file +62 -0

62 lines not on this page · raw message

package/openblas/openblas.hash new file +2 -0
new file mode 100644
index 0000000..b402cac
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 2ad0270a39dbaf891b439baacf198ea4ab149cd6ed39a5f50c494723f1936be5  openblas-f04af36ad0e85b64f12a7c38095383192cc52345.tar.gz
package/openblas/openblas.mk new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.7.3
#1 lore raw

PATCH v7 1/1 openblas: new package

Quoted 7 lines · Vicente Olivert Riera

OpenBLAS is optimised for specific CPU models, which don't fully match with the GCC code generation options. Therefore, we can't automatically select BR2_PACKAGE_OPENBLAS_TARGET based on the CPU choice. Instead, let the user select the TARGET name, but offer a sensible default. Other possible solutions were deemed too complicated: adding choice options in the ambiguous cases, or only making the option user-visible when there is ambiguity.

Unfortunately, the arch dependencies are not going enough, they're going to
lead to build failures. E.g. br-arm-basic.config and br-mips32r6-el-hf-glibc.config don't have a corresponding TARGET. So we will need something better after all...

So, I think the easiest is to do the following. Make the option with all the
defaults a blind option, move it out of the condition, call it BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET. Then do

config BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS

	bool
	default y if BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET != ""

And finally, inside the condition:

config BR2_PACKAGE_OPENBLAS_TARGET
string "OpenBLAS target CPU" default BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET

Can you try that?

Quoted 2 lines

[snip]

package/openblas/openblas.mk line 43

Quoted 7 lines
package/openblas/openblas.mk new file +7 -0
+define OPENBLAS_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) $(OPENBLAS_MAKE_OPTS) \
+		-C $(@D)
+endef
+
+define OPENBLAS_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(OPENBLAS_MAKE_OPTS) \

Minor nit: I prefer to repeat the same options here as for the build, i.e.
include TARGET_CONFIGURE_OPTS.

Actually, maybe you should just initialize

OPENBLAS_MAKE_OPTS = $(TARGET_CONFIGURE_OPTS)

Regards,
Arnout

Quoted 10 lines
package/openblas/openblas.mk new file +9 -0
+		-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))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF