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 | " |
| 12 | SRC_URI[md5sum] = "8aac833c943d8e90d51b697b27d4384d" |
| 13 | SRC_URI[sha256sum] = "6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303" |
| 14 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame^] | 15 | inherit autotools pkgconfig ptest |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 16 | |
| 17 | # we had multiple recipes in the past |
| 18 | PROVIDES = "fftwl fftwf" |
| 19 | |
| 20 | EXTRA_OECONF = "--disable-fortran --enable-shared --enable-threads" |
| 21 | |
| 22 | CFLAGS += "-D_GNU_SOURCE" |
| 23 | |
| 24 | # neon is optional for arm version < 8 -> check tune features |
| 25 | FFTW_NEON = "${@bb.utils.contains('TUNE_FEATURES', 'neon', '--enable-neon', '', d)}" |
| 26 | # neon is suppored for arm version = 8 -> enable |
| 27 | FFTW_NEON_aarch64 = "--enable-neon" |
| 28 | FFTW_NEON_class-native = "" |
| 29 | |
| 30 | do_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 | |
| 56 | do_compile() { |
| 57 | for lib in fftw fftwl fftwf; do |
| 58 | cd ${WORKDIR}/build-$lib |
| 59 | autotools_do_compile |
| 60 | done |
| 61 | } |
| 62 | |
| 63 | do_install() { |
| 64 | for lib in fftw fftwl fftwf; do |
| 65 | cd ${WORKDIR}/build-$lib |
| 66 | autotools_do_install |
| 67 | done |
| 68 | } |
| 69 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame^] | 70 | do_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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 86 | |
| 87 | PACKAGES =+ "libfftw libfftwl libfftwf" |
| 88 | FILES_libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*" |
| 89 | FILES_libfftwl = "${libdir}/libfftw3l.so.* ${libdir}/libfftw3l_*.so.*" |
| 90 | FILES_libfftwf = "${libdir}/libfftw3f.so.* ${libdir}/libfftw3f_*.so.*" |
| 91 | |
| 92 | PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf" |
| 93 | FILES_fftw-wisdom = "${bindir}/fftw-wisdom" |
| 94 | FILES_fftwl-wisdom = "${bindir}/fftwl-wisdom" |
| 95 | FILES_fftwf-wisdom = "${bindir}/fftwf-wisdom" |
| 96 | FILES_fftw-wisdom-to-conf = "${bindir}/fftw-wisdom-to-conf" |
| 97 | |
| 98 | FILES_${PN}-dev += "${libdir}/cmake" |
| 99 | RDEPENDS_${PN}-dev = "libfftw libfftwl libfftwf" |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame^] | 100 | RDEPENDS_${PN}-ptest += "perl" |
| 101 | RDEPENDS_${PN}-ptest_remove = "fftw" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 102 | |
| 103 | BBCLASSEXTEND = "native" |