source: trunk/dports/science/openmpi/Portfile

Last change on this file was 149997, checked in by sean@…, 15 months ago

openmpi-devel: update to newest commit

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.9 KB
Line 
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 149997 2016-07-08 05:36:21Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compiler_blacklist_versions 1.0
6PortGroup           select 1.0
7PortGroup           compilers 1.0
8
9name                openmpi
10version             1.10.3
11set branch          [join [lrange [split ${version} .] 0 1] .]
12categories          science parallel net
13platforms           darwin
14license             BSD
15maintainers         sean openmaintainer
16description         A High Performance Message Passing Library
17long_description    Open MPI is a project combining technologies and resources \
18            from several other projects (FT-MPI, LA-MPI, LAM/MPI, and \
19            PACX-MPI) in order to build the best MPI library available. A \
20            completely new MPI-2 compliant implementation, Open MPI offers \
21            advantages for system and software vendors, application developers \
22            and computer science researchers.
23
24# Since mpi is just a compiler wrapper, compiling it as universal needs to be
25# supported upstream since it'd be a constantly moving target, for reference
26# see, https://trac.macports.org/ticket/20240
27universal_variant   no
28
29homepage            http://www.open-mpi.org/
30set subdir          ompi/v${branch}/downloads/
31master_sites        http://www.open-mpi.org/software/${subdir} \
32                    http://www.open-mpi.de/software/${subdir} \
33                    http://icl.cs.utk.edu/open-mpi/${subdir}
34
35checksums           rmd160  80e070292ad24e1fca1396167b26966c3d49af62 \
36                    sha256  7484bb664312082fd12edc2445b42362089b53b17fb5fce12efd4fe452cc254d
37use_bzip2           yes
38
39livecheck.type      regex
40livecheck.url       http://www.open-mpi.org/
41livecheck.regex     Open MPI v(\[0-9\.\]+) released
42
43if {[string first "-devel" $subport] > 0} {
44    name                openmpi-devel
45    version             1.10.99
46    # openmpi switched to git and reset their revision number;
47    # remove this when for next release
48    set base            32546
49    set tag             g4bc08d6
50    set newrev          4366
51    revision            [expr {$base + $newrev + 2}]
52    distname            openmpi-dev-${newrev}-${tag}
53
54    master_sites        http://www.open-mpi.org/nightly/master \
55                        http://www.open-mpi.de/nightly/master
56
57    checksums           rmd160  4e7144ec561ebef4c6e230459d082f960b7784e0 \
58                        sha256  33ecc0fbf17048c873db23c52a8a7ccb5209ab45782fe1426db0611271431f9c
59
60    livecheck.version   ${newrev}-${tag}
61    livecheck.url       [lindex ${master_sites} 0]
62    livecheck.regex     <strong>dev-(\[0-9\]+-g\[0-9a-f\]+)
63}
64
65# As OpenMPI creates compiler wrappers, there are lots of
66# variants for what compiler the user would like to wrap.
67
68# Sup-ports names and corresponding configure.compiler value
69array set clist {
70    clang   {clang}
71    clang33 {macports-clang-3.3}
72    clang34 {macports-clang-3.4}
73    clang35 {macports-clang-3.5}
74    clang36 {macports-clang-3.6}
75    clang37 {macports-clang-3.7}
76    clang38 {macports-clang-3.8}
77    gcc43   {macports-gcc-4.3}
78    gcc44   {macports-gcc-4.4}
79    gcc45   {macports-gcc-4.5}
80    gcc46   {macports-gcc-4.6}
81    gcc47   {macports-gcc-4.7}
82    gcc48   {macports-gcc-4.8}
83    gcc49   {macports-gcc-4.9}
84    gcc5    {macports-gcc-5}
85    gcc6    {macports-gcc-6}
86    gcc7    {macports-gcc-7}
87    llvm    {llvm-gcc-4.2}
88    dragonegg33 {macports-dragonegg-3.3}
89    dragonegg34 {macports-dragonegg-3.4}
90}
91
92foreach key [array name clist] {
93    subport ${name}-${key} {}
94    subport ${name}-devel-${key} {}
95}
96subport ${name}-default {}
97subport ${name}-devel {}
98subport ${name}-devel-default {}
99
100pre-extract { file mkdir ${workpath}/build }
101
102# https://trac.macports.org/ticket/39089
103compiler.blacklist  gcc-4.0
104compiler.blacklist-append  llvm-gcc-4.2 macports-llvm-gcc-4.2
105
106configure.dir       ${workpath}/build
107configure.cmd       ${worksrcpath}/configure
108configure.args      --enable-mpi-fortran \
109                    "FFLAGS='' F77=''"
110
111# remove -arch from ldflags, ticket #22833
112configure.ld_archflags
113configure.ccache no
114
115# We're making compiler wrappers here... don't default to -O2 for wrappers.
116# Actual library code is compiled with -O2 via --enable-fast=O2 configure arg
117configure.optflags-delete   -O2 -Os
118configure.cppflags-delete   -I${prefix}/include
119configure.ldflags-delete    -L${prefix}/lib
120
121build.dir           ${configure.dir}
122destroot.dir        ${build.dir}
123
124if {${subport} != ${name}} {
125    set cname                   [lindex [split ${subport} -] end]
126    if {${cname} == "default"} {
127        set cname                   mp
128    }
129
130    # Force buildbot to skip this since openmpi depends on hwloc and that would
131    # be different for a user's machine
132    archive_sites
133
134    depends_lib-append          port:hwloc
135    depends_run                 port:mpi_select port:mpi-doc
136    select.group                mpi
137    select.file                 ${filespath}/${name}-${cname}
138    livecheck.type              none
139
140    if {[string first "-default" $subport] < 0} {
141        configure.compiler      [lindex $clist($cname) 0]
142        append long_description "\\n\\nTHIS SUBPORT WRAPS ${cname}'s C/C++"
143    } else {
144        append long_description \
145"\\n\\nTHIS SUBPORT WRAPS MACPORTS' DEFAULT COMPILER FOR C/C++"
146    }
147
148    configure.args-append   \
149        --bindir=${prefix}/libexec/${name}-${cname} \
150        --libdir=${prefix}/lib/${name}-${cname} \
151        --sysconfdir=${prefix}/etc/${name}-${cname} \
152        --includedir=${prefix}/include/${name}-${cname} \
153        --datadir=${prefix}/share/${name}-${cname} \
154        --docdir=${prefix}/share/docdelete \
155        --mandir=${prefix}/share/mandelete \
156        --with-hwloc=${prefix}
157
158    post-destroot {
159        if {[string first "-devel" $subport] > 0} {
160            # Supply our own -devel manpages (might be materially different / new)
161            file mkdir ${destroot}${prefix}/share/doc
162            file mkdir ${destroot}${prefix}/share/docdelete
163            move ${destroot}${prefix}/share/mandelete \
164                ${destroot}${prefix}/share/docdelete/man
165            move ${destroot}${prefix}/share/docdelete \
166                ${destroot}${prefix}/share/doc/${name}-${cname}
167            system -W ${destroot}${prefix}/share/doc/${name}-${cname}/man \
168                "/usr/bin/find . -type f -print0 | /usr/bin/xargs -0 -P ${build.jobs} /usr/bin/gzip -v"
169        } else {
170            # This version doesn't supply manpages
171            if {[file isdirectory ${destroot}${prefix}/share/mandelete]} {
172                delete ${destroot}${prefix}/share/mandelete
173            }
174            if {[file isdirectory ${destroot}${prefix}/share/docdelete]} {
175                delete ${destroot}${prefix}/share/docdelete
176            }
177        }
178
179        set vampirlog ${destroot}${prefix}/share/${name}-${cname}/vampirtrace/config.log
180        if { [ file exists $vampirlog ] } {
181            delete $vampirlog
182        }
183
184        foreach bin {mpirun mpiexec mpicc mpicxx mpif77 mpif90 mpifort} {
185            system -W ${destroot}${prefix}/share/$name-$cname/openmpi \
186                "ln -sf $bin-wrapper-data.txt $bin-$name-$cname-wrapper-data.txt"
187            system -W ${destroot}${prefix}/bin \
188                "ln -sf ${prefix}/libexec/$name-$cname/$bin $bin-$name-$cname"
189        }
190    }
191
192    if { [string first gcc $cname] == 0 } {
193        append long_description " AND FORTRAN COMPILERS"
194        configure.args-delete   --disable-mpi-fortran
195        configure.args-append   --enable-mpi-fortran
196        select.file             ${filespath}/${name}-${cname}-fortran
197        variant fortran description {
198            Stub : fortran always enabled for gcc-based version
199        } {}
200        default_variants-append     +fortran
201    } elseif { [string first dragon $cname] == 0 } {
202        configure.args-delete   --disable-mpi-fortran
203        configure.args-append   --enable-mpi-fortran
204        select.file             ${filespath}/${name}-${cname}-fortran
205        variant fortran description {
206            Stub : fortran always enabled for dragonegg-based version
207        } {}
208        default_variants-append     +fortran
209    } else {
210        append long_description " (AND THE FORTRAN COMPILER SELECTED BY THE VARIANT, IF ANY)"
211
212        compilers.choose   fc
213        compilers.setup    -dragonegg default_fortran
214
215        if {[fortran_variant_isset]} {
216            configure.args-delete   --disable-mpi-fortran
217            configure.args-append   --enable-mpi-fortran
218            select.file             ${filespath}/${name}-${cname}-fortran
219
220            # at least currently, the Fortran variants gccX and g95 match the name of the ports
221            depends_lib-append      port:[fortran_variant_name]
222        }
223    }
224    set devnotes ""
225
226    if {[string first "-devel" $subport] > 0} {
227        set devnotes "
228
229To see the -devel MAN pages, add:
230  ${prefix}/share/doc/${name}-${cname}/man
231to the start of your MANPATH environment variable."
232    }
233
234notes "
235The mpicc wrapper (and friends) are installed as:
236
237  ${prefix}/bin/mpicc-${name}-${cname} (likewise mpicxx, ...)
238
239To make ${subport}'s wrappers the default (what you get when
240you execute 'mpicc' etc.) please run:
241
242  sudo port select --set mpi [file tail ${select.file}]${devnotes}
243"
244
245    variant threads description {enable threads for MPI applications} {
246        configure.args-append --enable-osx-builtin-atomics --enable-mpi-thread-multiple --with-threads
247    }
248
249    variant valgrind description {enable valgrind support} {
250        depends_lib-append    path:${prefix}/lib/pkgconfig/valgrind.pc:valgrind
251        configure.args-append --enable-debug --enable-memchecker --with-valgrind=${prefix}
252    }
253
254} else {
255    depends_lib-append      port:$name-default
256    distfiles
257    supported_archs         noarch
258    use_configure           no
259    patch {}
260    build {}
261    destroot {
262        set docdir          ${destroot}${prefix}/share/doc/${name}
263        xinstall -d ${docdir}
264        system "echo $name is a stub port > ${docdir}/README"
265    }
266}
Note: See TracBrowser for help on using the repository browser.