# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id: Portfile 154163 2016-10-23 08:48:25Z jeremyhu@macports.org $ PortSystem 1.0 PortGroup muniversal 1.0 PortGroup compiler_blacklist_versions 1.0 PortGroup mpi 1.0 name fftw-3 version 3.3.5 categories math license GPL-2+ platforms darwin maintainers sean homepage http://www.fftw.org/ distname fftw-${version} master_sites \ ${homepage} \ ftp://ftp.fftw.org/pub/fftw/ \ ftp://ftp.kusastro.kyoto-u.ac.jp/pub/src/GNU/fftw/ 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. \ This port is of fftw version 3.x. It has many \ improvements relative to 2.x, but is not backwardly \ compatible. checksums rmd160 d5800f3d56b7b499265633b52a0b9850b17c148e \ sha256 8ecfe1b04732ec3f5b7d279fdb8efcad536d555f9d1e8fabd027037d45ea8bcf # Don't link with "-flat_namespace -undefined suppress" on Yosemite and # later (#45707). patchfiles \ yosemite-libtool.patch variant pfft_patches description {Apply patches recommended for use as dependency of pfft port} { if {![mpi_variant_isset]} { ui_warn "Variant +pfft_patches has no effect without setting an MPI variant." } # Cut from scripts at https://www-user.tu-chemnitz.de/~potts/workgroup/pippig/software.php.en#fftwinstall, # except that the last hunk of mpi/transpose-pairwise.c has been incorporated into 3.3.5 already. #Important: Within these scripts we apply the following patches that have been submitted to FFTW but are not yet included in FFTW-3.3.4: # We add two more global transposition algorithms to the planner. # We patch file mpi/transpose-pairwise.c in order to fix a double free bug. patchfiles-append patch-pfft.diff # mpi/Makefile.am is modified, and effects are complicated to emulate with a patch to mpi/Makefile.in use_autoreconf yes } # don't change configure.cc, etc. since we'll take care of that manually with # MPICC env var mpi.setup # blacklist older versions of clang which do not handle the --enable-avx option (#41622, #41673) compiler.blacklist-append {clang <= 211.10.1} gcc-4.2 configure.args \ --enable-threads \ --disable-fortran \ --enable-shared configure.cflags-append \ -fno-common \ -O3 \ -fomit-frame-pointer \ -fstrict-aliasing pre-configure { if { [avx_compiler_isset] == 1 } { array set merger_configure_args { ppc "--enable-fma" ppc64 "--enable-fma" i386 "--enable-sse2 --enable-avx" x86_64 "--enable-sse2 --enable-avx" } } else { array set merger_configure_args { ppc "--enable-fma" ppc64 "--enable-fma" i386 "--enable-sse2" x86_64 "--enable-sse2" } } } test.run yes test.target check use_parallel_build yes platform darwin { if {${os.major} < 10} { configure.args-append --with-our-malloc } } platform powerpc { if {![variant_isset universal]} { configure.args-append --enable-fma } } subport fftw-3-single { configure.args-append --enable-float depends_lib port:fftw-3 platform powerpc { if {![variant_isset universal]} { configure.args-append --enable-altivec } } pre-configure { if { [avx_compiler_isset] == 1 } { array set merger_configure_args { ppc "--enable-fma --enable-altivec" ppc64 "--enable-fma --enable-altivec" i386 "--enable-sse --enable-avx" x86_64 "--enable-sse --enable-avx" } } else { array set merger_configure_args { ppc "--enable-fma --enable-altivec" ppc64 "--enable-fma --enable-altivec" i386 "--enable-sse" x86_64 "--enable-sse" } } platform i386 { if {![variant_isset universal]} { configure.args-delete --enable-sse2 configure.args-append --enable-sse if { [avx_compiler_isset] == 1 } { configure.args-append --enable-avx } } } } post-destroot { file delete ${destroot}${prefix}/include/fftw3.f file delete ${destroot}${prefix}/include/fftw3.f03 file delete ${destroot}${prefix}/include/fftw3l.f03 file delete ${destroot}${prefix}/include/fftw3q.f03 file delete ${destroot}${prefix}/include/fftw3.h file delete ${destroot}${prefix}/bin/fftw-wisdom-to-conf file delete ${destroot}${prefix}/share/man/man1/fftw-wisdom-to-conf.1 file delete ${destroot}${prefix}/share/info/fftw3.info file delete ${destroot}${prefix}/share/info/fftw3.info-1 file delete ${destroot}${prefix}/share/info/fftw3.info-2 file delete ${destroot}${prefix}/share/info/fftw3.info-3 file delete ${destroot}${prefix}/share/info/fftw3.info-4 file delete ${destroot}${prefix}/share/info/fftw3.info-5 if {[mpi_variant_isset]} { file delete ${destroot}${prefix}/include/fftw3-mpi.f03 file delete ${destroot}${prefix}/include/fftw3-mpi.h file delete ${destroot}${prefix}/include/fftw3l-mpi.f03 } } } subport fftw-3-long { configure.args-append --enable-long-double depends_lib port:fftw-3 pre-configure { array set merger_configure_args { ppc "" ppc64 "" i386 "" x86_64 "" } } post-destroot { file delete ${destroot}${prefix}/include/fftw3.f file delete ${destroot}${prefix}/include/fftw3.f03 file delete ${destroot}${prefix}/include/fftw3l.f03 file delete ${destroot}${prefix}/include/fftw3q.f03 file delete ${destroot}${prefix}/include/fftw3.h file delete ${destroot}${prefix}/bin/fftw-wisdom-to-conf file delete ${destroot}${prefix}/share/man/man1/fftw-wisdom-to-conf.1 file delete ${destroot}${prefix}/share/info/fftw3.info file delete ${destroot}${prefix}/share/info/fftw3.info-1 file delete ${destroot}${prefix}/share/info/fftw3.info-2 file delete ${destroot}${prefix}/share/info/fftw3.info-3 file delete ${destroot}${prefix}/share/info/fftw3.info-4 file delete ${destroot}${prefix}/share/info/fftw3.info-5 if {[mpi_variant_isset]} { file delete ${destroot}${prefix}/include/fftw3-mpi.f03 file delete ${destroot}${prefix}/include/fftw3-mpi.h file delete ${destroot}${prefix}/include/fftw3l-mpi.f03 } } } if {${os.arch} eq "i386"} { lappend merger_configure_args(ppc) "--disable-fortran" lappend merger_configure_args(ppc64) "--disable-fortran" } else { lappend merger_configure_args(i386) "--disable-fortran" lappend merger_configure_args(x86_64) "--disable-fortran" } if {[fortran_variant_isset]} { configure.args-delete --disable-fortran } pre-configure { if {[mpi_variant_isset]} { # MPIRUN is needed for test phase configure.env MPICC=${mpi.cc} MPIRUN=${mpi.exec} configure.args-append --enable-mpi } } if {${name} eq ${subport}} { livecheck.type regex livecheck.url ${homepage} livecheck.regex {FFTW (\d+(?:\.\d+)*) is the latest} } else { livecheck.type none }