Skip to contentSkip to conversation

fftwf: Add fftwf package for single precision fft

PATCH New Spenser Gilliland 3 participants 6 messages Apr 11, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fftwf: Add fftwf package for single precision fft

From: Spenser Gilliland <[email protected]>

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.

---
 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
package/Config.in +1 -0
index 69d87f0..b1bbfea 100644
@@ -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"
package/fftwf/Config.in new file +14 -0
new file mode 100644
index 0000000..243be02
@@ -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
+           
package/fftwf/fftwf.mk new file +21 -0
new file mode 100644
index 0000000..90fb80e
@@ -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))
+
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 fs: add uimage support w/ example for cpio

From: Spenser Gilliland <[email protected]>

Adds uimage support for various root filesystems. Uimage support is needed
when using the bootm command in uboot. This provides both a simple infrastructure
similar to the current BR2_TARGET_ROOTFS_$(2)_GZ for adding compression. To define the a rootfs should have a UIMAGE wrapper simply create the BR2_TARGET_ROOTFS_$(2)_UIMAGE symbol.

---
 fs/common.mk      |   19 ++++++++++++++++++-
 fs/cpio/Config.in |    7 +++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
fs/common.mk +18 -1
index a0b7b39..c97e012 100644
@@ -31,6 +31,8 @@
 # BR2_TARGET_ROOTFS_$(FSTYPE)_LZMA exist and are enabled, then the
 # macro will automatically generate a compressed filesystem image.
 
+MKIMAGE_RAMDISK = $(HOST_DIR)/usr/bin/mkimage -A $(BR2_ARCH) -T ramdisk -C $(1) -d $(2) $(2).uboot
+
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
 FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
 ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \
@@ -39,7 +41,7 @@ ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \
 define ROOTFS_TARGET_INTERNAL
 
 # extra deps
-ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma)
+ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) $$(if $$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),host-uboot-tools)
 
 $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES)
 	@$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
@@ -70,6 +72,21 @@ endif
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y)
 	$$(LZMA) -9 -c $$@ > [email protected]
 endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),y)
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_NONE),y)
+	$$(call MKIMAGE_RAMDISK,none,$$@)
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
+	$$(call MKIMAGE_RAMDISK,gzip,[email protected])
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y)
+	$$(call MKIMAGE_RAMDISK,bzip2,[email protected])
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y)
+	$$(call MKIMAGE_RAMDISK,lzma,[email protected])
+endif
+endif
+
 
 rootfs-$(1)-show-depends:
 	@echo $$(ROOTFS_$(2)_DEPENDENCIES)
fs/cpio/Config.in +7 -0
index 0669a44..b0c0210 100644
@@ -5,6 +5,13 @@ config BR2_TARGET_ROOTFS_CPIO
 	  used for an initial RAM filesystem that is passed to the kernel
 	  by the bootloader.
 
+config BR2_TARGET_ROOTFS_CPIO_UIMAGE
+	bool "Add U-Boot header to the root filesystem"
+	depends on BR2_TARGET_ROOTFS_CPIO
+        help
+	  Add a u-boot header to the cpio root filesystem.  This allows 
+	  the image to be booted by the bootm command in uboot.
+ 
 choice
         prompt "Compression method"
         default BR2_TARGET_ROOTFS_CPIO_NONE
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 fs: add uimage support w/ example for cpio

Quoted 7 lines · Spenser Gilliland

From: Spenser Gilliland <[email protected]>

Adds uimage support for various root filesystems. Uimage support is needed
when using the bootm command in uboot. This provides both a simple infrastructure
similar to the current BR2_TARGET_ROOTFS_$(2)_GZ for adding compression. To define the a rootfs should have a UIMAGE wrapper simply create the BR2_TARGET_ROOTFS_$(2)_UIMAGE symbol.

I successfully created a lzma compressed initramfs with u-boot header. With this and my patch from yesterday I can directly create working root file systems for Zynq w/o any further interaction.

This patch though, adds two lines with trailing white spaces.

S?ren

#3 lore raw

PATCH 1/1 fs: add uimage support w/ example for cpio

In reply to Spenser Gilliland

Dear Spenser Gilliland,

Thanks for your contribution!

Quoted 5 lines · Spenser Gilliland

From: Spenser Gilliland <[email protected]>

Adds uimage support for various root filesystems. Uimage support is needed
when using the bootm command in uboot. This provides both a simple infrastructure
similar to the current BR2_TARGET_ROOTFS_$(2)_GZ for adding compression. To define the a rootfs should have a UIMAGE wrapper simply create the BR2_TARGET_ROOTFS_$(2)_UIMAGE symbol.

Please wrap the commit log at ~80 columns.

fs/common.mk ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \ · line 44

Quoted 3 lines
 # extra deps
fs/common.mk +1 -1
-ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma)
+ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) $$(if $$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),host-uboot-tools)

Split the line:

ROOTFS_$(2)_DEPENDENCIES += host-fakeroot \
	$$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) \
	$$(if $$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),host-uboot-tools)
Quoted 4 lines
fs/common.mk +4 -0
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),y)
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_NONE),y)
+	$$(call MKIMAGE_RAMDISK,none,$$@)
+endif

fs/common.mk endif · line 88

Quoted 10 lines
fs/common.mk +10 -0
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
+	$$(call MKIMAGE_RAMDISK,gzip,[email protected])
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y)
+	$$(call MKIMAGE_RAMDISK,bzip2,[email protected])
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y)
+	$$(call MKIMAGE_RAMDISK,lzma,[email protected])
+endif
+endif

I am wondering: will we ever need this on something else than cpio?

fs/cpio/Config.in config BR2_TARGET_ROOTFS_CPIO · line 11

Quoted 4 lines
fs/cpio/Config.in +4 -0
+config BR2_TARGET_ROOTFS_CPIO_UIMAGE
+	bool "Add U-Boot header to the root filesystem"
+	depends on BR2_TARGET_ROOTFS_CPIO
+        help

Indentation should be one tab.

fs/cpio/Config.in config BR2_TARGET_ROOTFS_CPIO · line 17

Quoted 6 lines
fs/cpio/Config.in +3 -0
+	  Add a u-boot header to the cpio root filesystem.  This allows 
+	  the image to be booted by the bootm command in uboot.
+ 
 choice
         prompt "Compression method"
         default BR2_TARGET_ROOTFS_CPIO_NONE

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 fftwf: Add fftwf package for single precision fft

In reply to Spenser Gilliland

Dear Spenser Gilliland,

package/fftwf/fftwf.mk line 10

Quoted 4 lines · Spenser Gilliland
package/fftwf/fftwf.mk new file +4 -0
+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

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 1/1 fftwf: Add fftwf package for single precision fft

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

Quoted 37 lines · Thomas Petazzoni

Dear Spenser Gilliland,

package/fftwf/fftwf.mk line 10

Quoted 4 lines · Spenser Gilliland
package/fftwf/fftwf.mk new file +4 -0
+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:

package/fftwf/fftwf.mk new file +7 -0
+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

Signature · 3 lines
Spenser Gilliland
Computer Engineer
Doctoral Candidate