blob: de175d629f659dfd7bbede37c94e251ec921b3f4 [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"
12SRC_URI[md5sum] = "8aac833c943d8e90d51b697b27d4384d"
13SRC_URI[sha256sum] = "6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303"
14
Andrew Geissler32b11992021-03-31 13:37:05 -050015inherit autotools pkgconfig ptest
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080016
17# we had multiple recipes in the past
18PROVIDES = "fftwl fftwf"
19
20EXTRA_OECONF = "--disable-fortran --enable-shared --enable-threads"
21
22CFLAGS += "-D_GNU_SOURCE"
23
24# neon is optional for arm version < 8 -> check tune features
25FFTW_NEON = "${@bb.utils.contains('TUNE_FEATURES', 'neon', '--enable-neon', '', d)}"
26# neon is suppored for arm version = 8 -> enable
27FFTW_NEON_aarch64 = "--enable-neon"
28FFTW_NEON_class-native = ""
29
30do_configure() {
31 # configure fftw
32 rm -rf ${WORKDIR}/build-fftw
33 mkdir -p ${B}
34 cd ${B}
35 # full (re)configure
36 autotools_do_configure
37 mv ${B} ${WORKDIR}/build-fftw
38
39 # configure fftwl
40 rm -rf ${WORKDIR}/build-fftwl
41 mkdir -p ${B}
42 cd ${B}
43 # configure only
44 oe_runconf --enable-long-double
45 mv ${B} ${WORKDIR}/build-fftwl
46
47 # configure fftwf
48 rm -rf ${WORKDIR}/build-fftwf
49 mkdir -p ${B}
50 cd ${B}
51 # configure only
52 oe_runconf --enable-single ${FFTW_NEON}
53 mv ${B} ${WORKDIR}/build-fftwf
54}
55
56do_compile() {
57 for lib in fftw fftwl fftwf; do
58 cd ${WORKDIR}/build-$lib
59 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
Andrew Geissler32b11992021-03-31 13:37:05 -050070do_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}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080086
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"
Andrew Geissler32b11992021-03-31 13:37:05 -0500100RDEPENDS_${PN}-ptest += "perl"
101RDEPENDS_${PN}-ptest_remove = "fftw"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800102
103BBCLASSEXTEND = "native"