#! /bin/bash # fftw # Source: ftp://ftp.fftw.org/pub/fftw/fftw-3.3.10.tar.gz # # $BUILD = Directory to temporarily install # $PKGS = Directory to store built packages # # DEPS # Required: NONE # Recommended: NONE # Optional: NONE # If optimizing with GCC export CFLAGS="-march=native -pipe " export CFLAGS+="-O3 -ffat-lto-objects -flto=4 " export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed " case $(uname -m) in x86_64) export ECONF="--enable-sse2 --enable-avx" ;; arm* | aarch64) export ECONF="--enable-neon" ;; esac && patch -Np1 -i ../patches/fftw-alpine/cycle.h.patch && autoreconf -fvi && mkdir build-double && cd build-double && ../configure --prefix=/usr \ --enable-shared \ --enable-threads ${ECONF} $BUILDTRUPLE && read -p "Compile?" && make -j2 && cd .. && mkdir build-long-double && cd build-long-double && ../configure --prefix=/usr \ --enable-shared \ --enable-threads \ --enable-long-double $BUILDTRUPLE && read -p "Compile?" && make -j2 && cd .. && mkdir build-single && cd build-single && ../configure --prefix=/usr \ --enable-shared \ --enable-threads \ --enable-float ${ECONF} $BUILDTRUPLE && read -p "Compile?" && make -j2 && cd .. && for f in double long-double single; do cd build-${f} sudo -S make DESTDIR=$BUILD install cd .. done && sudo -S mkdir -pv /BMAN/install sudo -S mkdir -pv /BMAN/usr sudo -S mv $BUILD/usr/share /BMAN/usr/ cd $BUILD && sudo -S mkdir -v ${BUILD}/install && cat > /tmp/slack-desc << "EOF" # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| fftw: fftw (Fastest Fourier Transform in the West) fftw: fftw: FFTW is a free collection of fast C routines for computing the fftw: Discrete Fourier Transform in one or more dimensions. It includes fftw: complex, real, symmetric, and parallel transforms, and can handle fftw: arbitrary array sizes efficiently. FFTW is typically faster than fftw: other publicly-available FFT implementations, and is even fftw: competitive with vendor-tuned libraries. fftw: fftw: Homepage: http://www.fftw.org/ fftw: EOF sudo -S mv -v /tmp/slack-desc install/ && sudo -S makepkg -l y -c n $PKGS/fftw-3.3.10-$(uname -m)-mlfs.txz && cd /BMAN cat > /tmp/slack-desc << "EOF" fftw-doc: Manuals for fftw (Fastest Fourier Transform in the West) fftw-doc: fftw-doc: A free collection of fast C routines for computing the Discrete fftw-doc: Fourier Transform in one or more dimensions. fftw-doc: fftw-doc: http://www.fftw.org/ fftw-doc: EOF sudo -S mv -v /tmp/slack-desc install/ && sudo -S makepkg -l y -c n $PKGS/fftw-doc-3.3.10-noarch-mlfs.txz sudo -S rm -rf /BMAN/* sudo -S rm -rf ${BUILD}/*