Skip to contentSkip to conversation

package/fftw: Enable multiple precision installation

PATCH New Matt Flax 2 participants 5 messages Aug 19, 2016 – Aug 21, 2016

lore
Share & tools
lore

Matt Flax

author
#0 lore raw

PATCH 2/2 package/fftw: Enable multiple precision installation

This commit enables fftw to be installed for multiple precisions on the same system. For example if one package requires single precision and another package requires double precision, then both fftw and fftwf can now be slected and installed at the same time. Before this commit that wasn't possible.

The fftw site (http://www.fftw.org/fftw2_doc/fftw_6.html) states that to install multiple precisions the procedure is a full clean and rebuild for each desired precision. This patch achieves that by doing complete builds (as required) for each of the required precisions.

---
 package/fftw/Config.in            | 61 ++++-----------------------------------
 package/fftw/fftw.mk              |  6 +---
 package/fftw/fftw/Config.in       | 19 ++++++++++++
 package/fftw/{ => fftw}/fftw.hash |  0
 package/fftw/fftw/fftw.mk         |  9 ++++++
 package/fftw/fftwf/Config.in      | 22 ++++++++++++++
 package/fftw/fftwf/fftwf.hash     |  2 ++
 package/fftw/fftwf/fftwf.mk       | 23 +++++++++++++++
 package/fftw/fftwl/Config.in      | 22 ++++++++++++++
 package/fftw/fftwl/fftwl.hash     |  2 ++
 package/fftw/fftwl/fftwl.mk       | 23 +++++++++++++++
 package/fftw/fftwq/Config.in      | 21 ++++++++++++++
 package/fftw/fftwq/fftwq.hash     |  2 ++
 package/fftw/fftwq/fftwq.mk       | 23 +++++++++++++++
 14 files changed, 174 insertions(+), 61 deletions(-)
 create mode 100644 package/fftw/fftw/Config.in
 rename package/fftw/{ => fftw}/fftw.hash (100%)
 create mode 100644 package/fftw/fftw/fftw.mk
 create mode 100644 package/fftw/fftwf/Config.in
 create mode 100644 package/fftw/fftwf/fftwf.hash
 create mode 100644 package/fftw/fftwf/fftwf.mk
 create mode 100644 package/fftw/fftwl/Config.in
 create mode 100644 package/fftw/fftwl/fftwl.hash
 create mode 100644 package/fftw/fftwl/fftwl.mk
 create mode 100644 package/fftw/fftwq/Config.in
 create mode 100644 package/fftw/fftwq/fftwq.hash
 create mode 100644 package/fftw/fftwq/fftwq.mk
package/fftw/Config.in +5 -56
index ef11384..be8f6cd 100644
@@ -1,17 +1,3 @@
-config BR2_PACKAGE_FFTW
-	bool "fftw"
-	help
-	  Library for computing Fast Fourier Transforms.
-
-	  This library computes Fast Fourier Transforms (FFT) in one
-	  or more dimensions. It is extremely fast. This package
-	  contains the shared library version of the fftw libraries in
-	  double precision.
-
-	  http://www.fftw.org
-
-if BR2_PACKAGE_FFTW
-
 config BR2_PACKAGE_FFTW_USE_SSE
 	bool
 
@@ -21,47 +7,6 @@ config BR2_PACKAGE_FFTW_USE_SSE2
 config BR2_PACKAGE_FFTW_USE_NEON
 	bool
 
-choice
-	prompt "fftw precision"
-	default BR2_PACKAGE_FFTW_PRECISION_DOUBLE
-	help
-	  Selects fftw precision
-
-config BR2_PACKAGE_FFTW_PRECISION_SINGLE
-	bool "single"
-	select BR2_PACKAGE_FFTW_USE_SSE if BR2_X86_CPU_HAS_SSE
-	select BR2_PACKAGE_FFTW_USE_SSE2 if BR2_X86_CPU_HAS_SSE2
-	select BR2_PACKAGE_FFTW_USE_NEON if BR2_ARM_CPU_HAS_NEON && !BR2_ARM_SOFT_FLOAT
-	help
-	  Compile fftw in single precision, i.e. use 'float' for floating
-	  point type.
-
-config BR2_PACKAGE_FFTW_PRECISION_DOUBLE
-	bool "double"
-	select BR2_PACKAGE_FFTW_USE_SSE2 if BR2_X86_CPU_HAS_SSE2
-	help
-	  Compile fftw in double precision (the default), i.e. use 'double'
-	  for floating point type.
-
-config BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE
-	bool "long double"
-	# long-double precision require long-double trigonometric routines
-	depends on !(BR2_TOOLCHAIN_BUILDROOT_UCLIBC && \
-		(BR2_arm || BR2_mips || BR2_mipsel))
-	help
-	  Compile fftw in long double precision, i.e. use 'long double'
-	  for floating point type.
-
-config BR2_PACKAGE_FFTW_PRECISION_QUAD
-	bool "quad"
-	# quad-precision needs to have a gcc with libquadmath
-	depends on (BR2_i386 || BR2_x86_64) && BR2_USE_WCHAR
-	help
-	  Compile fftw in quadruple precision, i.e. use '__float128' for
-	  floating point type.
-
-endchoice
-
 config BR2_PACKAGE_FFTW_FAST
 	bool "optimise for speed over accuracy"
 	help
@@ -75,4 +20,8 @@ config BR2_PACKAGE_FFTW_FAST
 	  turn is basically using gcc's -ffast-math. See the gcc manual
 	  for what this means.
 
-endif
+source "package/fftw/fftw/Config.in"
+source "package/fftw/fftwf/Config.in"
+source "package/fftw/fftwl/Config.in"
+source "package/fftw/fftwq/Config.in"
+
package/fftw/fftw.mk +1 -5
index 5bd39a8..216838a 100644
@@ -18,10 +18,6 @@ else
 FFTW_CONF_OPTS += --disable-fortran
 endif
 
-FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_SINGLE),--enable,--disable)-single
-FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE),--enable,--disable)-long-double
-FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_QUAD),--enable,--disable)-quad-precision
-
 FFTW_CFLAGS = $(TARGET_CFLAGS)
 ifeq ($(BR2_PACKAGE_FFTW_FAST),y)
 FFTW_CFLAGS += -O3 -ffast-math
@@ -46,4 +42,4 @@ FFTW_CONF_OPTS += $(if $(BR2_GCC_ENABLE_OPENMP),--enable,--disable)-openmp
 
 FFTW_CONF_OPTS += CFLAGS="$(FFTW_CFLAGS)"
 
-$(eval $(autotools-package))
+include package/fftw/*/*.mk
package/fftw/fftw/Config.in new file +19 -0
new file mode 100644
index 0000000..51bd5eb
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_FFTW
+	bool "fftw"
+	help
+	  Library for computing Fast Fourier Transforms in double precision.
+
+	  This library computes Fast Fourier Transforms (FFT) in one
+	  or more dimensions. It is extremely fast. This package
+	  contains the shared library version of the fftw libraries in
+	  double precision.
+
+	  http://www.fftw.org
+
+config BR2_PACKAGE_FFTW_PRECISION_DOUBLE
+	bool "double"
+	select BR2_PACKAGE_FFTW_USE_SSE2 if BR2_X86_CPU_HAS_SSE2
+	help
+	  Compile fftw in double precision (the default), i.e. use 'double'
+	  for floating point type.
+
package/fftw/fftw/fftw.hash renamed from package/fftw/fftw.hash +0 -0
similarity index 100%
rename from package/fftw/fftw.hash
rename to package/fftw/fftw/fftw.hash
package/fftw/fftw/fftw.mk new file +9 -0
new file mode 100644
index 0000000..66a82ec
@@ -0,0 +1,9 @@
+################################################################################
+#
+# fftw
+#
+################################################################################
+
+$(eval $(autotools-package))
+
+
package/fftw/fftwf/Config.in new file +22 -0
new file mode 100644
index 0000000..7077086
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_FFTWF
+	bool "fftwf"
+	select BR2_PACKAGE_FFTW_PRECISION_SINGLE
+	help
+	  Library for computing Fast Fourier Transforms in single precision.
+
+	  This library computes Fast Fourier Transforms (FFT) in one
+	  or more dimensions. It is extremely fast. This package
+	  contains the shared library version of the fftw libraries in
+	  double precision.
+
+	  http://www.fftw.org
+
+config BR2_PACKAGE_FFTW_PRECISION_SINGLE
+	bool "single"
+	select BR2_PACKAGE_FFTW_USE_SSE if BR2_X86_CPU_HAS_SSE
+	select BR2_PACKAGE_FFTW_USE_SSE2 if BR2_X86_CPU_HAS_SSE2
+	select BR2_PACKAGE_FFTW_USE_NEON if BR2_ARM_CPU_HAS_NEON && !BR2_ARM_SOFT_FLOAT
+	help
+	  Compile fftw in single precision, i.e. use 'float' for floating
+	  point type.
+
package/fftw/fftwf/fftwf.hash new file +2 -0
new file mode 100644
index 0000000..62b8f0f
@@ -0,0 +1,2 @@
+# From http://www.fftw.org/fftw-3.3.4.tar.gz.md5sum
+md5	2edab8c06b24feeb3b82bbb3ebf3e7b3	fftw-3.3.4.tar.gz
package/fftw/fftwf/fftwf.mk new file +23 -0
new file mode 100644
index 0000000..a4184b5
@@ -0,0 +1,23 @@
+################################################################################
+#
+# fftwf
+#
+################################################################################
+
+FFTWF_VERSION = $(FFTW_VERSION)
+FFTWF_SOURCE = fftw-$(FFTWF_VERSION).tar.gz
+FFTWF_SITE = $(FFTW_SITE)
+FFTWF_INSTALL_STAGING = $(FFTW_INSTALL_STAGING)
+FFTWF_LICENSE = $(FFTW_LICENSE)
+FFTWF_LICENSE_FILES = $(FFTW_LICENSE_FILES)
+
+FFTWF_CONF_ENV = $(FFTW_CONF_ENV)
+
+FFTWF_CONF_OPTS = $(FFTW_CONF_OPTS)
+FFTWF_CONF_OPTS += --enable-single
+
+FFTWF_CFLAGS = $(FFTW_CFLAGS)
+
+$(eval $(autotools-package))
+
+
package/fftw/fftwl/Config.in new file +22 -0
new file mode 100644
index 0000000..466a11e
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_FFTWL
+	bool "fftwl"
+	select BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE
+	help
+	  Library for computing Fast Fourier Transforms in long double precision.
+
+	  This library computes Fast Fourier Transforms (FFT) in one
+	  or more dimensions. It is extremely fast. This package
+	  contains the shared library version of the fftw libraries in
+	  double precision.
+
+	  http://www.fftw.org
+
+config BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE
+	bool "long double"
+	# long-double precision require long-double trigonometric routines
+	depends on !(BR2_TOOLCHAIN_BUILDROOT_UCLIBC && \
+		(BR2_arm || BR2_mips || BR2_mipsel))
+	help
+	  Compile fftw in long double precision, i.e. use 'long double'
+	  for floating point type.
+
package/fftw/fftwl/fftwl.hash new file +2 -0
new file mode 100644
index 0000000..62b8f0f
@@ -0,0 +1,2 @@
+# From http://www.fftw.org/fftw-3.3.4.tar.gz.md5sum
+md5	2edab8c06b24feeb3b82bbb3ebf3e7b3	fftw-3.3.4.tar.gz
package/fftw/fftwl/fftwl.mk new file +23 -0
new file mode 100644
index 0000000..2412590
@@ -0,0 +1,23 @@
+################################################################################
+#
+# fftwl
+#
+################################################################################
+
+FFTL_VERSION = $(FFTW_VERSION)
+FFTL_SOURCE = fftw-$(FFTWL_VERSION).tar.gz
+FFTL_SITE = $(FFTW_SITE)
+FFTL_INSTALL_STAGING = $(FFTW_INSTALL_STAGING)
+FFTL_LICENSE = $(FFTW_LICENSE)
+FFTL_LICENSE_FILES = $(FFTW_LICENSE_FILES)
+
+FFTL_CONF_ENV = $(FFTW_CONF_ENV)
+
+FFTL_CONF_OPTS = $(FFTW_CONF_OPTS)
+FFTL_CONF_OPTS += --enable-long-double
+
+FFTL_CFLAGS = $(FFTW_CFLAGS)
+
+$(eval $(autotools-package))
+
+
package/fftw/fftwq/Config.in new file +21 -0
new file mode 100644
index 0000000..fc6f427
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_FFTWQ
+	bool "fftwq"
+	select BR2_PACKAGE_FFTW_PRECISION_QUAD
+	help
+	  Library for computing Fast Fourier Transforms in quad precision.
+
+	  This library computes Fast Fourier Transforms (FFT) in one
+	  or more dimensions. It is extremely fast. This package
+	  contains the shared library version of the fftw libraries in
+	  double precision.
+
+	  http://www.fftw.org
+
+config BR2_PACKAGE_FFTW_PRECISION_QUAD
+	bool "quad"
+	# quad-precision needs to have a gcc with libquadmath
+	depends on (BR2_i386 || BR2_x86_64) && BR2_USE_WCHAR
+	help
+	  Compile fftw in quadruple precision, i.e. use '__float128' for
+	  floating point type.
+
package/fftw/fftwq/fftwq.hash new file +2 -0
new file mode 100644
index 0000000..62b8f0f
@@ -0,0 +1,2 @@
+# From http://www.fftw.org/fftw-3.3.4.tar.gz.md5sum
+md5	2edab8c06b24feeb3b82bbb3ebf3e7b3	fftw-3.3.4.tar.gz
package/fftw/fftwq/fftwq.mk new file +23 -0
new file mode 100644
index 0000000..6130538
@@ -0,0 +1,23 @@
+################################################################################
+#
+# fftwq
+#
+################################################################################
+
+FFTQ_VERSION = $(FFTW_VERSION)
+FFTQ_SOURCE = fftw-$(FFTWQ_VERSION).tar.gz
+FFTQ_SITE = $(FFTW_SITE)
+FFTQ_INSTALL_STAGING = $(FFTW_INSTALL_STAGING)
+FFTQ_LICENSE = $(FFTW_LICENSE)
+FFTQ_LICENSE_FILES = $(FFTW_LICENSE_FILES)
+
+FFTQ_CONF_ENV = $(FFTW_CONF_ENV)
+
+FFTQ_CONF_OPTS = $(FFTW_CONF_OPTS)
+FFTQ_CONF_OPTS += --enable-quad-precision
+
+FFTQ_CFLAGS = $(FFTW_CFLAGS)
+
+$(eval $(autotools-package))
+
+
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 package/fftw: Enable multiple precision installation

Hello,

Quoted 6 lines · Matt Flax

This commit enables fftw to be installed for multiple precisions on the same system. For example if one package requires single precision and another package requires double precision, then both fftw and fftwf can now be slected and installed at the same time. Before this commit that wasn't possible.

Quoted 6 lines

The fftw site (http://www.fftw.org/fftw2_doc/fftw_6.html) states that to install multiple precisions the procedure is a full clean and rebuild for each desired precision. This patch achieves that by doing complete builds (as required) for each of the required precisions.

Thanks for this patch. However, I read on the fftw web site that --enable-type-prefix should be used to have a library file and header file with different name depending on the precision being used.

I don't see where you are passing this option, so from the look of it, your four packages would install over each other. Or is --enable-type-prefix the default ?

Another concern is that one --enable-type-prefix is used, then all packages that use fftw will have to use the right library name and header name depending on the precision they want to use. Are they all ready for that?

Could you check the different Buildroot packages in the tree that use FFTW, and see how they behave, and whether they need to be changed to accommodate your patch?

There's at least alsa-lib, gnuradio, httping, imagemagick, libvips, liquid-dsp and pulseaudio to look at.

Quoted 14 lines
package/fftw/fftw/Config.in new file +8 -0
new file mode 100644
index 0000000..51bd5eb
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_FFTW
+	bool "fftw"
+	help
+	  Library for computing Fast Fourier Transforms in double precision.
+
+	  This library computes Fast Fourier Transforms (FFT) in one
+	  or more dimensions. It is extremely fast. This package
+	  contains the shared library version of the fftw libraries in

package/fftw/fftw/Config.in line 18

Quoted 10 lines
package/fftw/fftw/Config.in new file +10 -0
+	  double precision.
+
+	  http://www.fftw.org
+
+config BR2_PACKAGE_FFTW_PRECISION_DOUBLE
+	bool "double"
+	select BR2_PACKAGE_FFTW_USE_SSE2 if BR2_X86_CPU_HAS_SSE2
+	help
+	  Compile fftw in double precision (the default), i.e. use 'double'
+	  for floating point type.

You have those two symbols for each package, why so? They don't have any dependency between each other, which means that BR2_PACKAGE_FFTW_PRECISION_DOUBLE can be enabled without BR2_PACKAGE_FFTW, so BR2_PACKAGE_FFTW_PRECISION_DOUBLE can be enabled, but the fftw package will not be built.

We should have a single option for each package.

Quoted 10 lines
package/fftw/fftw/fftw.hash renamed from package/fftw/fftw.hash +0 -0
similarity index 100%
rename from package/fftw/fftw.hash
rename to package/fftw/fftw/fftw.hash
package/fftw/fftw/fftw.mk new file +0 -0
new file mode 100644
index 0000000..66a82ec

package/fftw/fftw/fftw.mk line 5

Quoted 5 lines
package/fftw/fftw/fftw.mk new file +5 -0
@@ -0,0 +1,9 @@
+################################################################################
+#
+# fftw
+#
+################################################################################

I'd prefer to have this package be similar to the other ones, so package/fftw/fftw.mk be renamed to package/fftw/fftw-common.mk, and then here a package that looks like the other fftw* packages.

package/fftw/fftw/fftw.mk line 9

Quoted 3 lines
package/fftw/fftw/fftw.mk new file +3 -0
+$(eval $(autotools-package))
+
+

Useless empty lines.

package/fftw/fftwf/Config.in line 3

Quoted 9 lines
package/fftw/fftwf/Config.in new file +3 -0
new file mode 100644
index 0000000..7077086
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_FFTWF
+	bool "fftwf"
+	select BR2_PACKAGE_FFTW_PRECISION_SINGLE

Ah, here we have this select. But do we really need two options?

package/fftw/fftwf/fftwf.hash line 2

Quoted 8 lines
package/fftw/fftwf/fftwf.hash new file +2 -0
new file mode 100644
index 0000000..62b8f0f
@@ -0,0 +1,2 @@
+# From http://www.fftw.org/fftw-3.3.4.tar.gz.md5sum
+md5	2edab8c06b24feeb3b82bbb3ebf3e7b3	fftw-3.3.4.tar.gz

For the hash file, you can use a symlink, like we're doing in package/gcc/gcc-{initial,final}.

I must say I'm not really thrilled by the duplication of code for those four packages, but I unfortunately don't have a better idea to propose. Let's add Arnout in Cc, he sometimes have some very creative ideas :-)

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
author
#2 lore raw

PATCH 2/2 package/fftw: Enable multiple precision installation

Quoted 14 lines · Thomas Petazzoni

Hello,

Quoted 11 lines · Matt Flax

This commit enables fftw to be installed for multiple precisions on the same system. For example if one package requires single precision and another package requires double precision, then both fftw and fftwf can now be slected and installed at the same time. Before this commit that wasn't possible.

The fftw site (http://www.fftw.org/fftw2_doc/fftw_6.html) states that to install multiple precisions the procedure is a full clean and rebuild for each desired precision. This patch achieves that by doing complete builds (as required) for each of the required precisions.

Quoted 8 lines
Quoted 1 line

Thanks for this patch. However, I read on the fftw web site that --enable-type-prefix should be used to have a library file and header file with different name depending on the precision being used.

I don't see where you are passing this option, so from the look of it, your four packages would install over each other. Or is --enable-type-prefix the default ?

There are now 4 mk files. Each builds in a separate directory (fftw, fftwf, fftwl, fftwq) and installs as per the recommendations from fftw. All fftw packages inherit the version, source, site, license, env, conf_opts, cflags from fftw.mk. By inheriting from one single set of macros, we can bump versions very easily.
The different precisions are added like so :
fftwf.mk : FFTWF_CONF_OPTS += --enable-single
fftwl.mk : FFTL_CONF_OPTS += --enable-long-double
fftwq.mk : FFTQ_CONF_OPTS += --enable-quad-precision

Regarding dev files, the header files are all the same - in fact from the fftw site, http://www.fftw.org/fftw2_doc/fftw_6.html#SEC69 it is recommended that they all install ontop of each other :
./configure; make; make install; make clean
./configure --ebale-single; make; make install; make clean and so on ...

Quoted 11 lines

Another concern is that one --enable-type-prefix is used, then all packages that use fftw will have to use the right library name and header name depending on the precision they want to use. Are they all ready for that?

Could you check the different Buildroot packages in the tree that use FFTW, and see how they behave, and whether they need to be changed to accommodate your patch?

There's at least alsa-lib, gnuradio, httping, imagemagick, libvips, liquid-dsp and pulseaudio to look at.

Actually "type-prefixes" aren't used and no changes are made to the names. Double precision remains libfftw3.so.3, single precision remains libfftw3f.so.3 .... and so on. There is one header file used by all and it is constant.

Literally, this patch simply allows side by side installation, as it is intended to be.

thanks
Matt

Quoted 30 lines
Quoted 14 lines
package/fftw/fftw/Config.in new file +8 -0
new file mode 100644
index 0000000..51bd5eb
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_FFTW
+	bool "fftw"
+	help
+	  Library for computing Fast Fourier Transforms in double precision.
+
+	  This library computes Fast Fourier Transforms (FFT) in one
+	  or more dimensions. It is extremely fast. This package
+	  contains the shared library version of the fftw libraries in

package/fftw/fftw/Config.in line 18

Quoted 10 lines
package/fftw/fftw/Config.in new file +10 -0
+	  double precision.
+
+	  http://www.fftw.org
+
+config BR2_PACKAGE_FFTW_PRECISION_DOUBLE
+	bool "double"
+	select BR2_PACKAGE_FFTW_USE_SSE2 if BR2_X86_CPU_HAS_SSE2
+	help
+	  Compile fftw in double precision (the default), i.e. use 'double'
+	  for floating point type.

You have those two symbols for each package, why so? They don't have any dependency between each other, which means that BR2_PACKAGE_FFTW_PRECISION_DOUBLE can be enabled without BR2_PACKAGE_FFTW, so BR2_PACKAGE_FFTW_PRECISION_DOUBLE can be enabled, but the fftw package will not be built.

Quoted 1 line

We should have a single option for each package.

Yep - I will have to fix this and resubmit a patch.

Quoted 11 lines
Quoted 11 lines
package/fftw/fftw/fftw.hash renamed from package/fftw/fftw.hash +0 -0
similarity index 100%
rename from package/fftw/fftw.hash
rename to package/fftw/fftw/fftw.hash
package/fftw/fftw/fftw.mk new file +0 -0
new file mode 100644
index 0000000..66a82ec
@@ -0,0 +1,9 @@
Quoted 8 lines

package/fftw/fftw/fftw.mk line 5

Quoted 5 lines
package/fftw/fftw/fftw.mk new file +5 -0
+################################################################################
+#
+# fftw
+#
+################################################################################

I'd prefer to have this package be similar to the other ones, so package/fftw/fftw.mk be renamed to package/fftw/fftw-common.mk, and then here a package that looks like the other fftw* packages.

OK. However what is the best way to do this ? I notice ibr and matchbox have common directories ... so should we clutter the package directory with 5 fftw related directories ?

Quoted 6 lines

package/fftw/fftw/fftw.mk line 9

Quoted 4 lines
package/fftw/fftw/fftw.mk new file +3 -0
+$(eval $(autotools-package))
+
+

Useless empty lines.

Quoted 10 lines

package/fftw/fftwf/Config.in line 3

Quoted 9 lines
package/fftw/fftwf/Config.in new file +3 -0
new file mode 100644
index 0000000..7077086
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_FFTWF
+	bool "fftwf"
+	select BR2_PACKAGE_FFTW_PRECISION_SINGLE

Ah, here we have this select. But do we really need two options?

Yep - I don't understand what you mean here though ?

Quoted 11 lines

package/fftw/fftwf/fftwf.hash line 2

Quoted 9 lines
package/fftw/fftwf/fftwf.hash new file +2 -0
new file mode 100644
index 0000000..62b8f0f
@@ -0,0 +1,2 @@
+# From http://www.fftw.org/fftw-3.3.4.tar.gz.md5sum
+md5	2edab8c06b24feeb3b82bbb3ebf3e7b3	fftw-3.3.4.tar.gz

For the hash file, you can use a symlink, like we're doing in package/gcc/gcc-{initial,final}.

OK

Quoted 8 lines

I must say I'm not really thrilled by the duplication of code for those four packages, but I unfortunately don't have a better idea to propose. Let's add Arnout in Cc, he sometimes have some very creative ideas :-)

Thanks!

Thomas

I agree, I wasn't thrilled about having different build code replication in output/build, however I think that is the trade-off for simplicity !

Matt

#3 lore raw

PATCH 2/2 package/fftw: Enable multiple precision installation

Hello,

Quoted 12 lines · Matt Flax
Quoted 3 lines

I don't see where you are passing this option, so from the look of it, your four packages would install over each other. Or is --enable-type-prefix the default ?

There are now 4 mk files. Each builds in a separate directory (fftw, fftwf, fftwl, fftwq) and installs as per the recommendations from fftw. All fftw packages inherit the version, source, site, license, env, conf_opts, cflags from fftw.mk. By inheriting from one single set of macros, we can bump versions very easily.
The different precisions are added like so :
fftwf.mk : FFTWF_CONF_OPTS += --enable-single
fftwl.mk : FFTL_CONF_OPTS += --enable-long-double
fftwq.mk : FFTQ_CONF_OPTS += --enable-quad-precision

I'm not talking about the Buildroot code, but what each fftw package will be installing. My understanding is that if you don't pass --enable-type-prefix, each fftw package will install exactly the same files, overwriting the ones written by the other fftw packages, making the all adventure useless.

Quoted 6 lines

Regarding dev files, the header files are all the same - in fact from the fftw site, http://www.fftw.org/fftw2_doc/fftw_6.html#SEC69 it is recommended that they all install ontop of each other :
./configure; make; make install; make clean
./configure --ebale-single; make; make install; make clean and so on ...

Read again this very same section, they tell you to do:

./configure --enable-type-prefix [ other options ]
make
make install
make clean
./configure --enable-float --enable-type-prefix [ other options ] make
make install

See that they are using the --enable-type-prefix option I'm referring to?

Quoted 9 lines
Quoted 9 lines

Another concern is that one --enable-type-prefix is used, then all packages that use fftw will have to use the right library name and header name depending on the precision they want to use. Are they all ready for that?

Could you check the different Buildroot packages in the tree that use FFTW, and see how they behave, and whether they need to be changed to accommodate your patch?

Quoted 7 lines
Quoted 2 lines

There's at least alsa-lib, gnuradio, httping, imagemagick, libvips, liquid-dsp and pulseaudio to look at.

Actually "type-prefixes" aren't used and no changes are made to the names. Double precision remains libfftw3.so.3, single precision remains libfftw3f.so.3 .... and so on. There is one header file used by all and it is constant.

See above.

Quoted 2 lines

Literally, this patch simply allows side by side installation, as it is intended to be.

I don't see how side by side installation is possible if all four variants of the library install to the same libfftw3.so.3 file. Could you expand a bit on this?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
author
#4 lore raw

PATCH 2/2 package/fftw: Enable multiple precision installation

Quoted 38 lines · Thomas Petazzoni

Hello,

Quoted 12 lines · Matt Flax
Quoted 3 lines

I don't see where you are passing this option, so from the look of it, your four packages would install over each other. Or is --enable-type-prefix the default ?

There are now 4 mk files. Each builds in a separate directory (fftw, fftwf, fftwl, fftwq) and installs as per the recommendations from fftw. All fftw packages inherit the version, source, site, license, env, conf_opts, cflags from fftw.mk. By inheriting from one single set of macros, we can bump versions very easily.
The different precisions are added like so :
fftwf.mk : FFTWF_CONF_OPTS += --enable-single
fftwl.mk : FFTL_CONF_OPTS += --enable-long-double
fftwq.mk : FFTQ_CONF_OPTS += --enable-quad-precision

I'm not talking about the Buildroot code, but what each fftw package will be installing. My understanding is that if you don't pass --enable-type-prefix, each fftw package will install exactly the same files, overwriting the ones written by the other fftw packages, making the all adventure useless.

Quoted 6 lines

Regarding dev files, the header files are all the same - in fact from the fftw site, http://www.fftw.org/fftw2_doc/fftw_6.html#SEC69 it is recommended that they all install ontop of each other :
./configure; make; make install; make clean
./configure --ebale-single; make; make install; make clean and so on ...

Read again this very same section, they tell you to do:

./configure --enable-type-prefix [ other options ]
make
make install
make clean
./configure --enable-float --enable-type-prefix [ other options ] make
make install

Quoted 3 lines

See that they are using the --enable-type-prefix option I'm referring to?

Type prefix was removed in version 3 of fftw. Here for example is an attempt to configure with type-prefix enabled :
configure: WARNING: unrecognized options: --enable-type-prefix

type-prefix is not a problem, as it isn't used any more ... I Think the fftw website is a little out of date ... the point however I was trying to show is that they recommend installing everything on the same system by building and rebuilding ...

In my opinion, the bottom line is that the package fftw in buildroot is inadequate. For example when alsa bat selects fftw, it is implicitly selecting the double version of fftw because it is the first choice, this isn't very robust. But this is not a huge problem ... however there are bigger issues...

There are situations when some packages want double precision, some packages want single precision ... and so on ... for example, gnuradio has had to force no installation of SINGLE precision :
package/gnuradio/Config.in: depends on !BR2_PACKAGE_FFTW_PRECISION_SINGLE
I asssume this is because they have to choose between double or single precision, merely because the current status of the buildroot package fftw is inadequately cobbled together.

You see, the problem arises if someone needs to link against libfftwf ... the single version and also is using other programs which require the double precision version.

Fftw the package is designed to be installed on the same system with all precisions that are required.

My proposal is to fix this inherent problem. I will submit a new patch which includes all of the feedback I have been given ... such as using a common mk file and symbolic linking against the one hash file. I will address the packages in the buildroot repo which depend/select fftw.

Do you think this is a good approach or is there a better way to go about this ?

Quoted 26 lines

Another concern is that one --enable-type-prefix is used, then all packages that use fftw will have to use the right library name and header name depending on the precision they want to use. Are they all ready for that?

Could you check the different Buildroot packages in the tree that use FFTW, and see how they behave, and whether they need to be changed to accommodate your patch?

There's at least alsa-lib, gnuradio, httping, imagemagick, libvips, liquid-dsp and pulseaudio to look at.

Quoted 4 lines

Actually "type-prefixes" aren't used and no changes are made to the names. Double precision remains libfftw3.so.3, single precision remains libfftw3f.so.3 .... and so on. There is one header file used by all and it is constant.

See above.

Quoted 2 lines

Literally, this patch simply allows side by side installation, as it is intended to be.

I don't see how side by side installation is possible if all four variants of the library install to the same libfftw3.so.3 file. Could you expand a bit on this?

Thanks!

Thomas