blob: cb45e2b91f36766756792528f9c0b2db26b9a8d4 [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
58 autotools_do_compile
59 done
60}
61
62do_install() {
63 for lib in fftw fftwl fftwf; do
64 cd ${WORKDIR}/build-$lib
65 autotools_do_install
66 done
67}
68
69do_install_ptest() {
70 for lib in fftw fftwl fftwf; do
71 install -d ${D}${PTEST_PATH}/$lib
72 install -m 0755 ${S}/tests/check.pl ${D}${PTEST_PATH}/$lib
73 cd ${WORKDIR}/build-$lib
74 if [ $lib = "fftw" ]; then
75 mv ${D}${bindir}/bench ${D}${PTEST_PATH}/$lib
76 fi
77 if [ $lib = "fftwl" ]; then
78 mv ${D}${bindir}/benchl ${D}${PTEST_PATH}/$lib
79 fi
80 if [ $lib = "fftwf" ]; then
81 mv ${D}${bindir}/benchf ${D}${PTEST_PATH}/$lib
82 fi
83 done
84}
85
86PACKAGES =+ "libfftw libfftwl libfftwf"
87FILES:libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*"
88FILES:libfftwl = "${libdir}/libfftw3l.so.* ${libdir}/libfftw3l_*.so.*"
89FILES:libfftwf = "${libdir}/libfftw3f.so.* ${libdir}/libfftw3f_*.so.*"
90
91PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf"
92FILES:fftw-wisdom = "${bindir}/fftw-wisdom"
93FILES:fftwl-wisdom = "${bindir}/fftwl-wisdom"
94FILES:fftwf-wisdom = "${bindir}/fftwf-wisdom"
95FILES:fftw-wisdom-to-conf = "${bindir}/fftw-wisdom-to-conf"
96
97FILES:${PN}-dev += "${libdir}/cmake"
98RDEPENDS:${PN}-dev = "libfftw libfftwl libfftwf"
99RDEPENDS:${PN}-ptest += "perl"
100RDEPENDS:${PN}-ptest:remove = "fftw"
101
102BBCLASSEXTEND = "native"