Patchwork fftwf: Add fftwf package for single precision fft

login
register
mail settings
Submitter Spenser Gilliland
Date April 11, 2013, 2:48 p.m.
Message ID <1365691684-30663-1-git-send-email-spenser@gillilanding.com>
Download mbox | patch
Permalink /patch/235777/
State Rejected
Headers show

Comments

Spenser Gilliland - April 11, 2013, 2:48 p.m.
From: Spenser Gilliland <Spenser309@gmail.com>

The current fftw package only produces double precision floating point
libraries.  This package recompiles the library for single precision and
uses the neon extensions if available.

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
---
 package/Config.in       |    1 +
 package/fftwf/Config.in |   14 ++++++++++++++
 package/fftwf/fftwf.mk  |   21 +++++++++++++++++++++
 3 files changed, 36 insertions(+)
 create mode 100644 package/fftwf/Config.in
 create mode 100644 package/fftwf/fftwf.mk
Thomas Petazzoni - April 11, 2013, 5:33 p.m.
Dear Spenser Gilliland,

On Thu, 11 Apr 2013 09:48:03 -0500, Spenser Gilliland wrote:

> +FFTWF_VERSION = 3.3.2
> +FFTWF_SITE = http://www.fftw.org
> +FFTWF_SOURCE = fftw-$(FFTWF_VERSION).tar.gz
> +FFTWF_INSTALL_STAGING = YES

package/fftw/ that already exists in Buildroot builds the exact same
source code. Why do you think a different package is needed?

Why don't you just add the:

+ifeq ($(BR2_ARM_ENABLE_NEON),y)
+FFTWF_CONF_OPT = --enable-single --enable-neon
+FFTWF_CONF_ENV += \
+	CFLAGS="$(TARGET_CFLAGS) -mfpu=neon -mfloat-abi=softfp"
+else
+FFTWF_CONF_OPT = --enable-single
+endif

block of code into package/fftw/fftw.mk ?

In Buildroot, we generally have one package for each source tarball.
But this package may provide different configuration options to adapt
to the specificities of the platform, or to provide different kind of
features.

Best regards,

Thomas
Spenser Gilliland - April 11, 2013, 6:17 p.m.
The problem is that the FFTW program cannot build both the single and
double precision libraries at the same time.

so the following must be done.

./configure
make
make install
./configure --enable-single --enable-neon
make
make install

The first run through installs the fftw library and pkg-config file.
The second run through only installs the fftwf library (no pkg-config
file).

Because the pkg-config is only installed from the double precision
(1st install). The fftwf library must depend on the fftw library for
proper operation.

Let me know if any changes should be made.

Spenser

On Thu, Apr 11, 2013 at 12:33 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Spenser Gilliland,
>
> On Thu, 11 Apr 2013 09:48:03 -0500, Spenser Gilliland wrote:
>
>> +FFTWF_VERSION = 3.3.2
>> +FFTWF_SITE = http://www.fftw.org
>> +FFTWF_SOURCE = fftw-$(FFTWF_VERSION).tar.gz
>> +FFTWF_INSTALL_STAGING = YES
>
> package/fftw/ that already exists in Buildroot builds the exact same
> source code. Why do you think a different package is needed?
>
> Why don't you just add the:
>
> +ifeq ($(BR2_ARM_ENABLE_NEON),y)
> +FFTWF_CONF_OPT = --enable-single --enable-neon
> +FFTWF_CONF_ENV += \
> +       CFLAGS="$(TARGET_CFLAGS) -mfpu=neon -mfloat-abi=softfp"
> +else
> +FFTWF_CONF_OPT = --enable-single
> +endif
>
> block of code into package/fftw/fftw.mk ?
>
> In Buildroot, we generally have one package for each source tarball.
> But this package may provide different configuration options to adapt
> to the specificities of the platform, or to provide different kind of
> features.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com

Patch

diff --git a/package/Config.in b/package/Config.in
index 69d87f0..b1bbfea 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -550,6 +550,7 @@  source "package/libcofi/Config.in"
 source "package/classpath/Config.in"
 source "package/elfutils/Config.in"
 source "package/fftw/Config.in"
+source "package/fftw/Config.in"
 source "package/libargtable2/Config.in"
 source "package/argp-standalone/Config.in"
 source "package/boost/Config.in"
diff --git a/package/fftwf/Config.in b/package/fftwf/Config.in
new file mode 100644
index 0000000..243be02
--- /dev/null
+++ b/package/fftwf/Config.in
@@ -0,0 +1,14 @@ 
+config BR2_PACKAGE_FFTWF
+	bool "fftwf"
+	depends on BR2_PACKAGE_FFTW
+	help
+	  Library for computing Fast Fourier Transforms using the ARM Neon
+	  instruction set.
+
+	  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 
+	  single precision.
+	
+	  http://www.fftw.org
+           
diff --git a/package/fftwf/fftwf.mk b/package/fftwf/fftwf.mk
new file mode 100644
index 0000000..90fb80e
--- /dev/null
+++ b/package/fftwf/fftwf.mk
@@ -0,0 +1,21 @@ 
+################################################################################
+#
+# fftwf
+#
+################################################################################
+
+FFTWF_VERSION = 3.3.2
+FFTWF_SITE = http://www.fftw.org
+FFTWF_SOURCE = fftw-$(FFTWF_VERSION).tar.gz
+FFTWF_INSTALL_STAGING = YES
+
+ifeq ($(BR2_ARM_ENABLE_NEON),y)
+FFTWF_CONF_OPT = --enable-single --enable-neon
+FFTWF_CONF_ENV += \
+	CFLAGS="$(TARGET_CFLAGS) -mfpu=neon -mfloat-abi=softfp"
+else
+FFTWF_CONF_OPT = --enable-single
+endif
+
+$(eval $(autotools-package))
+