* [Buildroot] [PATCH v2 1/1] fftw: add compile precision option
@ 2015-03-13 10:25 Gwenhael Goavec-Merou
2015-03-13 22:25 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Gwenhael Goavec-Merou @ 2015-03-13 10:25 UTC (permalink / raw)
To: buildroot
From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
fftw has options to select compile precision between single, long-double and
quad. These options are exclusives. This patch adds choice to select precision
option.
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
---
Changes v1 -> v2:
* FFTW_CONFIGURE_OPTS -> FFTW_CONF_OPTS
---
package/fftw/Config.in | 32 ++++++++++++++++++++++++++++++++
package/fftw/fftw.mk | 10 ++++++++++
2 files changed, 42 insertions(+)
diff --git a/package/fftw/Config.in b/package/fftw/Config.in
index 36f849f..f35179b 100644
--- a/package/fftw/Config.in
+++ b/package/fftw/Config.in
@@ -9,3 +9,35 @@ config BR2_PACKAGE_FFTW
double precision.
http://www.fftw.org
+
+if BR2_PACKAGE_FFTW
+
+choice
+ prompt "fftw precision"
+ default BR2_PACKAGE_FFTW_PRECISION_NONE
+ help
+ Selects fftw precision
+
+config BR2_PACKAGE_FFTW_PRECISION_NONE
+ bool "none"
+ help
+ no compile precision selected
+
+config BR2_PACKAGE_FFTW_PRECISION_SINGLE
+ bool "single precision"
+ help
+ compile fftw in single precision
+
+config BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE
+ bool "long double precision"
+ help
+ compile fftw in long-double precision
+
+config BR2_PACKAGE_FFTW_PRECISION_QUAD
+ bool "quad precision"
+ help
+ compile fftw in quadruple precision if available
+
+endchoice
+
+endif
diff --git a/package/fftw/fftw.mk b/package/fftw/fftw.mk
index 3b302df..68ddc35 100644
--- a/package/fftw/fftw.mk
+++ b/package/fftw/fftw.mk
@@ -10,4 +10,14 @@ FFTW_INSTALL_STAGING = YES
FFTW_LICENSE = GPLv2+
FFTW_LICENSE_FILES = COPYING
+ifeq ($(BR2_PACKAGE_FFTW_PRECISION_SINGLE),y)
+FFTW_CONF_OPTS += --enable-single
+endif
+ifeq ($(BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE),y)
+FFTW_CONF_OPTS += --enable-long-double
+endif
+ifeq ($(BR2_PACKAGE_FFTW_PRECISION_QUAD),y)
+FFTW_CONF_OPTS += --enable-quad-precision
+endif
+
$(eval $(autotools-package))
--
2.0.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH v2 1/1] fftw: add compile precision option
2015-03-13 10:25 [Buildroot] [PATCH v2 1/1] fftw: add compile precision option Gwenhael Goavec-Merou
@ 2015-03-13 22:25 ` Thomas Petazzoni
2015-03-14 7:39 ` gwenhael.goavec
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2015-03-13 22:25 UTC (permalink / raw)
To: buildroot
Dear Gwenhael Goavec-Merou,
On Fri, 13 Mar 2015 11:25:02 +0100, Gwenhael Goavec-Merou wrote:
> From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
>
> fftw has options to select compile precision between single, long-double and
> quad. These options are exclusives. This patch adds choice to select precision
> option.
Unfortunately, the quad precision support doesn't build, because not
all toolchains have libquadmath in gcc:
checking for sinq in -lquadmath... no
configure: error: quad precision requires libquadmath for quad-precision trigonometric routines
And the long double precision support also doesn't build:
checking for cosl... (cached) no
configure: error: long-double precision requires long-double trigonometric routines
This was generated by the following defconfig:
BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2014.11.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_17=y
BR2_TOOLCHAIN_EXTERNAL_LARGEFILE=y
BR2_TOOLCHAIN_EXTERNAL_INET_IPV6=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_FFTW=y
BR2_PACKAGE_FFTW_PRECISION_SINGLE=y
# BR2_TARGET_ROOTFS_TAR is not set
Also, I see that FFTW has some NEON, Altivec, MMX and SSE/SSE2
optimizations. Maybe it would make sense to enable them when the CPU
supports them. However, beware that many of those optimizations only
work in "single precision" mode.
Note: if your only need is "single precision" mode, then I wouldn't
mind receiving a patch that allows enabling only this mode. People
interested in long double and quad precision can enable such options
later.
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH v2 1/1] fftw: add compile precision option
2015-03-13 22:25 ` Thomas Petazzoni
@ 2015-03-14 7:39 ` gwenhael.goavec
0 siblings, 0 replies; 3+ messages in thread
From: gwenhael.goavec @ 2015-03-14 7:39 UTC (permalink / raw)
To: buildroot
Dear Thomas Petazzoni
On Fri, 13 Mar 2015 23:25:21 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> Dear Gwenhael Goavec-Merou,
>
> On Fri, 13 Mar 2015 11:25:02 +0100, Gwenhael Goavec-Merou wrote:
> > From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> >
> > fftw has options to select compile precision between single, long-double and
> > quad. These options are exclusives. This patch adds choice to select precision
> > option.
>
> Unfortunately, the quad precision support doesn't build, because not
> all toolchains have libquadmath in gcc:
>
> checking for sinq in -lquadmath... no
> configure: error: quad precision requires libquadmath for quad-precision trigonometric routines
>
> And the long double precision support also doesn't build:
>
> checking for cosl... (cached) no
> configure: error: long-double precision requires long-double trigonometric routines
>
> This was generated by the following defconfig:
>
It's true. libquadmath is only enabled on x86 and x86_64. I must add a depend
on BR2_i386 || BR2_x86_64.
[SNIP]
>
> Also, I see that FFTW has some NEON, Altivec, MMX and SSE/SSE2
> optimizations. Maybe it would make sense to enable them when the CPU
> supports them. However, beware that many of those optimizations only
> work in "single precision" mode.
>
Yes. I plan to add these optimizations but that's for a future patch.
[SNIP]
Regards
Gwen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-14 7:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 10:25 [Buildroot] [PATCH v2 1/1] fftw: add compile precision option Gwenhael Goavec-Merou
2015-03-13 22:25 ` Thomas Petazzoni
2015-03-14 7:39 ` gwenhael.goavec
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.