diff options
author | Nocifer | 2022-02-05 01:32:17 +0200 |
---|---|---|
committer | Nocifer | 2022-02-05 01:32:17 +0200 |
commit | 8039a46d94fb6c1efff6fddcf3891ba411330b96 (patch) | |
tree | ba153b8e0cb1d156ae051e5f88a0e635ec47c853 /PKGBUILD | |
parent | 0fc92d31c96d806414f4ad9d6c559d15c5c96f4c (diff) | |
download | aur-8039a46d94fb6c1efff6fddcf3891ba411330b96.tar.gz |
v=3.3.10,r=2
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 173 |
1 files changed, 107 insertions, 66 deletions
@@ -1,93 +1,134 @@ -# Maintainer: Adam <adam900710@gmail.com> +# Maintainer (lib32): Nocifer <apmichalopoulos at gmail dot com> +# Maintainer: David Runge <dvzrv@archlinux.org> +# Contributor: Ronald van Haren <ronald.archlinux.org> +# Contributor: David Runge <dvzrv@archlinux.org> +# Contributor: damir <damir@archlinux.org> +# Contributor: Adam <adam900710@gmail.com> # Contributor: GordonGR <ntheo1979@gmail.com> # Contributor: josephgbr <rafael.f.f1@gmail.com> _pkgname=fftw -pkgname=lib32-${_pkgname} +pkgname=lib32-$_pkgname pkgver=3.3.10 -pkgrel=1 -pkgdesc="A library for computing the discrete Fourier transform (DFT) (32 bit)" +pkgrel=2 +pkgdesc='A library for computing the discrete Fourier transform (DFT) (32 bit)' arch=('x86_64') +url='https://www.fftw.org' license=('GPL2') -url="https://www.fftw.org/" -depends=('lib32-glibc' "${_pkgname}") -makedepends=('gcc-fortran') +depends=("$_pkgname" 'lib32-gcc-libs' 'openmpi') +makedepends=('cmake' 'gcc-fortran') provides=('libfftw3q_threads.so' 'libfftw3q_omp.so' 'libfftw3q.so' - 'libfftw3l_threads.so' 'libfftw3l_omp.so' 'libfftw3l.so' - 'libfftw3f_threads.so' 'libfftw3f_omp.so' 'libfftw3f.so' - 'libfftw3_threads.so' 'libfftw3_omp.so' 'libfftw3.so') -source=("https://www.fftw.org/${_pkgname}-${pkgver}.tar.gz") + 'libfftw3l_threads.so' 'libfftw3l_omp.so' 'libfftw3l_mpi.so' 'libfftw3l.so' + 'libfftw3f_threads.so' 'libfftw3f_omp.so' 'libfftw3f_mpi.so' 'libfftw3f.so' + 'libfftw3_threads.so' 'libfftw3_omp.so' 'libfftw3_mpi.so' 'libfftw3.so') +source=("https://www.fftw.org/$_pkgname-$pkgver.tar.gz") sha256sums=('56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467') +_build_types=(single double long-double quad) prepare() { - cp -av ${_pkgname}-${pkgver} ${_pkgname}-${pkgver}-double - cp -av ${_pkgname}-${pkgver} ${_pkgname}-${pkgver}-long-double - cp -av ${_pkgname}-${pkgver} ${_pkgname}-${pkgver}-quad -} - -build() { - cd ${srcdir} + local _i - export CC='gcc -m32' - export CXX='g++ -m32' - export PKG_CONFIG_PATH='/usr/lib32/pkgconfig' + # fix wrong soname in FFTW3LibraryDepends.cmake + sed -e 's/3.6.9/3.6.10/' -i $_pkgname-$pkgver/CMakeLists.txt - # Use upstream default CFLAGS while keeping our -march/-mtune - CFLAGS+=" -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math" - - CONFIGURE="./configure F77=gfortran \ - --prefix=/usr \ - --enable-shared - --enable-threads \ - --enable-openmp \ - --libdir=/usr/lib32" + mv -v $_pkgname-$pkgver $_pkgname-$pkgver-single + for _i in {1..3}; do + cp -av $_pkgname-$pkgver-single $_pkgname-$pkgver-"${_build_types[$_i]}" + done +} - # Configure single precision - ( - cd "${_pkgname}-${pkgver}" - $CONFIGURE --enable-sse --enable-avx --enable-single - # NOTE: Fix overlinking - sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool - ) +build() { + local _name + local _configure=( + ./configure + --prefix=/usr + --enable-shared + --enable-threads + --enable-openmp + --enable-mpi + --libdir=/usr/lib32 + ) + local _configure_single=( + --enable-sse + --enable-avx + --enable-single + ) + local _configure_double=( + --enable-sse2 + --enable-avx + ) + local _configure_long_double=( + --enable-long-double + ) + local _configure_quad=( + --disable-mpi + --enable-quad-precision + ) + local _cmake_options=( + -B build + -S $_pkgname-$pkgver-$_build_types + -D CMAKE_INSTALL_PREFIX=/usr + -D CMAKE_BUILD_TYPE=None + -D ENABLE_OPENMP=ON + -D ENABLE_THREADS=ON + -D ENABLE_FLOAT=ON + -D ENABLE_LONG_DOUBLE=ON + -D ENABLE_QUAD_PRECISION=ON + -D ENABLE_SSE=ON + -D ENABLE_SSE2=ON + -D ENABLE_AVX=ON + -D ENABLE_AVX2=ON + -D CMAKE_CXX_FLAGS='-m32' + -D CMAKE_INSTALL_LIBDIR=lib32 + ) - # Configure double precision - ( - cd "${_pkgname}-${pkgver}-double" - $CONFIGURE --enable-sse2 --enable-avx - # NOTE: Fix overlinking - sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool - ) + # create missing FFTW3LibraryDepends.cmake + # https://bugs.archlinux.org/task/67604 + cmake "${_cmake_options[@]}" + # fix broken IMPORTED_LOCATION: https://github.com/FFTW/fftw3/issues/130#issuecomment-1030280157 + sed -e 's|\(IMPORTED_LOCATION_NONE\).*|\1 "/usr/lib32/libfftw3.so.3"|' -i build/FFTW3LibraryDepends.cmake - # Configure long-double precision - ( - cd "${_pkgname}-${pkgver}-long-double" - $CONFIGURE --enable-long-double - # NOTE: Fix overlinking - sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool - ) + export F77='gfortran' + # use upstream default CFLAGS while keeping our -march/-mtune + CFLAGS+=" -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math" - # Configure quad precision + for _name in "${_build_types[@]}"; do ( - cd "${_pkgname}-${pkgver}-quad" - $CONFIGURE --disable-mpi --enable-quad-precision - # NOTE: Fix overlinking - sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + cd $_pkgname-$pkgver-$_name + case $_name in + single) + "${_configure[@]}" "${_configure_single[@]}" + ;; + double) + "${_configure[@]}" "${_configure_double[@]}" + ;; + long-double) + "${_configure[@]}" "${_configure_long_double[@]}" + ;; + quad) + "${_configure[@]}" "${_configure_quad[@]}" + ;; + esac + # fix overlinking because of libtool + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool ) + done - make -C "${_pkgname}-${pkgver}" - make -C "${_pkgname}-${pkgver}-double" - make -C "${_pkgname}-${pkgver}-long-double" - make -C "${_pkgname}-${pkgver}-quad" + for _name in "${_build_types[@]}"; do + make -C $_pkgname-$pkgver-$_name + done } package() { - cd ${srcdir} + local _name - make DESTDIR="${pkgdir}" install -C "${_pkgname}-${pkgver}" - make DESTDIR="${pkgdir}" install -C "${_pkgname}-${pkgver}-double" - make DESTDIR="${pkgdir}" install -C "${_pkgname}-${pkgver}-long-double" - make DESTDIR="${pkgdir}" install -C "${_pkgname}-${pkgver}-quad" + for _name in "${_build_types[@]}"; do + make DESTDIR="$pkgdir" install -C $_pkgname-$pkgver-$_name + done + #install -vDm 644 $_pkgname-$pkgver-$_build_types/{AUTHORS,ChangeLog,NEWS,README,TODO} -t "$pkgdir/usr/share/doc/$_pkgname" + # install missing FFTW3LibraryDepends.cmake + install -vDm 644 build/FFTW3LibraryDepends.cmake -t "$pkgdir/usr/lib32/cmake/fftw3/" - rm -rf "${pkgdir}/usr"/{bin,include,share} + rm -rf "${pkgdir}/usr"/{bin,include,share} } |