diff mbox series

[1/2] package/volk: new package

Message ID 20220208162409.496110-1-gwenj@trabucayre.com
State Accepted
Headers show
Series [1/2] package/volk: new package | expand

Commit Message

Gwenhael Goavec-Merou Feb. 8, 2022, 4:24 p.m. UTC
From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>

VOLK is the Vector-Optimized Library of Kernels

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
---
 DEVELOPERS             |  1 +
 package/Config.in      |  1 +
 package/volk/Config.in | 31 +++++++++++++++++++++++++++++++
 package/volk/volk.hash |  3 +++
 package/volk/volk.mk   | 39 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 75 insertions(+)
 create mode 100644 package/volk/Config.in
 create mode 100644 package/volk/volk.hash
 create mode 100644 package/volk/volk.mk

Comments

Romain Naour July 26, 2022, 5:34 p.m. UTC | #1
Hello Gwenhael,

Le 08/02/2022 à 17:24, Gwenhael Goavec-Merou a écrit :
> From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> 
> VOLK is the Vector-Optimized Library of Kernels
> 
> Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> ---
>  DEVELOPERS             |  1 +
>  package/Config.in      |  1 +
>  package/volk/Config.in | 31 +++++++++++++++++++++++++++++++
>  package/volk/volk.hash |  3 +++
>  package/volk/volk.mk   | 39 +++++++++++++++++++++++++++++++++++++++
>  5 files changed, 75 insertions(+)
>  create mode 100644 package/volk/Config.in
>  create mode 100644 package/volk/volk.hash
>  create mode 100644 package/volk/volk.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 1d1cf99898..c8a9b87c47 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1181,6 +1181,7 @@ F:	package/python-markdown/
>  F:	package/python-remi/
>  F:	package/python-sip/
>  F:	package/uhd/
> +F:	package/volk/
>  
>  N:	Heiko Thiery <heiko.thiery@gmail.com>
>  F:	board/kontron/pitx-imx8m/
> diff --git a/package/Config.in b/package/Config.in
> index d631ed784a..c0353829a3 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2062,6 +2062,7 @@ endif
>  	source "package/tz/Config.in"
>  	source "package/tzdata/Config.in"
>  	source "package/uvw/Config.in"
> +	source "package/volk/Config.in"
>  	source "package/xapian/Config.in"
>  endmenu
>  
> diff --git a/package/volk/Config.in b/package/volk/Config.in
> new file mode 100644
> index 0000000000..4539cd2153
> --- /dev/null
> +++ b/package/volk/Config.in
> @@ -0,0 +1,31 @@
> +comment "volk needs a toolchain w/ C++, NPTL, wchar, dynamic library"
> +	depends on BR2_USE_MMU
> +	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
> +		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS
> +
> +config BR2_PACKAGE_VOLK
> +	bool "volk"
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on !BR2_STATIC_LIBS
> +	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
> +	depends on BR2_USE_MMU # use fork()
> +	depends on BR2_USE_WCHAR # boost
> +	select BR2_PACKAGE_BOOST
> +	select BR2_PACKAGE_BOOST_FILESYSTEM
> +	select BR2_PACKAGE_BOOST_SYSTEM
> +	help
> +	  VOLK is the Vector-Optimized Library of Kernels. It is a
> +	  library that contains kernels of hand-written SIMD code
> +	  for different mathematical operations. Since each SIMD
> +	  architecture can be very different and no compiler has yet
> +	  come along to handle vectorization properly or highly
> +	  efficiently, VOLK approaches the problem differently.
> +
> +	  For each architecture or platform that a developer wishes
> +	  to vectorize for, a new proto-kernel is added to VOLK. At
> +	  runtime, VOLK will select the correct proto-kernel. In this
> +	  way, the users of VOLK call a kernel for performing the
> +	  operation that is platform/architecture agnostic. This
> +	  allows us to write portable SIMD code.
> +
> +	  https://www.libvolk.org/
> diff --git a/package/volk/volk.hash b/package/volk/volk.hash
> new file mode 100644
> index 0000000000..9fca6c1b33
> --- /dev/null
> +++ b/package/volk/volk.hash
> @@ -0,0 +1,3 @@
> +# Locally computed
> +sha256  d9183b9f86a32cdbb8698cbbeb15de574962c05200ccf445c1058629073521f8  volk-2.5.0.tar.gz

When available, we prefer the tar.xz archive

https://github.com/gnuradio/volk/releases/download/v2.5.0/volk-2.5.0.tar.xz

Note: the 2.5.1 has been released few days after your contribution.

> +sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
> diff --git a/package/volk/volk.mk b/package/volk/volk.mk
> new file mode 100644
> index 0000000000..cdb0ea9a77
> --- /dev/null
> +++ b/package/volk/volk.mk
> @@ -0,0 +1,39 @@
> +################################################################################
> +#
> +# volk
> +#
> +################################################################################
> +
> +VOLK_VERSION = 2.5.0
> +VOLK_SITE = https://github.com/gnuradio/volk/releases/download/v$(VOLK_VERSION)
> +VOLK_LICENSE = GPL-3.0+
> +VOLK_LICENSE_FILES = COPYING

There are two other license file present in the root directory:
COPYING-GPL
COPYING-LGPL

About the licensing status:

https://github.com/gnuradio/volk/tree/v2.5.1#license

So GPL-3.0+ is still correct.

Otherwise:
Reviewed-by: Romain Naour <romain.naour@smile.fr>

Best regards,
Romain


> +
> +VOLK_SUPPORTS_IN_SOURCE_BUILD = NO
> +
> +# host-python-mako are needed for volk to compile
> +VOLK_DEPENDENCIES = host-python3 host-python-mako boost
> +
> +VOLK_CONF_OPTS = \
> +	-DPYTHON_EXECUTABLE=$(HOST_DIR)/bin/python3 \
> +	-DENABLE_MODTOOL=OFF \
> +	-DENABLE_TESTING=OFF \
> +	-DENABLE_PROFILING=OFF \
> +	-DVOLK_PYTHON_DIR=lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> +
> +# For third-party blocks, the volk library is mandatory at
> +# compile time.
> +VOLK_INSTALL_STAGING = YES
> +
> +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> +VOLK_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
> +endif
> +
> +ifeq ($(BR2_PACKAGE_ORC),y)
> +VOLK_DEPENDENCIES += orc
> +VOLK_CONF_OPTS += -DENABLE_ORC=ON
> +else
> +VOLK_CONF_OPTS += -DENABLE_ORC=OFF
> +endif
> +
> +$(eval $(cmake-package))
Thomas Petazzoni July 26, 2022, 6:41 p.m. UTC | #2
On Tue,  8 Feb 2022 17:24:08 +0100
Gwenhael Goavec-Merou <gwenj@trabucayre.com> wrote:

> From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> 
> VOLK is the Vector-Optimized Library of Kernels
> 
> Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> ---
>  DEVELOPERS             |  1 +
>  package/Config.in      |  1 +
>  package/volk/Config.in | 31 +++++++++++++++++++++++++++++++
>  package/volk/volk.hash |  3 +++
>  package/volk/volk.mk   | 39 +++++++++++++++++++++++++++++++++++++++
>  5 files changed, 75 insertions(+)
>  create mode 100644 package/volk/Config.in
>  create mode 100644 package/volk/volk.hash
>  create mode 100644 package/volk/volk.mk

I've updated to version 2.5.1, switched to the .tar.xz tarball, added
COPYING-LGPL as a license file, added a missing
BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS dependency, and
applied.

Thanks a lot!

Thomas
Gwenhael Goavec-Merou July 26, 2022, 6:51 p.m. UTC | #3
On Tue, 26 Jul 2022 20:41:25 +0200
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> On Tue,  8 Feb 2022 17:24:08 +0100
> Gwenhael Goavec-Merou <gwenj@trabucayre.com> wrote:
> 
> > From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> > 
> > VOLK is the Vector-Optimized Library of Kernels
> > 
> > Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> > ---
> >  DEVELOPERS             |  1 +
> >  package/Config.in      |  1 +
> >  package/volk/Config.in | 31 +++++++++++++++++++++++++++++++
> >  package/volk/volk.hash |  3 +++
> >  package/volk/volk.mk   | 39 +++++++++++++++++++++++++++++++++++++++
> >  5 files changed, 75 insertions(+)
> >  create mode 100644 package/volk/Config.in
> >  create mode 100644 package/volk/volk.hash
> >  create mode 100644 package/volk/volk.mk  
> 
> I've updated to version 2.5.1, switched to the .tar.xz tarball, added
> COPYING-LGPL as a license file, added a missing
> BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS dependency, and
> applied.
> 
> Thanks a lot!
> 
> Thomas

Thanks to all!
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 1d1cf99898..c8a9b87c47 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1181,6 +1181,7 @@  F:	package/python-markdown/
 F:	package/python-remi/
 F:	package/python-sip/
 F:	package/uhd/
+F:	package/volk/
 
 N:	Heiko Thiery <heiko.thiery@gmail.com>
 F:	board/kontron/pitx-imx8m/
diff --git a/package/Config.in b/package/Config.in
index d631ed784a..c0353829a3 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2062,6 +2062,7 @@  endif
 	source "package/tz/Config.in"
 	source "package/tzdata/Config.in"
 	source "package/uvw/Config.in"
+	source "package/volk/Config.in"
 	source "package/xapian/Config.in"
 endmenu
 
diff --git a/package/volk/Config.in b/package/volk/Config.in
new file mode 100644
index 0000000000..4539cd2153
--- /dev/null
+++ b/package/volk/Config.in
@@ -0,0 +1,31 @@ 
+comment "volk needs a toolchain w/ C++, NPTL, wchar, dynamic library"
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS
+
+config BR2_PACKAGE_VOLK
+	bool "volk"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_USE_MMU # use fork()
+	depends on BR2_USE_WCHAR # boost
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_FILESYSTEM
+	select BR2_PACKAGE_BOOST_SYSTEM
+	help
+	  VOLK is the Vector-Optimized Library of Kernels. It is a
+	  library that contains kernels of hand-written SIMD code
+	  for different mathematical operations. Since each SIMD
+	  architecture can be very different and no compiler has yet
+	  come along to handle vectorization properly or highly
+	  efficiently, VOLK approaches the problem differently.
+
+	  For each architecture or platform that a developer wishes
+	  to vectorize for, a new proto-kernel is added to VOLK. At
+	  runtime, VOLK will select the correct proto-kernel. In this
+	  way, the users of VOLK call a kernel for performing the
+	  operation that is platform/architecture agnostic. This
+	  allows us to write portable SIMD code.
+
+	  https://www.libvolk.org/
diff --git a/package/volk/volk.hash b/package/volk/volk.hash
new file mode 100644
index 0000000000..9fca6c1b33
--- /dev/null
+++ b/package/volk/volk.hash
@@ -0,0 +1,3 @@ 
+# Locally computed
+sha256  d9183b9f86a32cdbb8698cbbeb15de574962c05200ccf445c1058629073521f8  volk-2.5.0.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
diff --git a/package/volk/volk.mk b/package/volk/volk.mk
new file mode 100644
index 0000000000..cdb0ea9a77
--- /dev/null
+++ b/package/volk/volk.mk
@@ -0,0 +1,39 @@ 
+################################################################################
+#
+# volk
+#
+################################################################################
+
+VOLK_VERSION = 2.5.0
+VOLK_SITE = https://github.com/gnuradio/volk/releases/download/v$(VOLK_VERSION)
+VOLK_LICENSE = GPL-3.0+
+VOLK_LICENSE_FILES = COPYING
+
+VOLK_SUPPORTS_IN_SOURCE_BUILD = NO
+
+# host-python-mako are needed for volk to compile
+VOLK_DEPENDENCIES = host-python3 host-python-mako boost
+
+VOLK_CONF_OPTS = \
+	-DPYTHON_EXECUTABLE=$(HOST_DIR)/bin/python3 \
+	-DENABLE_MODTOOL=OFF \
+	-DENABLE_TESTING=OFF \
+	-DENABLE_PROFILING=OFF \
+	-DVOLK_PYTHON_DIR=lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
+
+# For third-party blocks, the volk library is mandatory at
+# compile time.
+VOLK_INSTALL_STAGING = YES
+
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+VOLK_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
+endif
+
+ifeq ($(BR2_PACKAGE_ORC),y)
+VOLK_DEPENDENCIES += orc
+VOLK_CONF_OPTS += -DENABLE_ORC=ON
+else
+VOLK_CONF_OPTS += -DENABLE_ORC=OFF
+endif
+
+$(eval $(cmake-package))