contrib/fftw/Pkgfile
2021-09-19 20:30:00 +10:00

68 lines
1.3 KiB
Plaintext

# Description: C subroutine library for computing discrete Fourier transform.
# URL: https://www.fftw.org/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: gcc-fortran
name=fftw
version=3.3.10
release=1
source=(https://www.fftw.org/$name-$version.tar.gz)
build() {
cd $name-$version
# libtool fails to link with ccache in the path
[ -e '/usr/bin/ccache' ] && PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
local config="
F77=gfortran
--prefix=/usr
--enable-threads
--enable-shared
--enable-openmp"
# use upstream default CFLAGS while keeping our -march/-mtune
CFLAGS+=" -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -fno-schedule-insns -ffast-math -fPIC -mavx2"
# compiling single precision library
./configure \
$config \
--enable-single \
--enable-sse \
--enable-avx
make
make DESTDIR=$PKG install
make clean
# compiling double precision library
./configure \
$config \
--enable-sse2 \
--enable-avx
make
make DESTDIR=$PKG install
make clean
# compiling long double precision library
./configure \
$config \
--enable-long-double
make
make DESTDIR=$PKG install
make clean
# compiling quad precision library
./configure \
$config \
--enable-quad-precision
make
make DESTDIR=$PKG install
# clean up
rm -r $PKG/usr/share/info
}