# $Id: Portfile 80533 2011-07-14 10:08:21Z jmr@macports.org $

PortSystem 1.0

name		fftw
version		2.1.5
revision	3
categories	math devel
license		GPL-2+
maintainers	nomaintainer
description	Fast C routines to compute the Discrete Fourier Transform
long_description \
	FFTW is a C subroutine library for computing the Discrete Fourier \
	Transform (DFT) in one or more dimensions, of both real and complex \
	data, and of arbitrary input size. We believe that FFTW, which is \
	free software, should become the FFT library of choice for most \
	applications. Our benchmarks, performed on a variety of platforms, \
	show that FFTW's performance is typically superior to that of other \
	publicly available FFT software. Moreover, FFTW's performance is \
	portable: the program will perform well on most architectures \
	without modification.

platforms	darwin

homepage	http://www.fftw.org/
master_sites	${homepage} \
		ftp://ftp.fftw.org/pub/fftw/ \
		ftp://ftp.kusastro.kyoto-u.ac.jp/pub/src/GNU/fftw/

checksums	md5 8d16a84f3ca02a785ef9eb36249ba433 \
		sha1 12020b58edc1b0490a83db4aa912fac5dfdfb26b \
		rmd160 723308722d76c12710db6473979adf8d086b0909
configure.args	--enable-type-prefix --enable-threads \
		--disable-fortran --infodir=${prefix}/share/info \
		--enable-shared

variant fortran requires g95 description {obsolete synonym for g95} {}

variant g95 conflicts gcc42 gcc43 gcc44 gcc45 description {include fortran-callable wrappers built with g95} {
	depends_lib-append	port:g95
	configure.f77		${prefix}/bin/g95
}

variant gcc42 conflicts g95 gcc43 gcc44 gcc45 description {include fortran-callable wrappers built with gcc 4.2} {
	depends_lib-append	port:gcc42
	configure.compiler  macports-gcc-4.2
}

variant gcc43 conflicts g95 gcc42 gcc44 gcc45 description {include fortran-callable wrappers built with gcc 4.3} {
	depends_lib-append	port:gcc43
	configure.compiler  macports-gcc-4.3
}

variant gcc44 conflicts g95 gcc42 gcc43 gcc45 description {include fortran-callable wrappers built with gcc 4.4} {
	depends_lib-append	port:gcc44
	configure.compiler  macports-gcc-4.4
}

variant gcc45 conflicts g95 gcc42 gcc43 gcc44 description {include fortran-callable wrappers built with gcc 4.5} {
	depends_lib-append	port:gcc45
	configure.compiler  macports-gcc-4.5
}

if {[variant_isset g95] || [variant_isset gcc42] || [variant_isset gcc43] || [variant_isset gcc44] || [variant_isset gcc45]} {
    configure.args-delete	--disable-fortran
    configure.args-append	--enable-fortran
    if {![variant_isset g95]} {
        configure.args-append --with-gcc
    }
    platform darwin {
        patchfiles-append	patch-configure_darwin
    }
    post-destroot {
        xinstall -m 644 ${worksrcpath}/fortran/fftw_f77.i ${destroot}${prefix}/include
    }
}

variant mpi description {Include FFTW MPI library} {
    depends_lib-append port:mpich2
    configure.args-append --enable-mpi
}
