source: trunk/dports/math/fftw-3/Portfile @ 149135

Last change on this file since 149135 was 143301, checked in by dstrubbe@…, 4 years ago

fftw-3: Ticket #49373, with maintainer approval. Add new variant with patches that are recommended for use as a dependency for pfft, a new port I added. Also, add configure arg to allow test phase to work with mpi variant.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.8 KB
Line 
1# -*- 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
2# $Id: Portfile 143301 2015-12-09 23:58:28Z dstrubbe@macports.org $
3
4PortSystem      1.0
5PortGroup       muniversal 1.0
6PortGroup       compiler_blacklist_versions 1.0
7PortGroup       mpi 1.0
8
9name            fftw-3
10version         3.3.4
11revision        1
12categories      math
13license         GPL-2+
14platforms       darwin
15maintainers     sean
16homepage        http://www.fftw.org/
17distname        fftw-${version}
18
19master_sites \
20    ${homepage} \
21    ftp://ftp.fftw.org/pub/fftw/ \
22    ftp://ftp.kusastro.kyoto-u.ac.jp/pub/src/GNU/fftw/
23
24description \
25    Fast C routines to compute the Discrete Fourier Transform
26
27long_description \
28    FFTW is a C subroutine library for computing the \
29    Discrete Fourier Transform (DFT) in one or more \
30    dimensions, of both real and complex data, and of \
31    arbitrary input size. We believe that FFTW, which is \
32    free software, should become the FFT library of choice \
33    for most applications. Our benchmarks, performed on a \
34    variety of platforms, show that FFTW's performance is \
35    typically superior to that of other publicly available \
36    FFT software. Moreover, FFTW's performance is portable: \
37    the program will perform well on most architectures \
38    without modification. \
39    This port is of fftw version 3.x. It has many \
40    improvements relative to 2.x, but is not backwardly \
41    compatible.
42
43checksums \
44    rmd160  463b5120d42ec2a3bc1385689176c5e0296d0d4a \
45    sha256  8f0cde90929bc05587c3368d2f15cd0530a60b8a9912a8e2979a72dbe5af0982
46
47# Don't link with "-flat_namespace -undefined suppress" on Yosemite and
48# later (#45707).
49patchfiles \
50    yosemite-libtool.patch \
51    leopard-no-memalign.patch
52
53variant pfft_patches description {Apply patches recommended for use as dependency of pfft port} {
54    if {![mpi_variant_isset]} {
55        ui_warn "Variant +pfft_patches has no effect without setting an MPI variant."
56    }
57
58    # Cut from scripts at https://www-user.tu-chemnitz.de/~potts/workgroup/pippig/software.php.en#fftwinstall,
59    #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:
60    #  We add two more global transposition algorithms to the planner.
61    #  We patch file mpi/transpose-pairwise.c in order to fix a double free bug.
62    patchfiles-append patch-pfft.diff
63
64    # mpi/Makefile.am is modified, and effects are complicated to emulate with a patch to mpi/Makefile.in
65    use_autoreconf yes
66}
67
68# don't change configure.cc, etc. since we'll take care of that manually with
69# MPICC env var
70mpi.setup
71
72# blacklist older versions of clang which do not handle the --enable-avx option (#41622, #41673)
73compiler.blacklist-append {clang <= 211.10.1}
74
75configure.args \
76    --enable-threads \
77    --disable-fortran \
78    --enable-shared
79
80configure.cflags-append \
81    -fno-common \
82    -O3 \
83    -fomit-frame-pointer \
84    -fstrict-aliasing
85
86pre-configure {
87    if { [avx_compiler_isset] == 1 } {
88        array set merger_configure_args {
89            ppc    "--enable-fma"
90            ppc64  "--enable-fma"
91            i386   "--enable-sse2 --enable-avx"
92            x86_64 "--enable-sse2 --enable-avx"
93        }
94    } else {
95        array set merger_configure_args {
96            ppc    "--enable-fma"
97            ppc64  "--enable-fma"
98            i386   "--enable-sse2"
99            x86_64 "--enable-sse2"
100        }
101    }
102}
103
104test.run     yes
105test.target  check
106
107use_parallel_build yes
108
109platform powerpc {
110  if {![variant_isset universal]} {
111    configure.args-append --enable-fma
112  }
113}
114
115subport fftw-3-single {
116    configure.args-append --enable-float
117
118    depends_lib port:fftw-3
119
120    platform powerpc {
121        if {![variant_isset universal]} {
122            configure.args-append --enable-altivec
123        }
124    }
125
126    pre-configure {
127        if { [avx_compiler_isset] == 1 } {
128            array set merger_configure_args {
129                ppc    "--enable-fma --enable-altivec"
130                ppc64  "--enable-fma --enable-altivec"
131                i386   "--enable-sse --enable-avx"
132                x86_64 "--enable-sse --enable-avx"
133            }
134        } else {
135            array set merger_configure_args {
136                ppc    "--enable-fma --enable-altivec"
137                ppc64  "--enable-fma --enable-altivec"
138                i386   "--enable-sse"
139                x86_64 "--enable-sse"
140            }
141        }
142
143        platform i386 {
144            if {![variant_isset universal]} {
145                configure.args-delete --enable-sse2
146                configure.args-append --enable-sse
147                if { [avx_compiler_isset] == 1 } {
148                    configure.args-append --enable-avx
149                }
150            }
151        }
152    }
153
154    post-destroot {
155        file delete ${destroot}${prefix}/include/fftw3.f
156        file delete ${destroot}${prefix}/include/fftw3.f03
157        file delete ${destroot}${prefix}/include/fftw3l.f03
158        file delete ${destroot}${prefix}/include/fftw3q.f03
159        file delete ${destroot}${prefix}/include/fftw3.h
160        file delete ${destroot}${prefix}/bin/fftw-wisdom-to-conf
161        file delete ${destroot}${prefix}/share/man/man1/fftw-wisdom-to-conf.1
162        file delete ${destroot}${prefix}/share/info/fftw3.info
163        file delete ${destroot}${prefix}/share/info/fftw3.info-1
164        file delete ${destroot}${prefix}/share/info/fftw3.info-2
165        file delete ${destroot}${prefix}/share/info/fftw3.info-3
166        file delete ${destroot}${prefix}/share/info/fftw3.info-4
167        file delete ${destroot}${prefix}/share/info/fftw3.info-5
168
169        if {[mpi_variant_isset]} {
170          file delete ${destroot}${prefix}/include/fftw3-mpi.f03
171          file delete ${destroot}${prefix}/include/fftw3-mpi.h
172          file delete ${destroot}${prefix}/include/fftw3l-mpi.f03
173        }
174    }
175}
176
177subport fftw-3-long {
178    configure.args-append --enable-long-double
179
180    depends_lib port:fftw-3
181
182    pre-configure {
183        array set merger_configure_args {
184            ppc    ""
185            ppc64  ""
186            i386   ""
187            x86_64 ""
188        }
189    }
190
191    post-destroot {
192        file delete ${destroot}${prefix}/include/fftw3.f
193        file delete ${destroot}${prefix}/include/fftw3.f03
194        file delete ${destroot}${prefix}/include/fftw3l.f03
195        file delete ${destroot}${prefix}/include/fftw3q.f03
196        file delete ${destroot}${prefix}/include/fftw3.h
197        file delete ${destroot}${prefix}/bin/fftw-wisdom-to-conf
198        file delete ${destroot}${prefix}/share/man/man1/fftw-wisdom-to-conf.1
199        file delete ${destroot}${prefix}/share/info/fftw3.info
200        file delete ${destroot}${prefix}/share/info/fftw3.info-1
201        file delete ${destroot}${prefix}/share/info/fftw3.info-2
202        file delete ${destroot}${prefix}/share/info/fftw3.info-3
203        file delete ${destroot}${prefix}/share/info/fftw3.info-4
204        file delete ${destroot}${prefix}/share/info/fftw3.info-5
205
206        if {[mpi_variant_isset]} {
207          file delete ${destroot}${prefix}/include/fftw3-mpi.f03
208          file delete ${destroot}${prefix}/include/fftw3-mpi.h
209          file delete ${destroot}${prefix}/include/fftw3l-mpi.f03
210        }
211    }
212}
213
214if {${os.arch} eq "i386"} {
215    lappend merger_configure_args(ppc)     "--disable-fortran"
216    lappend merger_configure_args(ppc64)   "--disable-fortran"
217} else {
218    lappend merger_configure_args(i386)    "--disable-fortran"
219    lappend merger_configure_args(x86_64)  "--disable-fortran"
220}
221
222if {[fortran_variant_isset]} {
223    configure.args-delete --disable-fortran
224}
225
226pre-configure {
227    if {[mpi_variant_isset]} {
228        # MPIRUN is needed for test phase
229        configure.env           MPICC=${mpi.cc} MPIRUN=${mpi.exec}
230        configure.args-append   --enable-mpi
231    }
232}
233
234if {${name} == ${subport}} {
235    livecheck.type  regex
236    livecheck.url   ${homepage}
237    livecheck.regex {FFTW (\d+(?:\.\d+)*) is the latest}
238} else {
239    livecheck.type  none
240}
Note: See TracBrowser for help on using the repository browser.