blob: 38bf3a19c662c11260115703c7ca4b69f2291f22 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001DESCRIPTION = "FFTW"
2SECTION = "libs"
3LICENSE = "GPLv2"
4LIC_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 \
Andrew Geissler32b11992021-03-31 13:37:05 -05009 file://install-bench.patch \
10 file://run-ptest \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011"
Andrew Geissler69721092021-07-23 12:57:00 -040012SRC_URI[sha256sum] = "bf2c7ce40b04ae811af714deb512510cc2c17b9ab9d6ddcf49fe4487eea7af3d"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080013
Andrew Geissler32b11992021-03-31 13:37:05 -050014inherit autotools pkgconfig ptest
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015
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
Patrick Williams213cb262021-08-07 19:21:33 -050026FFTW_NEON:aarch64 = "--enable-neon"
27FFTW_NEON:class-native = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028
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
Andrew Geissler32b11992021-03-31 13:37:05 -050069do_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}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080085
86PACKAGES =+ "libfftw libfftwl libfftwf"
Patrick Williams213cb262021-08-07 19:21:33 -050087FILES:libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*"
88FILES:libfftwl = "${libdir}/libfftw3l.so.* ${libdir}/libfftw3l_*.so.*"
89FILES:libfftwf = "${libdir}/libfftw3f.so.* ${libdir}/libfftw3f_*.so.*"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080090
91PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf"
Patrick Williams213cb262021-08-07 19:21:33 -050092FILES: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"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080096
Patrick Williams213cb262021-08-07 19:21:33 -050097FILES:${PN}-dev += "${libdir}/cmake"
98RDEPENDS:${PN}-dev = "libfftw libfftwl libfftwf"
99RDEPENDS:${PN}-ptest += "perl"
100RDEPENDS:${PN}-ptest:remove = "fftw"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800101
102BBCLASSEXTEND = "native"