Skip to contentSkip to conversation

package/sleef: add new package

PATCH In review Kirill Kranke 2 participants 2 messages Sep 27, 2022 – Oct 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/sleef: add new package

SLEEF is a library that implements vectorized versions of C standard math functions. This library also includes DFT subroutines.

https://sleef.org/

---
 package/Config.in        |  1 +
 package/sleef/Config.in  | 50 ++++++++++++++++++++++++++++++++++++++++
 package/sleef/sleef.hash |  3 +++
 package/sleef/sleef.mk   | 49 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 103 insertions(+)
 create mode 100644 package/sleef/Config.in
 create mode 100644 package/sleef/sleef.hash
 create mode 100644 package/sleef/sleef.mk
package/Config.in +1 -0
index b911c59a92..af9b0b7398 100644
@@ -2041,6 +2041,7 @@ endif
 	source "package/riemann-c-client/Config.in"
 	source "package/shapelib/Config.in"
 	source "package/skalibs/Config.in"
+	source "package/sleef/Config.in"
 	source "package/sphinxbase/Config.in"
 	source "package/startup-notification/Config.in"
 	source "package/tinycbor/Config.in"
package/sleef/Config.in new file +50 -0

50 lines not on this page · raw message

package/sleef/sleef.hash new file +3 -0
new file mode 100644
index 0000000000..51570a5176
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566  LICENSE.txt
+sha256  415ee9b1bcc5816989d3d4d92afd0cd3f9ee89cbd5a33eb008e69751e40438ab  sleef-3.5.1.tar.gz
package/sleef/sleef.mk new file +49 -0

49 lines not on this page · raw message

Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Kirill, All,

On 2022-09-27 17:26 +0300, Kirill Kranke spake thusly:

Quoted 7 lines

SLEEF is a library that implements vectorized versions of C standard math functions. This library also includes DFT subroutines.

https://sleef.org/

---

[--SNIP--]

Quoted 6 lines
package/sleef/Config.in new file +0 -0
new file mode 100644
index 0000000000..85f93d384e

package/sleef/Config.in line 10

Quoted 10 lines
package/sleef/Config.in new file +10 -0
@@ -0,0 +1,50 @@
+config BR2_PACKAGE_SLEEF_ARCH_SUPPORTS
+	bool
+	default y if BR2_arm
+	default y if BR2_aarch64
+	default y if BR2_i386
+	default y if BR2_x86_64
+	default y if BR2_powerpc64
+
+config BR2_PACKAGE_SLEEF
+	bool "sleef"

You forgot to add the actual dependency on BR2_PACKAGE_SLEEF_ARCH_SUPPORTS here.

package/sleef/Config.in line 16

Quoted 6 lines
package/sleef/Config.in new file +6 -0
+	help
+          SLEEF is a library that implements vectorized versions
+          of C standard math functions. This library also
+          includes DFT subroutines.
+
+          https://sleef.org/

If I understand correctly, by default, only the libm is built. This should probably be specified in the help text for the main symbol.

package/sleef/Config.in line 22

Quoted 5 lines
package/sleef/Config.in new file +5 -0
+if BR2_PACKAGE_SLEEF
+
+config BR2_PACKAGE_SLEEF_DFT
+        bool "compile dft"
+        default n

default n is the default, so it should npt be specified.

package/sleef/Config.in line 23

Quoted 2 lines
package/sleef/Config.in new file +2 -0
+        help
+          libsleefdft will be built

The helpe text does not provide much more information that the prompt, so there is no need for the help text, unless we can come up with a better help (see below)

So:

config BR2_PACKAGE_SLEEF_LIBDFT
bool "libsleefdft"
help
libsleefdft contains functions to perform DFT (discreet Fourrier transform).

Adapt as you see fit.

And so on for the other options.

Quoted 46 lines
package/sleef/Config.in new file +25 -0
+config BR2_PACKAGE_SLEEF_QUAD
+        bool "compile quad"
+        default n
+        help
+          libsleefquad will be built
+
+config BR2_PACKAGE_SLEEF_GNUABI_LIBS
+        bool "compile gnuabi"
+        default y
+        help
+          libsleefgnuabi will be built
+
+config BR2_PACKAGE_SLEEF_SCALAR_LIB
+        bool "compile scalar"
+        default n
+        help
+          libsleefscalar will be built
+
+config BR2_PACKAGE_SLEEF_TESTS
+        bool "compile tests"
+        default n
+        help
+          Tests will be built
+
+endif
package/sleef/sleef.hash new file +3 -0
new file mode 100644
index 0000000000..51570a5176
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566  LICENSE.txt
+sha256  415ee9b1bcc5816989d3d4d92afd0cd3f9ee89cbd5a33eb008e69751e40438ab  sleef-3.5.1.tar.gz
package/sleef/sleef.mk new file +6 -0
new file mode 100644
index 0000000000..46bef69f5f
@@ -0,0 +1,49 @@
+################################################################################
+#
+# sleef
+#
+################################################################################
+

package/sleef/sleef.mk line 16

Quoted 10 lines
package/sleef/sleef.mk new file +10 -0
+SLEEF_VERSION = 3.5.1
+SLEEF_SITE = $(call github,shibatch,sleef,$(SLEEF_VERSION))
+SLEEF_LICENSE = BSL-1.0
+SLEEF_LICENSE_FILES = LICENSE.txt
+SLEEF_SUPPORTS_IN_SOURCE_BUILD = NO
+SLEEF_INSTALL_STAGING = YES
+
+# N.B. Need to use host sleef during cross compilation.
+SLEEF_DEPENDENCIES = host-sleef
+SLEEF_CONF_OPTS += -DNATIVE_BUILD_DIR=$(BUILD_DIR)/host-sleef-$(SLEEF_VERSION)/buildroot-build

You will have to explain in the commit log why you need to point to the host-sleef build directory, and why you can't use the installed one, in $(HOST_DIR).

Also, a package build directory is accessed with $(HOST_SLEEF_BUILDDIR) and for cmake based packages, it already includes the /buildroot-build sub-directory component:

make show-vars |jq .HOST_SLEEF_BUILDDIR

Otherwise, it looks good. Except forthe missing explanations about the use of the build directory of the host packag, I could have fixed the rest when applying.

Can you elaborate on that part, fix the other minor issues and respin, please?

Regards,
Yann E. MORIN.

Quoted 39 lines
package/sleef/sleef.mk new file +32 -0
+ifeq ($(BR2_PACKAGE_SLEEF_DFT),y)
+SLEEF_CONF_OPTS += -DBUILD_DFT=ON
+else
+SLEEF_CONF_OPTS += -DBUILD_DFT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_SLEEF_QUAD),y)
+SLEEF_CONF_OPTS += -DBUILD_QUAD=ON
+else
+SLEEF_CONF_OPTS += -DBUILD_QUAD=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_SLEEF_GNUABI_LIBS),y)
+SLEEF_CONF_OPTS += -DBUILD_GNUABI_LIBS=ON
+else
+SLEEF_CONF_OPTS += -DBUILD_GNUABI_LIBS=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_SLEEF_SCALAR_LIB),y)
+SLEEF_CONF_OPTS += -DBUILD_SCALAR_LIB=ON
+else
+SLEEF_CONF_OPTS += -DBUILD_SCALAR_LIB=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_SLEEF_TESTS),y)
+SLEEF_CONF_OPTS += -DBUILD_TESTS=ON
+else
+SLEEF_CONF_OPTS += -DBUILD_TESTS=OFF
+endif
+
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot