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 42151 2008-11-16 05:33:48Z takeshi@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name fftw-3 |
---|
7 | version 3.2 |
---|
8 | categories math |
---|
9 | platforms darwin |
---|
10 | maintainers takeshi@macports.org |
---|
11 | homepage http://www.fftw.org/ |
---|
12 | distname fftw-${version} |
---|
13 | |
---|
14 | master_sites \ |
---|
15 | ${homepage} \ |
---|
16 | ftp://ftp.fftw.org/pub/fftw/ \ |
---|
17 | ftp://ftp.kusastro.kyoto-u.ac.jp/pub/src/GNU/fftw/ |
---|
18 | |
---|
19 | description \ |
---|
20 | Fast C routines to compute the Discrete Fourier Transform |
---|
21 | |
---|
22 | long_description \ |
---|
23 | FFTW is a C subroutine library for computing the \ |
---|
24 | Discrete Fourier Transform (DFT) in one or more \ |
---|
25 | dimensions, of both real and complex data, and of \ |
---|
26 | arbitrary input size. We believe that FFTW, which is \ |
---|
27 | free software, should become the FFT library of choice \ |
---|
28 | for most applications. Our benchmarks, performed on a \ |
---|
29 | variety of platforms, show that FFTW's performance is \ |
---|
30 | typically superior to that of other publicly available \ |
---|
31 | FFT software. Moreover, FFTW's performance is portable: \ |
---|
32 | the program will perform well on most architectures \ |
---|
33 | without modification. \ |
---|
34 | This port is of fftw version 3.x. It has many \ |
---|
35 | improvements relative to 2.x, but is not backwardly \ |
---|
36 | compatible. |
---|
37 | |
---|
38 | checksums md5 280960ddbad368ebb96c073a2b642f5d \ |
---|
39 | sha1 7ec19356191ffa3719294a5373f27b75c04c301b \ |
---|
40 | rmd160 26f686e793f0fafedefa352b38058e76c9ca698c |
---|
41 | |
---|
42 | configure.args \ |
---|
43 | --enable-threads \ |
---|
44 | --enable-fma \ |
---|
45 | --disable-fortran \ |
---|
46 | --enable-shared |
---|
47 | |
---|
48 | configure.cflags-append -fno-common |
---|
49 | |
---|
50 | test.run yes |
---|
51 | test.target check |
---|
52 | |
---|
53 | universal_variant yes |
---|
54 | use_parallel_build yes |
---|
55 | |
---|
56 | variant gcc42 description {create Fortran wrappers using gcc42} conflicts gcc43 g95 { |
---|
57 | depends_lib-append port:gcc42 |
---|
58 | configure.f77 gfortran-mp-4.2 |
---|
59 | configure.args-delete --disable-fortran |
---|
60 | } |
---|
61 | |
---|
62 | variant gcc43 description {create Fortran wrappers using gcc43} conflicts gcc42 g95 { |
---|
63 | depends_lib-append port:gcc43 |
---|
64 | configure.f77 gfortran-mp-4.3 |
---|
65 | configure.args-delete --disable-fortran |
---|
66 | } |
---|
67 | |
---|
68 | variant g95 description {create Fortran wrappers using f95} conflicts gcc42 gcc43 { |
---|
69 | depends_lib-append port:g95 |
---|
70 | configure.f77 g95 |
---|
71 | configure.args-delete --disable-fortran |
---|
72 | } |
---|
73 | |
---|
74 | if {![info exists universal_archs]} { |
---|
75 | set universal_archs {i386 x86_64} |
---|
76 | } |
---|
77 | set first_arch [lindex ${universal_archs} 0] |
---|
78 | |
---|
79 | set my_worksrcpaths ${worksrcpath} |
---|
80 | |
---|
81 | variant universal { |
---|
82 | set my_worksrcpaths {} |
---|
83 | foreach arch ${universal_archs} { |
---|
84 | lappend my_worksrcpaths ${workpath}/${arch} |
---|
85 | } |
---|
86 | |
---|
87 | post-patch { |
---|
88 | foreach arch ${universal_archs} { |
---|
89 | if {[string equal ${arch} ${first_arch}]} { |
---|
90 | move ${worksrcpath} ${workpath}/${first_arch} |
---|
91 | } else { |
---|
92 | copy ${workpath}/${first_arch} ${workpath}/${arch} |
---|
93 | } |
---|
94 | } |
---|
95 | } |
---|
96 | |
---|
97 | configure { |
---|
98 | foreach arch ${universal_archs} { |
---|
99 | set my_arch_flag "-arch ${arch}" |
---|
100 | set my_cflags "${configure.cflags} -isysroot ${sysroot} ${my_arch_flag}" |
---|
101 | set my_ldflags "${configure.ldflags} ${my_arch_flag}" |
---|
102 | system "cd ${workpath}/${arch} && CFLAGS=\"${my_cflags}\" CXXFLAGS=\"${my_cflags}\" LDFLAGS=\"${my_ldflags}\" ${configure.cmd} ${configure.pre_args} ${configure.args}" |
---|
103 | } |
---|
104 | } |
---|
105 | |
---|
106 | build { |
---|
107 | foreach arch ${universal_archs} { |
---|
108 | system "cd ${workpath}/${arch} && ${build.cmd} ${build.pre_args}" |
---|
109 | } |
---|
110 | } |
---|
111 | |
---|
112 | destroot { |
---|
113 | system "cd ${workpath}/${first_arch} && ${destroot.cmd} ${destroot.pre_args} ${destroot.post_args}" |
---|
114 | foreach lib {libfftw3.3.dylib libfftw3.a} { |
---|
115 | set output_lib ${destroot}${prefix}/lib/${lib} |
---|
116 | set lipo_args {} |
---|
117 | foreach arch ${universal_archs} { |
---|
118 | lappend lipo_args -arch ${arch} ${workpath}/${arch}/.libs/${lib} |
---|
119 | } |
---|
120 | lappend lipo_args -create -output ${output_lib} |
---|
121 | delete ${output_lib} |
---|
122 | system "lipo ${lipo_args}" |
---|
123 | } |
---|
124 | |
---|
125 | foreach lib {libfftw3_threads.3.dylib libfftw3_threads.a} { |
---|
126 | set output_lib ${destroot}${prefix}/lib/${lib} |
---|
127 | set lipo_args {} |
---|
128 | foreach arch ${universal_archs} { |
---|
129 | lappend lipo_args -arch ${arch} ${workpath}/${arch}/threads/.libs/${lib} |
---|
130 | } |
---|
131 | lappend lipo_args -create -output ${output_lib} |
---|
132 | delete ${output_lib} |
---|
133 | system "lipo ${lipo_args}" |
---|
134 | } |
---|
135 | } |
---|
136 | } |
---|
137 | |
---|
138 | livecheck.check regex |
---|
139 | livecheck.url ${homepage} |
---|
140 | livecheck.regex {FFTW (\d+(?:\.\d+)*) is the latest} |
---|