contrib/fftw/Pkgfile

73 lines
1.8 KiB
Plaintext
Raw Normal View History

# Description: C subroutine library for computing discrete Fourier transform.
# URL: http://www.fftw.org/
# Maintainer: Danny Rawlins, romster at shortcircuit dot net dot au
# Packager: acrux, acrux at linuxmail dot org
# Depends on:
# Optional: gcc-fortran
name=fftw
version=3.1.2
release=3
source=(http://www.fftw.org/fftw-$version.tar.gz)
build() {
cd fftw-$version
# use -mtune to be processor-specific optimisations without
# -march as this will give the best speed but wont be portable.
export CFLAGS="-O3 $(echo $CFLAGS |sed -e 's/-O[s0-3] //')"
export CXXFLAGS="-O3 $(echo $CXXFLAGS |sed -e 's/-O[s0-3] //')"
export FFLAGS="-O3 $(echo $FFLAGS |sed -e 's/-O[s0-3] //')"
local config='
--prefix=/usr
--mandir=/usr/man
--enable-threads
--enable-type-prefix
--with-gnu-ld
--disable-nls'
# processor-specific optimisations that only worked if
# not using shared librarys
if [ -z $FFTW_SHARED ]; then
if grep '^flags' /proc/cpuinfo |grep sse2 > /dev/null; then
config="$config --enable-sse2" # intel
elif grep '^flags' /proc/cpuinfo |grep sse > /dev/null; then
config="$config --enable-sse" # intel
elif grep '^flags' /proc/cpuinfo |grep 3dnow > /dev/null; then
config="$config --enable-k7" # althon
elif grep '^flags' /proc/cpuinfo |grep altivec > /dev/null; then
config="$config --enable-altivec" # ppc
fi
else
config="$config --enable-shared"
fi
# compiling long double precision library
./configure \
$config \
--enable-long-double
make
make DESTDIR=$PKG install
make clean
# compiling single precision library
./configure \
$config \
--enable-single
make
make DESTDIR=$PKG install
make clean
# compiling double precision library
./configure \
$config
make
make DESTDIR=$PKG install
rm -r $PKG/usr/share
}