Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | DESCRIPTION = "FFTW" |
| 2 | SECTION = "libs" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 3 | LICENSE = "GPL-2.0-only" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 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 \ |
| 9 | file://install-bench.patch \ |
| 10 | file://run-ptest \ |
| 11 | " |
| 12 | SRC_URI[sha256sum] = "56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467" |
| 13 | |
| 14 | inherit autotools pkgconfig ptest |
| 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 |
| 26 | FFTW_NEON:aarch64 = "--enable-neon" |
| 27 | FFTW_NEON:class-native = "" |
| 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 | |
| 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 | } |
| 85 | |
| 86 | PACKAGES =+ "libfftw libfftwl libfftwf" |
| 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.*" |
| 90 | |
| 91 | PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf" |
| 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" |
| 96 | |
| 97 | FILES:${PN}-dev += "${libdir}/cmake" |
| 98 | RDEPENDS:${PN}-dev = "libfftw libfftwl libfftwf" |
| 99 | RDEPENDS:${PN}-ptest += "perl" |
| 100 | RDEPENDS:${PN}-ptest:remove = "fftw" |
| 101 | |
| 102 | BBCLASSEXTEND = "native" |