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

Last change on this file since 97642 was 97642, checked in by eborisch@…, 8 years ago

fftw-3: Enable mpich2-devel to satisfy dependency for +mpich2; Enable installing +gccNN+mpich2 for -single/-long sub-ports

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.8 KB
Line 
1# $Id: Portfile 97642 2012-09-10 15:59:20Z eborisch@macports.org $
2
3PortSystem      1.0
4PortGroup       muniversal 1.0
5
6name            fftw-3
7version         3.3.2
8categories      math
9license         GPL-2+
10platforms       darwin
11maintainers     ram openmaintainer
12homepage        http://www.fftw.org/
13distname        fftw-${version}
14
15master_sites \
16    ${homepage} \
17    ftp://ftp.fftw.org/pub/fftw/ \
18    ftp://ftp.kusastro.kyoto-u.ac.jp/pub/src/GNU/fftw/
19
20description \
21    Fast C routines to compute the Discrete Fourier Transform
22
23long_description \
24    FFTW is a C subroutine library for computing the \
25    Discrete Fourier Transform (DFT) in one or more \
26    dimensions, of both real and complex data, and of \
27    arbitrary input size. We believe that FFTW, which is \
28    free software, should become the FFT library of choice \
29    for most applications. Our benchmarks, performed on a \
30    variety of platforms, show that FFTW's performance is \
31    typically superior to that of other publicly available \
32    FFT software. Moreover, FFTW's performance is portable: \
33    the program will perform well on most architectures \
34    without modification. \
35    This port is of fftw version 3.x. It has many \
36    improvements relative to 2.x, but is not backwardly \
37    compatible.
38
39checksums \
40    rmd160 dbf87fcb7812024b80744335d433ade53bad8a4f \
41    sha256 b1236a780ca6e66fc5f8eda6ef0665d680e8253d9f01d7bf211b714a50032d01
42
43configure.args \
44    --enable-threads \
45    --disable-fortran \
46    --enable-shared
47
48configure.cflags-append \
49    -fno-common \
50    -O3 \
51    -fomit-frame-pointer \
52    -fstrict-aliasing
53
54array set merger_configure_args {
55    ppc    "--enable-fma"
56    ppc64  "--enable-fma"
57    i386   "--enable-sse2"
58    x86_64 "--enable-sse2"
59}
60
61test.run     yes
62test.target  check
63
64use_parallel_build yes
65
66platform i386 {
67  if {![variant_isset universal]} {
68    configure.args-append --enable-sse2
69  }
70}
71
72platform powerpc {
73  if {![variant_isset universal]} {
74    configure.args-append --enable-fma
75  }
76}
77
78subport fftw-3-single {
79    configure.args-append --enable-float
80
81    array set merger_configure_args {
82        ppc    "--enable-fma --enable-altivec"
83        ppc64  "--enable-fma --enable-altivec"
84        i386   "--enable-sse"
85        x86_64 "--enable-sse"
86    }
87
88    depends_lib port:fftw-3
89
90    platform i386 {
91        if {![variant_isset universal]} {
92            configure.args-delete --enable-sse2
93            configure.args-append --enable-sse
94        }
95    }
96
97    platform powerpc {
98        if {![variant_isset universal]} {
99            configure.args-append --enable-altivec
100        }
101    }
102
103    post-destroot {
104        file delete ${destroot}${prefix}/include/fftw3.f
105        file delete ${destroot}${prefix}/include/fftw3.f03
106        file delete ${destroot}${prefix}/include/fftw3l.f03
107        file delete ${destroot}${prefix}/include/fftw3q.f03
108        file delete ${destroot}${prefix}/include/fftw3.h
109        file delete ${destroot}${prefix}/bin/fftw-wisdom-to-conf
110        file delete ${destroot}${prefix}/share/man/man1/fftw-wisdom-to-conf.1
111        file delete ${destroot}${prefix}/share/info/fftw3.info
112        file delete ${destroot}${prefix}/share/info/fftw3.info-1
113        file delete ${destroot}${prefix}/share/info/fftw3.info-2
114        file delete ${destroot}${prefix}/share/info/fftw3.info-3
115        file delete ${destroot}${prefix}/share/info/fftw3.info-4
116        file delete ${destroot}${prefix}/share/info/fftw3.info-5
117
118        if {[variant_isset mpich2] || [variant_isset openmpi]} {
119          file delete ${destroot}${prefix}/include/fftw3-mpi.f03
120          file delete ${destroot}${prefix}/include/fftw3-mpi.h
121          file delete ${destroot}${prefix}/include/fftw3l-mpi.f03
122        }
123    }
124}
125
126subport fftw-3-long {
127    configure.args-append --enable-long-double
128
129     array set merger_configure_args {
130        ppc    ""
131        ppc64  ""
132        i386   ""
133        x86_64 ""
134    }
135
136    depends_lib port:fftw-3
137
138    platform i386 {
139        if {![variant_isset universal]} {
140            configure.args-delete --enable-sse2
141        }
142    }
143
144    platform powerpc {
145        if {![variant_isset universal]} {
146            configure.args-delete --enable-fma
147        }
148    }
149
150    post-destroot {
151        file delete ${destroot}${prefix}/include/fftw3.f
152        file delete ${destroot}${prefix}/include/fftw3.f03
153        file delete ${destroot}${prefix}/include/fftw3l.f03
154        file delete ${destroot}${prefix}/include/fftw3q.f03
155        file delete ${destroot}${prefix}/include/fftw3.h
156        file delete ${destroot}${prefix}/bin/fftw-wisdom-to-conf
157        file delete ${destroot}${prefix}/share/man/man1/fftw-wisdom-to-conf.1
158        file delete ${destroot}${prefix}/share/info/fftw3.info
159        file delete ${destroot}${prefix}/share/info/fftw3.info-1
160        file delete ${destroot}${prefix}/share/info/fftw3.info-2
161        file delete ${destroot}${prefix}/share/info/fftw3.info-3
162        file delete ${destroot}${prefix}/share/info/fftw3.info-4
163        file delete ${destroot}${prefix}/share/info/fftw3.info-5
164
165        if {[variant_isset mpich2] || [variant_isset openmpi]} {
166          file delete ${destroot}${prefix}/include/fftw3-mpi.f03
167          file delete ${destroot}${prefix}/include/fftw3-mpi.h
168          file delete ${destroot}${prefix}/include/fftw3l-mpi.f03
169        }
170    }
171}
172
173variant gcc42 description {compile using gcc42 toolchain} conflicts gcc43 gcc44 gcc45 gcc46 gcc47 g95 {
174    depends_lib-append    port:gcc42
175    depends_skip_archcheck gcc42
176    configure.compiler    macports-gcc-4.2
177    configure.args-delete --disable-fortran
178    if { ${os.arch} == "i386" } {
179        lappend merger_configure_args(ppc)     "--disable-fortran"
180        lappend merger_configure_args(ppc64)   "--disable-fortran"
181    } else {
182        lappend merger_configure_args(i386)    "--disable-fortran"
183        lappend merger_configure_args(x86_64)  "--disable-fortran"
184    }
185}
186
187variant gcc43 description {compile using gcc43 toolchain} conflicts gcc42 gcc44 gcc45 gcc46 gcc47 g95 {
188    depends_lib-append    port:gcc43
189    configure.compiler    macports-gcc-4.3
190    configure.args-delete --disable-fortran
191    if { ${os.arch} == "i386" } {
192        lappend merger_configure_args(ppc)     "--disable-fortran"
193        lappend merger_configure_args(ppc64)   "--disable-fortran"
194    } else {
195        lappend merger_configure_args(i386)    "--disable-fortran"
196        lappend merger_configure_args(x86_64)  "--disable-fortran"
197    }
198}
199
200variant gcc44 description {compile using gcc44 toolchain} conflicts gcc42 gcc43 gcc45 gcc46 gcc47 g95 {
201    depends_lib-append    port:gcc44
202    configure.compiler    macports-gcc-4.4
203    configure.args-delete --disable-fortran
204    if { ${os.arch} == "i386" } {
205        lappend merger_configure_args(ppc)     "--disable-fortran"
206        lappend merger_configure_args(ppc64)   "--disable-fortran"
207    } else {
208        lappend merger_configure_args(i386)    "--disable-fortran"
209        lappend merger_configure_args(x86_64)  "--disable-fortran"
210    }
211}
212
213variant gcc45 description {compile using gcc45 toolchain} conflicts gcc42 gcc43 gcc44 gcc46 gcc47 g95 {
214    depends_lib-append    port:gcc45
215    configure.compiler    macports-gcc-4.5
216    configure.args-delete --disable-fortran
217    if { ${os.arch} == "i386" } {
218        lappend merger_configure_args(ppc)     "--disable-fortran"
219        lappend merger_configure_args(ppc64)   "--disable-fortran"
220    } else {
221        lappend merger_configure_args(i386)    "--disable-fortran"
222        lappend merger_configure_args(x86_64)  "--disable-fortran"
223    }
224}
225
226variant gcc46 description {compile using gcc46 toolchain} conflicts gcc42 gcc43 gcc44 gcc45 gcc47 g95 {
227    depends_lib-append    port:gcc46
228    configure.compiler    macports-gcc-4.6
229    configure.args-delete --disable-fortran
230    if { ${os.arch} == "i386" } {
231        lappend merger_configure_args(ppc)     "--disable-fortran"
232        lappend merger_configure_args(ppc64)   "--disable-fortran"
233    } else {
234        lappend merger_configure_args(i386)    "--disable-fortran"
235        lappend merger_configure_args(x86_64)  "--disable-fortran"
236    }
237}
238
239variant gcc47 description {compile using gcc47 toolchain} conflicts gcc42 gcc43 gcc44 gcc45 gcc46 g95 {
240    depends_lib-append    port:gcc47
241    configure.compiler    macports-gcc-4.7
242    configure.args-delete --disable-fortran
243    if { ${os.arch} == "i386" } {
244        lappend merger_configure_args(ppc)     "--disable-fortran"
245        lappend merger_configure_args(ppc64)   "--disable-fortran"
246    } else {
247        lappend merger_configure_args(i386)    "--disable-fortran"
248        lappend merger_configure_args(x86_64)  "--disable-fortran"
249    }
250}
251
252variant g95 description {create Fortran wrappers using f95} conflicts gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 {
253    depends_lib-append    port:g95
254    depends_skip_archcheck g95
255    configure.f77          g95
256    configure.args-delete --disable-fortran
257    if { ${os.arch} == "i386" } {
258        lappend merger_configure_args(ppc)     "--disable-fortran"
259        lappend merger_configure_args(ppc64)   "--disable-fortran"
260        lappend merger_configure_args(x86_64)  "--disable-fortran"
261    } else {
262        lappend merger_configure_args(i386)    "--disable-fortran"
263        lappend merger_configure_args(ppc64)   "--disable-fortran"
264        lappend merger_configure_args(x86_64)  "--disable-fortran"
265    }
266}
267
268variant openmpi description {compile FFTW MPI library with OpenMPI} conflicts mpich2 {
269    depends_lib-append      port:openmpi
270    configure.env           MPICC=${prefix}/lib/openmpi/bin/mpicc
271    configure.args-append   --enable-mpi
272}
273
274variant mpich2 description {compile FFTW MPI library with MPICH2} conflicts openmpi {
275    depends_lib-append      path:bin/mpicc:mpich2
276    configure.env           MPICC=${prefix}/bin/mpicc
277    configure.args-append   --enable-mpi
278}
279
280if {${name} == ${subport}} {
281    livecheck.type  regex
282    livecheck.url   ${homepage}
283    livecheck.regex {FFTW (\d+(?:\.\d+)*) is the latest}
284} else {
285    livecheck.type  none
286}
Note: See TracBrowser for help on using the repository browser.