From patchwork Mon Aug 24 13:22:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwenhael Goavec-Merou X-Patchwork-Id: 1350375 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=trabucayre.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BZtBl1Hgmz9sRK for ; Mon, 24 Aug 2020 23:24:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B669F85DEC; Mon, 24 Aug 2020 13:24:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u8zVmB7ITu7t; Mon, 24 Aug 2020 13:24:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8EB6885A78; Mon, 24 Aug 2020 13:24:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 627061BF291 for ; Mon, 24 Aug 2020 13:24:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5F19820005 for ; Mon, 24 Aug 2020 13:24:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yFW2ia1unzoZ for ; Mon, 24 Aug 2020 13:24:25 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by silver.osuosl.org (Postfix) with ESMTPS id 706AE1FD21 for ; Mon, 24 Aug 2020 13:24:25 +0000 (UTC) Received: from x230.trabucayre.com (unknown [IPv6:2a01:e34:efc8:1080:3e97:eff:fe89:644f]) by smtp2-g21.free.fr (Postfix) with ESMTP id 8BB18200385; Mon, 24 Aug 2020 15:24:20 +0200 (CEST) From: Gwenhael Goavec-Merou To: buildroot@buildroot.org Date: Mon, 24 Aug 2020 15:22:15 +0200 Message-Id: <20200824132215.25517-1-gwenj@trabucayre.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/armadillo: allows to select between clapack, lapack or openblas X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Gwenhael Goavec-Merou Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Gwenhael Goavec-Merou armadillo can use clapack, lapack or openblas as BLAS and LAPACK provider. This patch - adds hidden variable to check dependencies/requirement for each of them - a choice to select wich implementation to use, by default use on clapack when it's possible, else lapack, otherwhise openblas Signed-off-by: Gwenhael Goavec-Merou --- Changes v1 -> v2: - add openblas as blas provider --- package/armadillo/Config.in | 50 ++++++++++++++++++++++++++++++++-- package/armadillo/armadillo.mk | 11 +++++++- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/package/armadillo/Config.in b/package/armadillo/Config.in index b2b61a3233..0a65f5b966 100644 --- a/package/armadillo/Config.in +++ b/package/armadillo/Config.in @@ -1,3 +1,12 @@ +config BR2_PACKAGE_ARMADILLO_CLAPACK_SUPPORTS + bool + default y if (!BR2_m68k_cf && (!BR2_powerpc || BR2_TOOLCHAIN_USES_GLIBC)) + +config BR2_PACKAGE_ARMADILLO_LAPACK_SUPPORTS + bool + default y if BR2_TOOLCHAIN_HAS_FORTRAN && \ + BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS + comment "armadillo needs a toolchain w/ C++" depends on !BR2_INSTALL_LIBSTDCPP depends on !BR2_powerpc @@ -10,11 +19,46 @@ comment "armadillo needs a glibc toolchain w/ C++" config BR2_PACKAGE_ARMADILLO bool "armadillo" depends on BR2_INSTALL_LIBSTDCPP - depends on !BR2_powerpc || BR2_TOOLCHAIN_USES_GLIBC # clapack - depends on !BR2_m68k_cf # clapack - select BR2_PACKAGE_CLAPACK + depends on BR2_PACKAGE_ARMADILLO_CLAPACK_SUPPORTS || \ + BR2_PACKAGE_ARMADILLO_LAPACK_SUPPORTS || \ + BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS help Armadillo: An Open Source C++ Linear Algebra Library for Fast Prototyping and Computationally Intensive Experiments. http://arma.sourceforge.net/ + +if BR2_PACKAGE_ARMADILLO + +choice + prompt "blas library" + default BR2_PACKAGE_ARMADILLO_CLAPACK if \ + BR2_PACKAGE_ARMADILLO_CLAPACK_SUPPORTS + default BR2_PACKAGE_ARMADILLO_LAPACK if \ + BR2_PACKAGE_ARMADILLO_LAPACK_SUPPORTS && \ + !BR2_PACKAGE_ARMADILLO_CLAPACK_SUPPORTS + default BR2_PACKAGE_ARMADILLO_OPENBLAS if \ + !BR2_PACKAGE_ARMADILLO_LAPACK_SUPPORTS && \ + !BR2_PACKAGE_ARMADILLO_CLAPACK_SUPPORTS && \ + BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS + help + Selects blas library to use + +config BR2_PACKAGE_ARMADILLO_CLAPACK + bool "clapack" + depends on BR2_PACKAGE_ARMADILLO_CLAPACK_SUPPORTS + select BR2_PACKAGE_CLAPACK + +config BR2_PACKAGE_ARMADILLO_LAPACK + bool "lapack" + depends on BR2_PACKAGE_ARMADILLO_LAPACK_SUPPORTS + select BR2_PACKAGE_LAPACK + +config BR2_PACKAGE_ARMADILLO_OPENBLAS + bool "openblas" + depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS + select BR2_PACKAGE_OPENBLAS + +endchoice + +endif diff --git a/package/armadillo/armadillo.mk b/package/armadillo/armadillo.mk index 624b842ef6..1cc3d0c968 100644 --- a/package/armadillo/armadillo.mk +++ b/package/armadillo/armadillo.mk @@ -7,11 +7,20 @@ ARMADILLO_VERSION = 9.900.2 ARMADILLO_SOURCE = armadillo-$(ARMADILLO_VERSION).tar.xz ARMADILLO_SITE = https://downloads.sourceforge.net/project/arma -ARMADILLO_DEPENDENCIES = clapack ARMADILLO_INSTALL_STAGING = YES ARMADILLO_LICENSE = Apache-2.0 ARMADILLO_LICENSE_FILES = LICENSE.txt +ifeq ($(BR2_PACKAGE_ARMADILLO_OPENBLAS),y) +ARMADILLO_DEPENDENCIES = openblas +else +ifeq ($(BR2_PACKAGE_ARMADILLO_CLAPACK), y) +ARMADILLO_DEPENDENCIES = clapack +else +ARMADILLO_DEPENDENCIES = lapack +endif +endif + ARMADILLO_CONF_OPTS = -DDETECT_HDF5=false $(eval $(cmake-package))