Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | DESCRIPTION = "FFTW" |
| 2 | SECTION = "libs" |
| 3 | LICENSE = "GPLv2" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" |
| 5 | |
| 6 | SRC_URI = " \ |
| 7 | http://www.fftw.org/fftw-${PV}.tar.gz \ |
| 8 | file://0001-NEON-autodetection-segfaults-assume-neon-present.patch \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 9 | file://install-bench.patch \ |
| 10 | file://run-ptest \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 11 | " |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 12 | SRC_URI[sha256sum] = "bf2c7ce40b04ae811af714deb512510cc2c17b9ab9d6ddcf49fe4487eea7af3d" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 13 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 14 | inherit autotools pkgconfig ptest |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 15 | |
| 16 | # we had multiple recipes in the past |
| 17 | PROVIDES = "fftwl fftwf" |
| 18 | |
| 19 | EXTRA_OECONF = "--disable-fortran --enable-shared --enable-threads" |
| 20 | |
| 21 | CFLAGS += "-D_GNU_SOURCE" |
| 22 | |
| 23 | # neon is optional for arm version < 8 -> check tune features |
| 24 | FFTW_NEON = "${@bb.utils.contains('TUNE_FEATURES', 'neon', '--enable-neon', '', d)}" |
| 25 | # neon is suppored for arm version = 8 -> enable |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 26 | FFTW_NEON:aarch64 = "--enable-neon" |
| 27 | FFTW_NEON:class-native = "" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 28 | |
| 29 | do_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 | |
| 55 | do_compile() { |
| 56 | for lib in fftw fftwl fftwf; do |
| 57 | cd ${WORKDIR}/build-$lib |
| 58 | autotools_do_compile |
| 59 | done |
| 60 | } |
| 61 | |
| 62 | do_install() { |
| 63 | for lib in fftw fftwl fftwf; do |
| 64 | cd ${WORKDIR}/build-$lib |
| 65 | autotools_do_install |
| 66 | done |
| 67 | } |
| 68 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 69 | do_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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 85 | |
| 86 | PACKAGES =+ "libfftw libfftwl libfftwf" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 87 | FILES:libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*" |
| 88 | FILES:libfftwl = "${libdir}/libfftw3l.so.* ${libdir}/libfftw3l_*.so.*" |
| 89 | FILES:libfftwf = "${libdir}/libfftw3f.so.* ${libdir}/libfftw3f_*.so.*" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 90 | |
| 91 | PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 92 | FILES:fftw-wisdom = "${bindir}/fftw-wisdom" |
| 93 | FILES:fftwl-wisdom = "${bindir}/fftwl-wisdom" |
| 94 | FILES:fftwf-wisdom = "${bindir}/fftwf-wisdom" |
| 95 | FILES:fftw-wisdom-to-conf = "${bindir}/fftw-wisdom-to-conf" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 96 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 97 | FILES:${PN}-dev += "${libdir}/cmake" |
| 98 | RDEPENDS:${PN}-dev = "libfftw libfftwl libfftwf" |
| 99 | RDEPENDS:${PN}-ptest += "perl" |
| 100 | RDEPENDS:${PN}-ptest:remove = "fftw" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 101 | |
| 102 | BBCLASSEXTEND = "native" |