Skip to contentSkip to conversation

package/python-numpy: use lapack instead of clapack

PATCH Applied Arnout Vandecappelle (Essensium/Mind) 3 participants 11 messages Jul 25, 2021 – Aug 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/3 package/python-numpy: use lapack instead of clapack

The clapack package is deprecated and will be removed. Use lapack instead.

Cc Jagan Teki <[email protected]>
Cc Damien DUVAL <[email protected]>
Cc Alexandre PAYEN <[email protected]>
Cc Romain Naour <[email protected]>
Cc Gwenhael Goavec-Merou <[email protected]>
---
 package/python-numpy/python-numpy.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/python-numpy/python-numpy.mk +2 -2
index 8260de7e5d..72c6e0c981 100644
@@ -17,8 +17,8 @@ PYTHON_NUMPY_SETUP_TYPE = setuptools
 PYTHON_NUMPY_DEPENDENCIES = host-python-cython
 HOST_PYTHON_NUMPY_DEPENDENCIES = host-python-cython
 
-ifeq ($(BR2_PACKAGE_CLAPACK),y)
-PYTHON_NUMPY_DEPENDENCIES += clapack
+ifeq ($(BR2_PACKAGE_LAPACK),y)
+PYTHON_NUMPY_DEPENDENCIES += lapack
 else
 PYTHON_NUMPY_ENV += BLAS=None LAPACK=None
 endif
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#1 lore raw

PATCH v5 2/3 package/clapack: Remove

clapack has been unmaintained for a couple of years. It is semi-automatically generated from lapack sources using the f2c fortran-to-C converter, which itself is pretty much unmaintained.

Remove the package. Remove the dependency on !CLAPACK from lapack. Automatically select lapack from legacy if possible.

Cc Alexandre PAYEN <[email protected]>
Cc Benjamin Kamath <[email protected]>
Cc Thomas De Schampheleire <[email protected]>
Cc Romain Naour <[email protected]>
---
 Config.in.legacy                              |  9 +++
 DEVELOPERS                                    |  1 -
 package/Config.in                             |  1 -
 ...bf2c-to-be-built-as-a-static-library.patch | 32 --------
 ...est-build-sensitive-to-BUILD_TESTING.patch | 80 -------------------
 ...-to-run-arithchk-when-cross-compilin.patch | 70 ----------------
 ...add-library-and-header-install-rules.patch | 23 ------
 ...add-library-and-header-install-rules.patch | 24 ------
 package/clapack/0006-remove-uninit-f2c.patch  | 24 ------
 package/clapack/0007-off64-t.patch            | 16 ----
 package/clapack/Config.in                     | 33 --------
 package/clapack/clapack.hash                  |  5 --
 package/clapack/clapack.mk                    | 22 -----
 package/lapack/Config.in                      |  1 -
 14 files changed, 9 insertions(+), 332 deletions(-)
 delete mode 100644 package/clapack/0001-cmake-force-libf2c-to-be-built-as-a-static-library.patch
 delete mode 100644 package/clapack/0002-cmake-make-test-build-sensitive-to-BUILD_TESTING.patch
 delete mode 100644 package/clapack/0003-cmake-do-not-try-to-run-arithchk-when-cross-compilin.patch
 delete mode 100644 package/clapack/0004-cmake-blas-add-library-and-header-install-rules.patch
 delete mode 100644 package/clapack/0005-cmake-lapack-add-library-and-header-install-rules.patch
 delete mode 100644 package/clapack/0006-remove-uninit-f2c.patch
 delete mode 100644 package/clapack/0007-off64-t.patch
 delete mode 100644 package/clapack/Config.in
 delete mode 100644 package/clapack/clapack.hash
 delete mode 100644 package/clapack/clapack.mk
Config.in.legacy +9 -0
index aee7e425ef..fdb0369de2 100644
@@ -146,6 +146,15 @@ endif
 
 comment "Legacy options removed in 2021.08"
 
+config BR2_PACKAGE_CLAPACK
+	bool "cblas/clapack package removed"
+	select BR2_LEGACY
+	select BR2_PACKAGE_LAPACK if BR2_PACKAGE_LAPACK_ARCH_SUPPORTS && BR2_TOOLCHAIN_HAS_FORTRAN
+	help
+	  The clapack package was removed. LAPACK no longer generates a
+	  C version. Use lapack instead. This does require a Fortran
+	  compilerhowever.
+
 config BR2_PACKAGE_SPIDERMONKEY
 	bool "spidermonkey package removed"
 	select BR2_LEGACY
DEVELOPERS +0 -1
index 596670993a..119c9e0862 100644
@@ -2387,7 +2387,6 @@ F:	package/lrzip/
 N:	Samuel Martin <[email protected]>
 F:	package/armadillo/
 F:	package/canfestival/
-F:	package/clapack/
 F:	package/cwiid/
 F:	package/flite/
 F:	package/nginx/
package/Config.in +0 -1
index 12b1323fc2..f49c700f9c 100644
@@ -1880,7 +1880,6 @@ menu "Other"
 	source "package/cctz/Config.in"
 	source "package/cereal/Config.in"
 	source "package/clang/Config.in"
-	source "package/clapack/Config.in"
 	source "package/cmocka/Config.in"
 	source "package/cppcms/Config.in"
 	source "package/cracklib/Config.in"
package/clapack/0001-cmake-force-libf2c-to-be-built-as-a-static-library.patch deleted +0 -32
deleted file mode 100644
index 8fede9da91..0000000000
@@ -1,32 +0,0 @@
-From 4fe2f454e454d9e6b1e83b2ea67581990461ed36 Mon Sep 17 00:00:00 2001
-From: Samuel Martin <[email protected]>
-Date: Sat, 11 Jan 2014 22:05:25 +0100
-Subject: [PATCH 1/6] cmake: force libf2c to be built as a static library
-
-As stated in INSTALL/LAPACK_version.c, liblapack requires to be linked
-against the static library of libf2c.
-
-Signed-off-by: Samuel Martin <[email protected]>
----
- F2CLIBS/libf2c/CMakeLists.txt | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
-index 43d7b3f..f98d66a 100644
---- a/F2CLIBS/libf2c/CMakeLists.txt
-+++ b/F2CLIBS/libf2c/CMakeLists.txt
-@@ -58,5 +58,10 @@ if(WIN32)
- endif()
- include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
- include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
--add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
-+add_library(f2c STATIC ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
- set_property(TARGET f2c PROPERTY PREFIX lib)
-+# Set fPIC on the library when build shared libraries is enabled, because
-+# libf2c.a will most likely be included by some shared libraries in such cases.
-+if(UNIX AND BUILD_SHARED_LIBS)
-+  set_target_properties(f2c PROPERTIES COMPILE_FLAGS "-fPIC")
-+endif()
--- 
-1.8.5.3
-
package/clapack/0002-cmake-make-test-build-sensitive-to-BUILD_TESTING.patch deleted +0 -80

80 lines not on this page · raw message

package/clapack/0003-cmake-do-not-try-to-run-arithchk-when-cross-compilin.patch deleted +0 -70

70 lines not on this page · raw message

package/clapack/0004-cmake-blas-add-library-and-header-install-rules.patch deleted +0 -23
deleted file mode 100644
index e83b066dac..0000000000
@@ -1,23 +0,0 @@
-From 675111e8ffc179276a7e4950fe4a4eda4d38a703 Mon Sep 17 00:00:00 2001
-From: Samuel Martin <[email protected]>
-Date: Sat, 11 Jan 2014 21:48:32 +0100
-Subject: [PATCH 4/6] cmake: blas: add library and header install rules
-
-Signed-off-by: Samuel Martin <[email protected]>
----
- BLAS/SRC/CMakeLists.txt | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/BLAS/SRC/CMakeLists.txt b/BLAS/SRC/CMakeLists.txt
-index d1caff8..a5de5a1 100644
---- a/BLAS/SRC/CMakeLists.txt
-+++ b/BLAS/SRC/CMakeLists.txt
-@@ -141,3 +141,5 @@ if(UNIX)
-   target_link_libraries(blas m)
- endif()
- target_link_libraries(blas f2c)
-+install(TARGETS blas LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
-+install(FILES "${CLAPACK_SOURCE_DIR}/INCLUDE/blaswrap.h" DESTINATION include)
--- 
-1.8.5.3
-
package/clapack/0005-cmake-lapack-add-library-and-header-install-rules.patch deleted +0 -24
deleted file mode 100644
index abba460b6c..0000000000
@@ -1,24 +0,0 @@
-From 9dfac0d55a31be59a856bad9d3a5071d65176597 Mon Sep 17 00:00:00 2001
-From: Samuel Martin <[email protected]>
-Date: Sat, 11 Jan 2014 21:49:22 +0100
-Subject: [PATCH 5/6] cmake: lapack: add library and header install rules
-
-Signed-off-by: Samuel Martin <[email protected]>
----
- SRC/CMakeLists.txt | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt
-index ac4cce3..aa60555 100644
---- a/SRC/CMakeLists.txt
-+++ b/SRC/CMakeLists.txt
-@@ -377,4 +377,5 @@ if(BUILD_COMPLEX16)
- endif()
- add_library(lapack ${ALLOBJ} ${ALLXOBJ})
- target_link_libraries(lapack blas)
--
-+install(TARGETS lapack LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
-+install(FILES "${CLAPACK_SOURCE_DIR}/INCLUDE/clapack.h" DESTINATION include)
--- 
-1.8.5.3
-
package/clapack/0006-remove-uninit-f2c.patch deleted +0 -24
deleted file mode 100644
index 83c2c5c75f..0000000000
@@ -1,24 +0,0 @@
-uninit.c includes glibc-specific <fpu_control.h> not provided by musl.
-Somewhat portable replacement is <fenv.h>, which is available in musl
-but requires non-trivial changes to uninit.c.
-
-f2c uses _uninit_f2c() from uninit.c to implement its -trapuv option,
-pre-initializiing floating-point variables to NaN and asking FPU to send
-SIGFPE whenever NaN value is encountered.
-
-clapack source has already been run through f2c without -trapuv,
-so uninit.c code is not used anywhere and can be safely excluded.
-
-Signed-off-by: Alex Suykov <[email protected]>
-
---- a/F2CLIBS/libf2c/CMakeLists.txt
-+++ b/F2CLIBS/libf2c/CMakeLists.txt
-@@ -1,7 +1,7 @@
- set(MISC 
-   f77vers.c i77vers.c main.c s_rnge.c abort_.c exit_.c getarg_.c iargc_.c
-   getenv_.c signal_.c s_stop.c s_paus.c system_.c cabs.c ctype.c
--  derf_.c derfc_.c erf_.c erfc_.c sig_die.c uninit.c)
-+  derf_.c derfc_.c erf_.c erfc_.c sig_die.c)
- set(POW pow_ci.c pow_dd.c pow_di.c pow_hh.c pow_ii.c pow_ri.c pow_zi.c pow_zz.c)
- set(CX 	c_abs.c c_cos.c c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c)
- set(DCX	z_abs.c z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c)
package/clapack/0007-off64-t.patch deleted +0 -16
deleted file mode 100644
index bf66d3c95f..0000000000
@@ -1,16 +0,0 @@
-musl only provides off64_t, not __off64_t.
-glibc and uclibc have both defined.
-
-Signed-off-by: Alex Suykov <[email protected]>
-
---- a/F2CLIBS/libf2c/sysdep1.h
-+++ b/F2CLIBS/libf2c/sysdep1.h
-@@ -10,7 +10,7 @@
- 
- #ifdef __linux__
- #define USE_LARGEFILE
--#define OFF_T __off64_t
-+#define OFF_T off64_t
- #endif
- 
- #ifdef _AIX43
package/clapack/Config.in deleted +0 -33
deleted file mode 100644
index 98f94b0e60..0000000000
@@ -1,33 +0,0 @@
-config BR2_PACKAGE_CLAPACK_ARCH_SUPPORTS
-	bool
-	default y
-	# assembler: Error: value out of range
-	depends on !BR2_m68k_cf
-	# _fpu_control is used on PowerPC, but not available with
-	# uClibc or musl
-	depends on !BR2_powerpc || BR2_TOOLCHAIN_USES_GLIBC
-
-comment "clapack needs a glibc toolchain"
-	depends on BR2_powerpc
-	depends on !BR2_TOOLCHAIN_USES_GLIBC
-
-config BR2_PACKAGE_CLAPACK
-	bool "cblas/clapack"
-	depends on BR2_PACKAGE_CLAPACK_ARCH_SUPPORTS
-	help
-	  BLAS and LAPACK C implementation (f2c'ed version of).
-
-	  http://www.netlib.org/clapack/
-
-config BR2_PACKAGE_CLAPACK_ARITH_H
-	string "Custom BLAS arith.h"
-	depends on BR2_PACKAGE_CLAPACK
-	help
-	  To optimize BLAS library for the hardware, an 'arith.h' header
-	  should be provided.
-
-	  If empty, the library will not be optimized by the compiler.
-
-	  In any case an 'arithchk' program is built
-	  (but not installed), to be run on the target to generate this
-	  arith.h header.
package/clapack/clapack.hash deleted +0 -5
deleted file mode 100644
index ad586fac72..0000000000
@@ -1,5 +0,0 @@
-# Locally calculated
-sha256 0b3f782bc24845d85f36bafbff0f2f1384dc72df730fda4e7924ec1a70baca5a clapack-3.2.1-CMAKE.tgz
-# License files, locally calculated
-sha256 23014869214a231525b38c39fdb5f82364fa24154ac80fdcab2a79671460fd09 COPYING
-sha256 44561c447e91203ddc747beeca5cc2794d95ee982c17c578670e4f0408bc3904 F2CLIBS/libf2c/Notice
package/clapack/clapack.mk deleted +0 -22
deleted file mode 100644
index 9a083f3223..0000000000
@@ -1,22 +0,0 @@
-################################################################################
-#
-# clapack
-#
-################################################################################
-
-CLAPACK_VERSION = 3.2.1
-CLAPACK_SOURCE = clapack-$(CLAPACK_VERSION)-CMAKE.tgz
-# This package provides 3 libraries:
-# - libf2c.a (not installed)
-# - libblas (statically linked with libf2c.a)
-# - liblapack (statically linked with libf2c.a)
-CLAPACK_LICENSE = HPND (libf2c), BSD-3-Clause (libblas and liblapack)
-CLAPACK_LICENSE_FILES = F2CLIBS/libf2c/Notice COPYING
-CLAPACK_SITE = http://www.netlib.org/clapack
-CLAPACK_INSTALL_STAGING = YES
-
-ifneq ($(BR2_PACKAGE_CLAPACK_ARITH_H),)
-CLAPACK_CONF_OPTS += -DARITH_H=$(BR2_PACKAGE_CLAPACK_ARITH_H)
-endif
-
-$(eval $(cmake-package))
package/lapack/Config.in +0 -1
index e84a19bb45..4e92b49ab6 100644
@@ -17,7 +17,6 @@ config BR2_PACKAGE_LAPACK
 	bool "lapack/blas"
 	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_FORTRAN
-	depends on !BR2_PACKAGE_CLAPACK
 	help
 	  LAPACK and BLAS FORTRAN implementation. This package
 	  installs two libraries: libblas and liblapack.
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH v5 2/3] package/clapack: Remove

Quoted 30 lines · On Sun, 25 Jul 2021 13:12:30 +0200 "Arnout Vandecappelle (Essensium/Mind)"…

clapack has been unmaintained for a couple of years. It is semi-automatically generated from lapack sources using the f2c fortran-to-C converter, which itself is pretty much unmaintained.

Remove the package. Remove the dependency on !CLAPACK from lapack. Automatically select lapack from legacy if possible.

Cc Alexandre PAYEN <[email protected]>
Cc Benjamin Kamath <[email protected]>
Cc Thomas De Schampheleire <[email protected]>
Cc Romain Naour <[email protected]>
---
 Config.in.legacy                              |  9 +++
 DEVELOPERS                                    |  1 -
 package/Config.in                             |  1 -
 ...bf2c-to-be-built-as-a-static-library.patch | 32 --------
 ...est-build-sensitive-to-BUILD_TESTING.patch | 80 -------------------
 ...-to-run-arithchk-when-cross-compilin.patch | 70 ----------------
 ...add-library-and-header-install-rules.patch | 23 ------
 ...add-library-and-header-install-rules.patch | 24 ------
 package/clapack/0006-remove-uninit-f2c.patch  | 24 ------
 package/clapack/0007-off64-t.patch            | 16 ----
 package/clapack/Config.in                     | 33 --------
 package/clapack/clapack.hash                  |  5 --
 package/clapack/clapack.mk                    | 22 -----
 package/lapack/Config.in                      |  1 -
 14 files changed, 9 insertions(+), 332 deletions(-)
 delete mode 100644 package/clapack/0001-cmake-force-libf2c-to-be-built-as-a-static-library.patch
 delete mode 100644 package/clapack/0002-cmake-make-test-build-sensitive-to-BUILD_TESTING.patch
Quoted 8 lines
 delete mode 100644 package/clapack/0003-cmake-do-not-try-to-run-arithchk-when-cross-compilin.patch
 delete mode 100644 package/clapack/0004-cmake-blas-add-library-and-header-install-rules.patch
 delete mode 100644 package/clapack/0005-cmake-lapack-add-library-and-header-install-rules.patch
 delete mode 100644 package/clapack/0006-remove-uninit-f2c.patch
 delete mode 100644 package/clapack/0007-off64-t.patch
 delete mode 100644 package/clapack/Config.in
 delete mode 100644 package/clapack/clapack.hash
 delete mode 100644 package/clapack/clapack.mk

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#3 lore raw

PATCH v5 3/3 package/armadillo: allow to select between lapack or openblas

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Gwenhael Goavec-Merou <[email protected]>

armadillo can use lapack or openblas as BLAS provider. LAPACK support is optional.

This patch
- adds an _ARCH_SUPPORTS variable to check if one is available
- adds an option to choose lapack or openblas as BLAS provider

The choice is required since applications may potentially need lapack.

---
Changes v4 -> v5: [Done by Arnout]
- Consistent naming of BR2_PACKAGE_ARMADILLO_OPENBLAS (Yann E. Morin)
- Remove double dependency on lapack/clapack (Yann E. Morin)
- Remove stray 'endchoice'
- "Solve" circular dependency by removing clapack
Changes v3 -> v4: [Done by Arnout]
- Split off lapack/clapack arch depends in separate patches
- Simplify the comments (no need for the powerpc complexity)
- Remove the choices because clapack/lapack choice doesn't work. Keep a single config for openblas.
Changes v2 -> v3:
- drop all default statements for choice (Thomas)
- add explicit -l since blas libary is called liblas for (c)lapack and libopenblas for openblas (Thomas)
- add a choice for lapack selection between lapack, clapack or none Changes v1 -> v2:
- add openblas as blas provider

---
 package/armadillo/Config.in    | 34 ++++++++++++++++++++++++++--------
 package/armadillo/armadillo.mk | 18 +++++++++++++++++-
 2 files changed, 43 insertions(+), 9 deletions(-)
package/armadillo/Config.in +26 -8
index b2b61a3233..7aed4fd02f 100644
@@ -1,20 +1,38 @@
 comment "armadillo needs a toolchain w/ C++"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS
 	depends on !BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_powerpc
-	depends on !BR2_m68k_cf
 
-comment "armadillo needs a glibc toolchain w/ C++"
-	depends on BR2_powerpc
-	depends on !BR2_INSTALL_LIBSTDCPP || BR2_TOOLCHAIN_USES_UCLIBC
+comment "armadillo needs a toolchain w/ fortran, C++"
+	depends on !BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS # otherwise, see comment above
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_FORTRAN || !BR2_INSTALL_LIBSTDCPP
 
 config BR2_PACKAGE_ARMADILLO
 	bool "armadillo"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS || \
+		(BR2_PACKAGE_LAPACK_ARCH_SUPPORTS && BR2_TOOLCHAIN_HAS_FORTRAN)
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_powerpc || BR2_TOOLCHAIN_USES_GLIBC # clapack
-	depends on !BR2_m68k_cf # clapack
-	select BR2_PACKAGE_CLAPACK
 	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 implementation"
+
+config BR2_PACKAGE_ARMADILLO_OPENBLAS
+	bool "openblas"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS
+	select BR2_PACKAGE_OPENBLAS
+
+config BR2_PACKAGE_ARMADILLO_LAPACK
+	bool "lapack"
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS && BR2_TOOLCHAIN_HAS_FORTRAN
+	select BR2_PACKAGE_LAPACK
+
+endchoice
+
+endif
package/armadillo/armadillo.mk +17 -1
index 624b842ef6..dcac2bf8cd 100644
@@ -7,11 +7,27 @@
 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
 
 ARMADILLO_CONF_OPTS = -DDETECT_HDF5=false
 
+# blas support may be provided by lapack (libblas.a) or openblas (libopenblas.a)
+ARMADILLO_CONF_OPTS += -DBLAS_FOUND=ON
+ifeq ($(BR2_PACKAGE_ARMADILLO_OPENBLAS),y)
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lopenblas
+ARMADILLO_DEPENDENCIES = openblas
+else
+# Since BR2_PACKAGE_LAPACK is selected in this case, the dependency on it is
+# added below.
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lblas
+endif
+
+# lapack support is optional and can only be provided by lapack, not openblas
+ifeq ($(BR2_PACKAGE_LAPACK),y)
+ARMADILLO_CONF_OPTS += -DLAPACK_FOUND=ON
+ARMADILLO_DEPENDENCIES += lapack
+endif
+
 $(eval $(cmake-package))
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH v5 3/3] package/armadillo: allow to select between lapack or openblas

Arnout, all,

Quoted 41 lines · On Sun, 25 Jul 2021 13:12:31 +0200 "Arnout Vandecappelle (Essensium/Mind)"…

From: Gwenhael Goavec-Merou <[email protected]>

armadillo can use lapack or openblas as BLAS provider. LAPACK support is optional.

This patch
- adds an _ARCH_SUPPORTS variable to check if one is available
- adds an option to choose lapack or openblas as BLAS provider

The choice is required since applications may potentially need lapack.

---
Changes v4 -> v5: [Done by Arnout]
- Consistent naming of BR2_PACKAGE_ARMADILLO_OPENBLAS (Yann E. Morin)
- Remove double dependency on lapack/clapack (Yann E. Morin)
- Remove stray 'endchoice'
- "Solve" circular dependency by removing clapack
Changes v3 -> v4: [Done by Arnout]
- Split off lapack/clapack arch depends in separate patches
- Simplify the comments (no need for the powerpc complexity)
- Remove the choices because clapack/lapack choice doesn't work. Keep a single config for openblas.
Changes v2 -> v3:
- drop all default statements for choice (Thomas)
- add explicit -l since blas libary is called liblas for (c)lapack and libopenblas for openblas (Thomas)
- add a choice for lapack selection between lapack, clapack or none Changes v1 -> v2:
- add openblas as blas provider

---
 package/armadillo/Config.in    | 34 ++++++++++++++++++++++++++--------
 package/armadillo/armadillo.mk | 18 +++++++++++++++++-
 2 files changed, 43 insertions(+), 9 deletions(-)
package/armadillo/Config.in +0 -0
index b2b61a3233..7aed4fd02f 100644

package/armadillo/Config.in line 2

Quoted 2 lines
package/armadillo/Config.in +1 -0
@@ -1,20 +1,38 @@
 comment "armadillo needs a toolchain w/ C++"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS

blas may be provided by lapack too: maybe it's required to add the same condition as armadillo itself ?

package/armadillo/Config.in line 5

Quoted 8 lines
package/armadillo/Config.in +1 -5
 	depends on !BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_powerpc
-	depends on !BR2_m68k_cf
 
-comment "armadillo needs a glibc toolchain w/ C++"
-	depends on BR2_powerpc
-	depends on !BR2_INSTALL_LIBSTDCPP || BR2_TOOLCHAIN_USES_UCLIBC
+comment "armadillo needs a toolchain w/ fortran, C++"

fortran is only required if lapack has to be used: if lapack is said as optional this is maybe not required ?

Quoted 72 lines
package/armadillo/Config.in +24 -3
+	depends on !BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS # otherwise, see comment above
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_FORTRAN || !BR2_INSTALL_LIBSTDCPP
 
 config BR2_PACKAGE_ARMADILLO
 	bool "armadillo"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS || \
+		(BR2_PACKAGE_LAPACK_ARCH_SUPPORTS && BR2_TOOLCHAIN_HAS_FORTRAN)
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_powerpc || BR2_TOOLCHAIN_USES_GLIBC # clapack
-	depends on !BR2_m68k_cf # clapack
-	select BR2_PACKAGE_CLAPACK
 	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 implementation"
+
+config BR2_PACKAGE_ARMADILLO_OPENBLAS
+	bool "openblas"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS
+	select BR2_PACKAGE_OPENBLAS
+
+config BR2_PACKAGE_ARMADILLO_LAPACK
+	bool "lapack"
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS && BR2_TOOLCHAIN_HAS_FORTRAN
+	select BR2_PACKAGE_LAPACK
+
+endchoice
+
+endif
package/armadillo/armadillo.mk +17 -1
index 624b842ef6..dcac2bf8cd 100644
@@ -7,11 +7,27 @@
 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
 
 ARMADILLO_CONF_OPTS = -DDETECT_HDF5=false
 
+# blas support may be provided by lapack (libblas.a) or openblas (libopenblas.a)
+ARMADILLO_CONF_OPTS += -DBLAS_FOUND=ON
+ifeq ($(BR2_PACKAGE_ARMADILLO_OPENBLAS),y)
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lopenblas
+ARMADILLO_DEPENDENCIES = openblas
+else
+# Since BR2_PACKAGE_LAPACK is selected in this case, the dependency on it is
+# added below.
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lblas
+endif
+
+# lapack support is optional and can only be provided by lapack, not openblas
+ifeq ($(BR2_PACKAGE_LAPACK),y)
+ARMADILLO_CONF_OPTS += -DLAPACK_FOUND=ON
+ARMADILLO_DEPENDENCIES += lapack
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.31.1

It's an open question:
until now armadillo was always built with blas and lapack support provided by clapack. To avoid breaking current behaviour (lapack support) why not considering selecting lapack package unconditionaly and let user choise for blas support? I know the main issue is the dependency to fortran...

Thanks
Gwen
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw

Re: [Buildroot] [PATCH v5 3/3] package/armadillo: allow to select between lapack or openblas

Quoted 54 lines · Gwenhael Goavec-Merou

Arnout, all,

Quoted 41 lines · On Sun, 25 Jul 2021 13:12:31 +0200 "Arnout Vandecappelle (Essensium/Mind)"…

From: Gwenhael Goavec-Merou <[email protected]>

armadillo can use lapack or openblas as BLAS provider. LAPACK support is optional.

This patch
- adds an _ARCH_SUPPORTS variable to check if one is available
- adds an option to choose lapack or openblas as BLAS provider

The choice is required since applications may potentially need lapack.

---
Changes v4 -> v5: [Done by Arnout]
- Consistent naming of BR2_PACKAGE_ARMADILLO_OPENBLAS (Yann E. Morin)
- Remove double dependency on lapack/clapack (Yann E. Morin)
- Remove stray 'endchoice'
- "Solve" circular dependency by removing clapack
Changes v3 -> v4: [Done by Arnout]
- Split off lapack/clapack arch depends in separate patches
- Simplify the comments (no need for the powerpc complexity)
- Remove the choices because clapack/lapack choice doesn't work. Keep a single config for openblas.
Changes v2 -> v3:
- drop all default statements for choice (Thomas)
- add explicit -l since blas libary is called liblas for (c)lapack and libopenblas for openblas (Thomas)
- add a choice for lapack selection between lapack, clapack or none Changes v1 -> v2:
- add openblas as blas provider

---
 package/armadillo/Config.in    | 34 ++++++++++++++++++++++++++--------
 package/armadillo/armadillo.mk | 18 +++++++++++++++++-
 2 files changed, 43 insertions(+), 9 deletions(-)
package/armadillo/Config.in +0 -0
index b2b61a3233..7aed4fd02f 100644

package/armadillo/Config.in line 2

Quoted 2 lines
package/armadillo/Config.in +1 -0
@@ -1,20 +1,38 @@
 comment "armadillo needs a toolchain w/ C++"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS

blas may be provided by lapack too: maybe it's required to add the same condition as armadillo itself ?

Quoted 4 lines
package/armadillo/Config.in +0 -2
 	depends on !BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_powerpc
-	depends on !BR2_m68k_cf
 
Quoted 6 lines

package/armadillo/Config.in line 5

Quoted 4 lines
package/armadillo/Config.in +1 -3
-comment "armadillo needs a glibc toolchain w/ C++"
-	depends on BR2_powerpc
-	depends on !BR2_INSTALL_LIBSTDCPP || BR2_TOOLCHAIN_USES_UCLIBC
+comment "armadillo needs a toolchain w/ fortran, C++"

fortran is only required if lapack has to be used: if lapack is said as optional this is maybe not required ?

Oh, I intended to insert a comment there but apparently forgot: We need either
openblas (which doesn't require fortran) or lapack (which does require fortran). Therefore, on architectures which do support openblas, we should have a comment that just says "C++", while on architectures that don't support openblas (but do support lapack) we should have a comment that says "C++ and Fortran".

Quoted 69 lines
Quoted 69 lines
package/armadillo/Config.in +24 -3
+	depends on !BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS # otherwise, see comment above
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_FORTRAN || !BR2_INSTALL_LIBSTDCPP
 
 config BR2_PACKAGE_ARMADILLO
 	bool "armadillo"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS || \
+		(BR2_PACKAGE_LAPACK_ARCH_SUPPORTS && BR2_TOOLCHAIN_HAS_FORTRAN)
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_powerpc || BR2_TOOLCHAIN_USES_GLIBC # clapack
-	depends on !BR2_m68k_cf # clapack
-	select BR2_PACKAGE_CLAPACK
 	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 implementation"
+
+config BR2_PACKAGE_ARMADILLO_OPENBLAS
+	bool "openblas"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS
+	select BR2_PACKAGE_OPENBLAS
+
+config BR2_PACKAGE_ARMADILLO_LAPACK
+	bool "lapack"
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS && BR2_TOOLCHAIN_HAS_FORTRAN
+	select BR2_PACKAGE_LAPACK
+
+endchoice
+
+endif
package/armadillo/armadillo.mk +17 -1
index 624b842ef6..dcac2bf8cd 100644
@@ -7,11 +7,27 @@
 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
 
 ARMADILLO_CONF_OPTS = -DDETECT_HDF5=false
 
+# blas support may be provided by lapack (libblas.a) or openblas (libopenblas.a)
+ARMADILLO_CONF_OPTS += -DBLAS_FOUND=ON
+ifeq ($(BR2_PACKAGE_ARMADILLO_OPENBLAS),y)
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lopenblas
+ARMADILLO_DEPENDENCIES = openblas
+else
+# Since BR2_PACKAGE_LAPACK is selected in this case, the dependency on it is
+# added below.
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lblas
+endif
+
+# lapack support is optional and can only be provided by lapack, not openblas
+ifeq ($(BR2_PACKAGE_LAPACK),y)
+ARMADILLO_CONF_OPTS += -DLAPACK_FOUND=ON
+ARMADILLO_DEPENDENCIES += lapack
+endif
+
 $(eval $(cmake-package))
Quoted 8 lines
Quoted 3 lines
Signature · 1 line
2.31.1

It's an open question:
until now armadillo was always built with blas and lapack support provided by clapack. To avoid breaking current behaviour (lapack support) why not considering selecting lapack package unconditionaly and let user choise for blas support? I know the main issue is the dependency to fortran...

What you're basically saying is that in the choice between lapack and openblas,
lapack should be the default, right?

Can you maybe explain a bit what your original reason for this patch was?
Armadillo basically hides the BLAS implementation, so unless it's buggy, you shouldn't even notice which implementation is behind. Also, the lapack package itself says that you should not use its BLAS implementation but you should use a better one instead.

Regards,
Arnout
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

#6 lore raw

Re: [Buildroot] [PATCH v5 3/3] package/armadillo: allow to select between lapack or openblas

Quoted 62 lines · On Mon, 26 Jul 2021 08:24:37 +0200 Arnout Vandecappelle <[email protected]> wrote:
Quoted 54 lines · Gwenhael Goavec-Merou

Arnout, all,

Quoted 41 lines · On Sun, 25 Jul 2021 13:12:31 +0200 "Arnout Vandecappelle (Essensium/Mind)"…

From: Gwenhael Goavec-Merou <[email protected]>

armadillo can use lapack or openblas as BLAS provider. LAPACK support is optional.

This patch
- adds an _ARCH_SUPPORTS variable to check if one is available
- adds an option to choose lapack or openblas as BLAS provider

The choice is required since applications may potentially need lapack.

---
Changes v4 -> v5: [Done by Arnout]
- Consistent naming of BR2_PACKAGE_ARMADILLO_OPENBLAS (Yann E. Morin)
- Remove double dependency on lapack/clapack (Yann E. Morin)
- Remove stray 'endchoice'
- "Solve" circular dependency by removing clapack
Changes v3 -> v4: [Done by Arnout]
- Split off lapack/clapack arch depends in separate patches
- Simplify the comments (no need for the powerpc complexity)
- Remove the choices because clapack/lapack choice doesn't work. Keep a single config for openblas.
Changes v2 -> v3:
- drop all default statements for choice (Thomas)
- add explicit -l since blas libary is called liblas for (c)lapack and libopenblas for openblas (Thomas)
- add a choice for lapack selection between lapack, clapack or none Changes v1 -> v2:
- add openblas as blas provider

---
 package/armadillo/Config.in    | 34 ++++++++++++++++++++++++++--------
 package/armadillo/armadillo.mk | 18 +++++++++++++++++-
 2 files changed, 43 insertions(+), 9 deletions(-)
package/armadillo/Config.in +0 -0
index b2b61a3233..7aed4fd02f 100644

package/armadillo/Config.in line 2

Quoted 2 lines
package/armadillo/Config.in +1 -0
@@ -1,20 +1,38 @@
 comment "armadillo needs a toolchain w/ C++"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS  

blas may be provided by lapack too: maybe it's required to add the same condition as armadillo itself ?

Quoted 4 lines
package/armadillo/Config.in +0 -2
 	depends on !BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_powerpc
-	depends on !BR2_m68k_cf
 
Quoted 6 lines

package/armadillo/Config.in line 5

Quoted 4 lines
package/armadillo/Config.in +1 -3
-comment "armadillo needs a glibc toolchain w/ C++"
-	depends on BR2_powerpc
-	depends on !BR2_INSTALL_LIBSTDCPP || BR2_TOOLCHAIN_USES_UCLIBC
+comment "armadillo needs a toolchain w/ fortran, C++"  

fortran is only required if lapack has to be used: if lapack is said as optional this is maybe not required ?

Quoted 7 lines

Oh, I intended to insert a comment there but apparently forgot: We need
either openblas (which doesn't require fortran) or lapack (which does require fortran). Therefore, on architectures which do support openblas, we should have a comment that just says "C++", while on architectures that don't support openblas (but do support lapack) we should have a comment that says "C++ and Fortran".

Ok.

Quoted 81 lines
Quoted 72 lines
Quoted 72 lines
package/armadillo/Config.in +1 -0
+	depends on !BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS # otherwise, see

comment above

package/armadillo/Config.in +4 -0
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_FORTRAN || !BR2_INSTALL_LIBSTDCPP
 
 config BR2_PACKAGE_ARMADILLO
 	bool "armadillo"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS || \
+		(BR2_PACKAGE_LAPACK_ARCH_SUPPORTS &&

BR2_TOOLCHAIN_HAS_FORTRAN) depends on BR2_INSTALL_LIBSTDCPP

package/armadillo/Config.in +14 -3
-	depends on !BR2_powerpc || BR2_TOOLCHAIN_USES_GLIBC # clapack
-	depends on !BR2_m68k_cf # clapack
-	select BR2_PACKAGE_CLAPACK
 	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 implementation"
+
+config BR2_PACKAGE_ARMADILLO_OPENBLAS
+	bool "openblas"
+	depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS
+	select BR2_PACKAGE_OPENBLAS
+
+config BR2_PACKAGE_ARMADILLO_LAPACK
+	bool "lapack"
+	depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS &&

BR2_TOOLCHAIN_HAS_FORTRAN

package/armadillo/Config.in +5 -0
+	select BR2_PACKAGE_LAPACK
+
+endchoice
+
+endif
(quoted diff) +0 -0

b/package/armadillo/armadillo.mk index 624b842ef6..dcac2bf8cd 100644

package/armadillo/armadillo.mk +1 -1
@@ -7,11 +7,27 @@
 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
 
 ARMADILLO_CONF_OPTS = -DDETECT_HDF5=false
 
+# blas support may be provided by lapack (libblas.a) or openblas

(libopenblas.a) +ARMADILLO_CONF_OPTS += -DBLAS_FOUND=ON

package/armadillo/armadillo.mk +5 -0
+ifeq ($(BR2_PACKAGE_ARMADILLO_OPENBLAS),y)
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lopenblas
+ARMADILLO_DEPENDENCIES = openblas
+else
+# Since BR2_PACKAGE_LAPACK is selected in this case, the dependency on it

is +# added below.

package/armadillo/armadillo.mk +4 -0
+ARMADILLO_CONF_OPTS += -DBLAS_LIBRARIES=-lblas
+endif
+
+# lapack support is optional and can only be provided by lapack, not

openblas +ifeq ($(BR2_PACKAGE_LAPACK),y)

package/armadillo/armadillo.mk +4 -0
+ARMADILLO_CONF_OPTS += -DLAPACK_FOUND=ON
+ARMADILLO_DEPENDENCIES += lapack
+endif
+
 $(eval $(cmake-package))
Quoted 8 lines
Quoted 3 lines
Signature · 1 line
2.31.1

It's an open question:
until now armadillo was always built with blas and lapack support provided by clapack. To avoid breaking current behaviour (lapack support) why not considering selecting lapack package unconditionaly and let user choise for blas support? I know the main issue is the dependency to fortran...

Quoted 9 lines

What you're basically saying is that in the choice between lapack and
openblas, lapack should be the default, right?

Can you maybe explain a bit what your original reason for this patch was?
Armadillo basically hides the BLAS implementation, so unless it's buggy, you shouldn't even notice which implementation is behind. Also, the lapack package itself says that you should not use its BLAS implementation but you should use a better one instead.

At the beginning the first version was to allows users to select between clapack and lapack (This is because one application I use need armadillo but crash if this library is build using clapack) for armadillo's lapack functions. After that, Romain has asked to extends this patch to have choice, for blas functions between all providers.

For armadillo's blas part if lapack said to prefer openblas it's seems logical to add the priority to this library. But for armadillo's lapack part, when lapack is not available, everything about lapack in armadillo will be disabled. Current behaviour is to select CLAPACK, and with this patch default behaviour is to enable lapack functions only when lapack is selected.

Quoted 2 lines

Regards,
Arnout

Regards,
Gwenhael
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

#7 lore raw

Re: [Buildroot] [PATCH v5 3/3] package/armadillo: allow to select between lapack or openblas

In reply to Arnout Vandecappelle

Hello,

Quoted 8 lines · On Mon, 26 Jul 2021 08:24:37 +0200 Arnout Vandecappelle <[email protected]> wrote:
Quoted 2 lines

fortran is only required if lapack has to be used: if lapack is said as optional this is maybe not required ?

Oh, I intended to insert a comment there but apparently forgot: We need either
openblas (which doesn't require fortran) or lapack (which does require fortran). Therefore, on architectures which do support openblas, we should have a comment that just says "C++", while on architectures that don't support openblas (but do support lapack) we should have a comment that says "C++ and Fortran".

... but this is exactly what your patch does:

comment "armadillo needs a toolchain w/ C++"
depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS depends on !BR2_INSTALL_LIBSTDCPP

comment "armadillo needs a toolchain w/ fortran, C++"
depends on !BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS # otherwise, see comment above depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_FORTRAN || !BR2_INSTALL_LIBSTDCPP

If we're on an arch supported by openblas, "needs a toolchain w/ C++" is displayed.

If we're on an arch not supported by openblas, but supported by lapack, "needs a toolchain w/ fortran, C++" is displayed.

So it all looks good to me.

Quoted 6 lines
Quoted 5 lines

It's an open question:
until now armadillo was always built with blas and lapack support provided by clapack. To avoid breaking current behaviour (lapack support) why not considering selecting lapack package unconditionaly and let user choise for blas support? I know the main issue is the dependency to fortran...

Quoted 8 lines

What you're basically saying is that in the choice between lapack and openblas,
lapack should be the default, right?

Can you maybe explain a bit what your original reason for this patch was?
Armadillo basically hides the BLAS implementation, so unless it's buggy, you shouldn't even notice which implementation is behind. Also, the lapack package itself says that you should not use its BLAS implementation but you should use a better one instead.

I was also confused by Gwenhael's comment, including with his reply to your question. So at this point, I've applied your patch as-is, we can always improve/fix later on if needed.

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#8 lore raw

Re: [Buildroot] [PATCH v5 3/3] package/armadillo: allow to select between lapack or openblas

Quoted 8 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · On Mon, 26 Jul 2021 08:24:37 +0200 Arnout Vandecappelle <[email protected]> wrote:
Quoted 2 lines

fortran is only required if lapack has to be used: if lapack is said as optional this is maybe not required ?

Quoted 7 lines
Quoted 5 lines

Oh, I intended to insert a comment there but apparently forgot: We need either
openblas (which doesn't require fortran) or lapack (which does require fortran). Therefore, on architectures which do support openblas, we should have a comment that just says "C++", while on architectures that don't support openblas (but do support lapack) we should have a comment that says "C++ and Fortran".

... but this is exactly what your patch does:

I meant a "#" comment, not a "comment" comment :-)

Regards,
Arnout

Quoted 34 lines

comment "armadillo needs a toolchain w/ C++"
depends on BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS depends on !BR2_INSTALL_LIBSTDCPP

comment "armadillo needs a toolchain w/ fortran, C++"
depends on !BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS # otherwise, see comment above depends on BR2_PACKAGE_LAPACK_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_FORTRAN || !BR2_INSTALL_LIBSTDCPP

If we're on an arch supported by openblas, "needs a toolchain w/ C++" is displayed.

If we're on an arch not supported by openblas, but supported by lapack, "needs a toolchain w/ fortran, C++" is displayed.

So it all looks good to me.

Quoted 6 lines
Quoted 5 lines

It's an open question:
until now armadillo was always built with blas and lapack support provided by clapack. To avoid breaking current behaviour (lapack support) why not considering selecting lapack package unconditionaly and let user choise for blas support? I know the main issue is the dependency to fortran...

Quoted 8 lines

What you're basically saying is that in the choice between lapack and openblas,
lapack should be the default, right?

Can you maybe explain a bit what your original reason for this patch was?
Armadillo basically hides the BLAS implementation, so unless it's buggy, you shouldn't even notice which implementation is behind. Also, the lapack package itself says that you should not use its BLAS implementation but you should use a better one instead.

Quoted 8 lines

I was also confused by Gwenhael's comment, including with his reply to your question. So at this point, I've applied your patch as-is, we can always improve/fix later on if needed.

Best regards,

Thomas

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

#9 lore raw

Re: [Buildroot] [PATCH v5 3/3] package/armadillo: allow to select between lapack or openblas

In reply to Arnout Vandecappelle (Essensium/Mind)
Quoted 31 lines · On Sun, 25 Jul 2021 13:12:31 +0200 "Arnout Vandecappelle (Essensium/Mind)"…

From: Gwenhael Goavec-Merou <[email protected]>

armadillo can use lapack or openblas as BLAS provider. LAPACK support is optional.

This patch
- adds an _ARCH_SUPPORTS variable to check if one is available
- adds an option to choose lapack or openblas as BLAS provider

The choice is required since applications may potentially need lapack.

---
Changes v4 -> v5: [Done by Arnout]
- Consistent naming of BR2_PACKAGE_ARMADILLO_OPENBLAS (Yann E. Morin)
- Remove double dependency on lapack/clapack (Yann E. Morin)
- Remove stray 'endchoice'
- "Solve" circular dependency by removing clapack
Changes v3 -> v4: [Done by Arnout]
- Split off lapack/clapack arch depends in separate patches
- Simplify the comments (no need for the powerpc complexity)
- Remove the choices because clapack/lapack choice doesn't work. Keep a single config for openblas.
Changes v2 -> v3:
- drop all default statements for choice (Thomas)
- add explicit -l since blas libary is called liblas for (c)lapack and libopenblas for openblas (Thomas)
- add a choice for lapack selection between lapack, clapack or none Changes v1 -> v2:
- add openblas as blas provider

Quoted 4 lines
---
 package/armadillo/Config.in    | 34 ++++++++++++++++++++++++++--------
 package/armadillo/armadillo.mk | 18 +++++++++++++++++-
 2 files changed, 43 insertions(+), 9 deletions(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#10 lore raw
In reply to Arnout Vandecappelle (Essensium/Mind)
Quoted 9 lines · On Sun, 25 Jul 2021 13:12:29 +0200 "Arnout Vandecappelle (Essensium/Mind)"…

The clapack package is deprecated and will be removed. Use lapack instead.

Cc Jagan Teki <[email protected]>
Cc Damien DUVAL <[email protected]>
Cc Alexandre PAYEN <[email protected]>
Cc Romain Naour <[email protected]>
Cc Gwenhael Goavec-Merou <[email protected]>
Quoted 3 lines
---
 package/python-numpy/python-numpy.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot