blob: 33e8279880bb8ba7e2d38c0b145659967b58668c [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001DESCRIPTION = "FFTW"
2SECTION = "libs"
Andrew Geissler9aee5002022-03-30 16:27:02 +00003LICENSE = "GPL-2.0-only"
Andrew Geissler595f6302022-01-24 19:11:47 +00004LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
5
6SRC_URI = " \
7 http://www.fftw.org/fftw-${PV}.tar.gz \
8 file://0001-NEON-autodetection-segfaults-assume-neon-present.patch \
9 file://install-bench.patch \
10 file://run-ptest \
11"
12SRC_URI[sha256sum] = "56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467"
13
14inherit autotools pkgconfig ptest
15
16# we had multiple recipes in the past
17PROVIDES = "fftwl fftwf"
18
19EXTRA_OECONF = "--disable-fortran --enable-shared --enable-threads"
20
21CFLAGS += "-D_GNU_SOURCE"
22
23# neon is optional for arm version < 8 -> check tune features
24FFTW_NEON = "${@bb.utils.contains('TUNE_FEATURES', 'neon', '--enable-neon', '', d)}"
25# neon is suppored for arm version = 8 -> enable
26FFTW_NEON:aarch64 = "--enable-neon"
27FFTW_NEON:class-native = ""
28
29do_configure() {
30 # configure fftw
31 rm -rf ${WORKDIR}/build-fftw
32 mkdir -p ${B}
33 cd ${B}
34 # full (re)configure
35 autotools_do_configure
36 mv ${B} ${WORKDIR}/build-fftw
37
38 # configure fftwl
39 rm -rf ${WORKDIR}/build-fftwl
40 mkdir -p ${B}
41 cd ${B}
42 # configure only
43 oe_runconf --enable-long-double
44 mv ${B} ${WORKDIR}/build-fftwl
45
46 # configure fftwf
47 rm -rf ${WORKDIR}/build-fftwf
48 mkdir -p ${B}
49 cd ${B}
50 # configure only
51 oe_runconf --enable-single ${FFTW_NEON}
52 mv ${B} ${WORKDIR}/build-fftwf
53}
54
55do_compile() {
56 for lib in fftw fftwl fftwf; do
57 cd ${WORKDIR}/build-$lib
Patrick Williamse760df82023-05-26 11:10:49 -050058 test -n "${TOOLCHAIN_OPTIONS}" && sed -i -e 's|${TOOLCHAIN_OPTIONS}||g' config.h
Andrew Geissler595f6302022-01-24 19:11:47 +000059 autotools_do_compile
60 done
61}
62
63do_install() {
64 for lib in fftw fftwl fftwf; do
65 cd ${WORKDIR}/build-$lib
66 autotools_do_install
67 done
68}
69
70do_install_ptest() {
71 for lib in fftw fftwl fftwf; do
72 install -d ${D}${PTEST_PATH}/$lib
73 install -m 0755 ${S}/tests/check.pl ${D}${PTEST_PATH}/$lib
74 cd ${WORKDIR}/build-$lib
75 if [ $lib = "fftw" ]; then
76 mv ${D}${bindir}/bench ${D}${PTEST_PATH}/$lib
77 fi
78 if [ $lib = "fftwl" ]; then
79 mv ${D}${bindir}/benchl ${D}${PTEST_PATH}/$lib
80 fi
81 if [ $lib = "fftwf" ]; then
82 mv ${D}${bindir}/benchf ${D}${PTEST_PATH}/$lib
83 fi
84 done
85}
86
87PACKAGES =+ "libfftw libfftwl libfftwf"
88FILES:libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*"
89FILES:libfftwl = "${libdir}/libfftw3l.so.* ${libdir}/libfftw3l_*.so.*"
90FILES:libfftwf = "${libdir}/libfftw3f.so.* ${libdir}/libfftw3f_*.so.*"
91
92PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf"
93FILES:fftw-wisdom = "${bindir}/fftw-wisdom"
94FILES:fftwl-wisdom = "${bindir}/fftwl-wisdom"
95FILES:fftwf-wisdom = "${bindir}/fftwf-wisdom"
96FILES:fftw-wisdom-to-conf = "${bindir}/fftw-wisdom-to-conf"
97
98FILES:${PN}-dev += "${libdir}/cmake"
99RDEPENDS:${PN}-dev = "libfftw libfftwl libfftwf"
100RDEPENDS:${PN}-ptest += "perl"
101RDEPENDS:${PN}-ptest:remove = "fftw"
102
103BBCLASSEXTEND = "native"