1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: Portfile 137965 2015-06-23 20:25:22Z larryv@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup compiler_blacklist_versions 1.0 |
---|
6 | PortGroup select 1.0 |
---|
7 | |
---|
8 | name openmpi |
---|
9 | version 1.8.6 |
---|
10 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
11 | categories science parallel net |
---|
12 | platforms darwin |
---|
13 | license BSD |
---|
14 | maintainers sean openmaintainer |
---|
15 | description A High Performance Message Passing Library |
---|
16 | long_description Open MPI is a project combining technologies and resources \ |
---|
17 | from several other projects (FT-MPI, LA-MPI, LAM/MPI, and \ |
---|
18 | PACX-MPI) in order to build the best MPI library available. A \ |
---|
19 | completely new MPI-2 compliant implementation, Open MPI offers \ |
---|
20 | advantages for system and software vendors, application developers \ |
---|
21 | and computer science researchers. |
---|
22 | |
---|
23 | # Since mpi is just a compiler wrapper, compiling it as universal needs to be |
---|
24 | # supported upstream since it'd be a constantly moving target, for reference |
---|
25 | # see, https://trac.macports.org/ticket/20240 |
---|
26 | universal_variant no |
---|
27 | |
---|
28 | homepage http://www.open-mpi.org/ |
---|
29 | set subdir ompi/v${branch}/downloads/ |
---|
30 | master_sites http://www.open-mpi.org/software/${subdir} \ |
---|
31 | http://www.open-mpi.de/software/${subdir} \ |
---|
32 | http://icl.cs.utk.edu/open-mpi/${subdir} |
---|
33 | # keep md5 & sha1 checksums as they are published on http://www.open-mpi.org/software/ompi/v1.8/ |
---|
34 | checksums md5 eb569e7dc97eeaa5b1876cccf114f377 \ |
---|
35 | sha1 781330b24e6656143ae3252f088a04b91411554b \ |
---|
36 | rmd160 41025c5b44be7c8a8b1fe1afe653faff9be52d38 \ |
---|
37 | sha256 b9fe3bdfb86bd42cc53448e17f11278531b989b05ff9513bc88ba1a523f14e87 |
---|
38 | use_bzip2 yes |
---|
39 | |
---|
40 | livecheck.type regex |
---|
41 | livecheck.url http://www.open-mpi.org/software/ompi/v1.8/ |
---|
42 | livecheck.regex openmpi-(\[0-9\.\]+).tar.bz2 |
---|
43 | |
---|
44 | if {[string first "-devel" $subport] > 0} { |
---|
45 | name openmpi-devel |
---|
46 | version 1.9a1 |
---|
47 | # openmpi switched to git and reset their revision number; |
---|
48 | # remove this when for next release |
---|
49 | set base 32546 |
---|
50 | set tag ga5cfbdd |
---|
51 | set newrev 1932 |
---|
52 | revision [expr {$base + $newrev + 2}] |
---|
53 | distname openmpi-dev-${newrev}-${tag} |
---|
54 | |
---|
55 | master_sites http://www.open-mpi.org/nightly/master \ |
---|
56 | http://www.open-mpi.de/nightly/master |
---|
57 | |
---|
58 | checksums md5 ef25c4dbc928f31dd665b91da291ca82 \ |
---|
59 | sha1 cfb670dd0c636d24429559a82842fe5e6b5267fc \ |
---|
60 | rmd160 d87f67284f1e2d4b4589498406207c9625fc2a58 \ |
---|
61 | sha256 9d23275fab424cb78b996208ecc7a1fbd4861c8e48f36452d3a5f2bce2b1e4d7 |
---|
62 | |
---|
63 | livecheck.version ${newrev}-${tag} |
---|
64 | livecheck.url [lindex ${master_sites} 0] |
---|
65 | livecheck.regex <strong>dev-(\[0-9\]+-g\[0-9a-f\]+) |
---|
66 | } |
---|
67 | |
---|
68 | # As OpenMPI creates compiler wrappers, there are lots of |
---|
69 | # variants for what compiler the user would like to wrap. |
---|
70 | |
---|
71 | # Sup-ports names and corresponding configure.compiler value |
---|
72 | array set clist { |
---|
73 | clang {clang} |
---|
74 | clang33 {macports-clang-3.3} |
---|
75 | clang34 {macports-clang-3.4} |
---|
76 | clang35 {macports-clang-3.5} |
---|
77 | clang36 {macports-clang-3.6} |
---|
78 | clang37 {macports-clang-3.7} |
---|
79 | gcc43 {macports-gcc-4.3} |
---|
80 | gcc44 {macports-gcc-4.4} |
---|
81 | gcc45 {macports-gcc-4.5} |
---|
82 | gcc46 {macports-gcc-4.6} |
---|
83 | gcc47 {macports-gcc-4.7} |
---|
84 | gcc48 {macports-gcc-4.8} |
---|
85 | gcc49 {macports-gcc-4.9} |
---|
86 | gcc5 {macports-gcc-5} |
---|
87 | gcc6 {macports-gcc-6} |
---|
88 | llvm {llvm-gcc-4.2} |
---|
89 | dragonegg33 {macports-dragonegg-3.3} |
---|
90 | dragonegg34 {macports-dragonegg-3.4} |
---|
91 | } |
---|
92 | |
---|
93 | foreach key [array name clist] { |
---|
94 | subport ${name}-${key} {} |
---|
95 | subport ${name}-devel-${key} {} |
---|
96 | } |
---|
97 | subport ${name}-default {} |
---|
98 | subport ${name}-devel {} |
---|
99 | subport ${name}-devel-default {} |
---|
100 | |
---|
101 | pre-extract { file mkdir ${workpath}/build } |
---|
102 | |
---|
103 | # https://trac.macports.org/ticket/39089 |
---|
104 | compiler.blacklist gcc-4.0 |
---|
105 | compiler.blacklist-append llvm-gcc-4.2 macports-llvm-gcc-4.2 |
---|
106 | |
---|
107 | configure.dir ${workpath}/build |
---|
108 | configure.cmd ${worksrcpath}/configure |
---|
109 | configure.args --enable-mpi-fortran \ |
---|
110 | "FFLAGS='' F77=''" \ |
---|
111 | --with-wrapper-ldflags="-Wl,-flat_namespace" \ |
---|
112 | LIBS="-Wl,-flat_namespace" |
---|
113 | |
---|
114 | # remove -arch from ldflags, ticket #22833 |
---|
115 | configure.ld_archflags |
---|
116 | configure.ccache no |
---|
117 | |
---|
118 | # We're making compiler wrappers here... don't default to -O2 for wrappers. |
---|
119 | # Actual library code is compiled with -O2 via --enable-fast=O2 configure arg |
---|
120 | configure.optflags-delete -O2 -Os |
---|
121 | configure.cppflags-delete -I${prefix}/include |
---|
122 | configure.ldflags-delete -L${prefix}/lib |
---|
123 | |
---|
124 | build.dir ${configure.dir} |
---|
125 | destroot.dir ${build.dir} |
---|
126 | |
---|
127 | if {${subport} != ${name}} { |
---|
128 | set cname [lindex [split ${subport} -] end] |
---|
129 | if {${cname} == "default"} { |
---|
130 | set cname mp |
---|
131 | } |
---|
132 | |
---|
133 | # Force buildbot to skip this since openmpi depends on hwloc and that would |
---|
134 | # be different for a user's machine |
---|
135 | archive_sites |
---|
136 | |
---|
137 | conflicts-append lammpi |
---|
138 | depends_lib-append port:hwloc |
---|
139 | depends_run port:mpi_select port:mpi-doc |
---|
140 | select.group mpi |
---|
141 | select.file ${filespath}/${name}-${cname} |
---|
142 | livecheck.type none |
---|
143 | |
---|
144 | if {[string first "-default" $subport] < 0} { |
---|
145 | configure.compiler [lindex $clist($cname) 0] |
---|
146 | append long_description "\\n\\nTHIS SUBPORT WRAPS ${cname}'s C/C++" |
---|
147 | } else { |
---|
148 | append long_description \ |
---|
149 | "\\n\\nTHIS SUBPORT WRAPS MACPORTS' DEFAULT COMPILER FOR C/C++" |
---|
150 | } |
---|
151 | |
---|
152 | configure.args-append \ |
---|
153 | --bindir=${prefix}/libexec/${name}-${cname} \ |
---|
154 | --libdir=${prefix}/lib/${name}-${cname} \ |
---|
155 | --sysconfdir=${prefix}/etc/${name}-${cname} \ |
---|
156 | --includedir=${prefix}/include/${name}-${cname} \ |
---|
157 | --datadir=${prefix}/share/${name}-${cname} \ |
---|
158 | --docdir=${prefix}/share/docdelete \ |
---|
159 | --mandir=${prefix}/share/mandelete \ |
---|
160 | --with-hwloc=${prefix} |
---|
161 | |
---|
162 | post-destroot { |
---|
163 | if {[string first "-devel" $subport] > 0} { |
---|
164 | # Supply our own -devel manpages (might be materially different / new) |
---|
165 | file mkdir ${destroot}${prefix}/share/doc |
---|
166 | file mkdir ${destroot}${prefix}/share/docdelete |
---|
167 | move ${destroot}${prefix}/share/mandelete \ |
---|
168 | ${destroot}${prefix}/share/docdelete/man |
---|
169 | move ${destroot}${prefix}/share/docdelete \ |
---|
170 | ${destroot}${prefix}/share/doc/${name}-${cname} |
---|
171 | system -W ${destroot}${prefix}/share/doc/${name}-${cname}/man \ |
---|
172 | "/usr/bin/find . -type f -print0 | /usr/bin/xargs -0 -P ${build.jobs} /usr/bin/gzip -v" |
---|
173 | } else { |
---|
174 | # This version doesn't supply manpages |
---|
175 | if {[file isdirectory ${destroot}${prefix}/share/mandelete]} { |
---|
176 | delete ${destroot}${prefix}/share/mandelete |
---|
177 | } |
---|
178 | if {[file isdirectory ${destroot}${prefix}/share/docdelete]} { |
---|
179 | delete ${destroot}${prefix}/share/docdelete |
---|
180 | } |
---|
181 | } |
---|
182 | |
---|
183 | set vampirlog ${destroot}${prefix}/share/${name}-${cname}/vampirtrace/config.log |
---|
184 | if { [ file exists $vampirlog ] } { |
---|
185 | delete $vampirlog |
---|
186 | } |
---|
187 | |
---|
188 | foreach bin {mpirun mpiexec mpicc mpicxx mpif77 mpif90 mpifort} { |
---|
189 | system -W ${destroot}${prefix}/share/$name-$cname/openmpi \ |
---|
190 | "ln -sf $bin-wrapper-data.txt $bin-$name-$cname-wrapper-data.txt" |
---|
191 | system -W ${destroot}${prefix}/bin \ |
---|
192 | "ln -sf ${prefix}/libexec/$name-$cname/$bin $bin-$name-$cname" |
---|
193 | } |
---|
194 | } |
---|
195 | |
---|
196 | if { [string first gcc $cname] == 0 } { |
---|
197 | configure.args-delete --disable-mpi-fortran |
---|
198 | configure.args-append --enable-mpi-fortran |
---|
199 | select.file ${filespath}/${name}-${cname}-fortran |
---|
200 | variant fortran description { |
---|
201 | Stub : fortran always enabled for gcc-based version |
---|
202 | } {} |
---|
203 | default_variants-append +fortran |
---|
204 | } elseif { [string first dragon $cname] == 0 } { |
---|
205 | configure.args-delete --disable-mpi-fortran |
---|
206 | configure.args-append --enable-mpi-fortran |
---|
207 | select.file ${filespath}/${name}-${cname}-fortran |
---|
208 | variant fortran description { |
---|
209 | Stub : fortran always enabled for dragonegg-based version |
---|
210 | } {} |
---|
211 | default_variants-append +fortran |
---|
212 | } else { |
---|
213 | set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.1} |
---|
214 | set default_fortran_variant +gcc5 |
---|
215 | set g95_conflicts {} |
---|
216 | |
---|
217 | foreach ver ${gcc_versions} { |
---|
218 | set ver_no_dot [join [split ${ver} "."] ""] |
---|
219 | |
---|
220 | set variant_line {variant gcc${ver_no_dot} description \ |
---|
221 | "build with gfortran from gcc${ver_no_dot}" conflicts g95} |
---|
222 | |
---|
223 | foreach over ${gcc_versions} { |
---|
224 | if {${ver} == ${over}} { |
---|
225 | continue |
---|
226 | } |
---|
227 | |
---|
228 | set over_no_dot [join [split ${over} "."] ""] |
---|
229 | append variant_line " conflicts gcc${over_no_dot}" |
---|
230 | } |
---|
231 | append variant_line { {}} |
---|
232 | |
---|
233 | eval $variant_line |
---|
234 | |
---|
235 | append g95_conflicts " conflicts gcc${ver_no_dot}" |
---|
236 | |
---|
237 | if {[variant_isset gcc${ver_no_dot}]} { |
---|
238 | if {${default_fortran_variant} != "+gcc${ver_no_dot}"} { |
---|
239 | set default_fortran_variant "" |
---|
240 | } |
---|
241 | } |
---|
242 | } |
---|
243 | |
---|
244 | eval [concat {variant g95 description {build with g95}} \ |
---|
245 | $g95_conflicts {{}}] |
---|
246 | |
---|
247 | if {[variant_isset g95]} { |
---|
248 | if {${default_fortran_variant} != "+g95"} { |
---|
249 | set default_fortran_variant "" |
---|
250 | } |
---|
251 | } |
---|
252 | |
---|
253 | if {${default_fortran_variant} != ""} { |
---|
254 | default_variants "${default_fortran_variant}" |
---|
255 | } |
---|
256 | |
---|
257 | foreach ver ${gcc_versions} { |
---|
258 | set ver_no_dot [join [split ${ver} "."] ""] |
---|
259 | |
---|
260 | if {[variant_isset gcc${ver_no_dot}]} { |
---|
261 | depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc \ |
---|
262 | port:gcc${ver_no_dot} |
---|
263 | |
---|
264 | configure.args-delete --disable-mpi-fortran |
---|
265 | configure.args-append --enable-mpi-fortran |
---|
266 | select.file ${filespath}/${name}-${cname}-fortran |
---|
267 | |
---|
268 | configure.fc ${prefix}/bin/gfortran-mp-${ver} |
---|
269 | } |
---|
270 | } |
---|
271 | |
---|
272 | if {[variant_isset g95]} { |
---|
273 | depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc \ |
---|
274 | port:g95 |
---|
275 | |
---|
276 | configure.args-delete --disable-mpi-fortran |
---|
277 | configure.args-append --enable-mpi-fortran |
---|
278 | select.file ${filespath}/${name}-${cname}-fortran |
---|
279 | |
---|
280 | configure.fc ${prefix}/bin/g95 |
---|
281 | } |
---|
282 | } |
---|
283 | set devnotes "" |
---|
284 | |
---|
285 | if {[string first "-devel" $subport] > 0} { |
---|
286 | set devnotes " |
---|
287 | |
---|
288 | To see the -devel MAN pages, add: |
---|
289 | ${prefix}/share/doc/${name}-${cname}/man |
---|
290 | to the start of your MANPATH environment variable." |
---|
291 | } |
---|
292 | |
---|
293 | notes " |
---|
294 | The mpicc wrapper (and friends) are installed as: |
---|
295 | |
---|
296 | ${prefix}/bin/mpicc-${name}-${cname} (likewise mpicxx, ...) |
---|
297 | |
---|
298 | To make ${subport}'s wrappers the default (what you get when |
---|
299 | you execute 'mpicc' etc.) please run: |
---|
300 | |
---|
301 | sudo port select --set mpi [file tail ${select.file}]${devnotes} |
---|
302 | " |
---|
303 | |
---|
304 | variant threads description {enable threads for MPI applications} { |
---|
305 | configure.args-append --enable-opal-multi-threads --enable-orte-progress-threads --enable-mpi-thread-multiple |
---|
306 | } |
---|
307 | |
---|
308 | variant valgrind description {enable valgrind support} { |
---|
309 | depends_lib-append path:${prefix}/lib/pkgconfig/valgrind.pc:valgrind |
---|
310 | configure.args-append --enable-debug --enable-memchecker --with-valgrind=${prefix} |
---|
311 | } |
---|
312 | |
---|
313 | } else { |
---|
314 | depends_lib-append port:$name-default |
---|
315 | distfiles |
---|
316 | supported_archs noarch |
---|
317 | use_configure no |
---|
318 | patch {} |
---|
319 | build {} |
---|
320 | destroot { |
---|
321 | set docdir ${destroot}${prefix}/share/doc/${name} |
---|
322 | xinstall -d ${docdir} |
---|
323 | system "echo $name is a stub port > ${docdir}/README" |
---|
324 | } |
---|
325 | } |
---|