<pre style='margin:0'>
Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/302506f39bb30eeadf05d0db77fa9bdd51dea141">https://github.com/macports/macports-ports/commit/302506f39bb30eeadf05d0db77fa9bdd51dea141</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 302506f39bb30eeadf05d0db77fa9bdd51dea141
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Fri Nov 24 01:10:18 2017 -0700
<span style='display:block; white-space:pre;color:#404040;'> openmpi: add universal support
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> See https://github.com/open-mpi/ompi/wiki/MultiLib
</span><span style='display:block; white-space:pre;color:#404040;'> See https://github.com/open-mpi/ompi/wiki/compilerwrapper3264
</span>---
science/openmpi/Portfile | 81 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 76 insertions(+), 5 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/science/openmpi/Portfile b/science/openmpi/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 7716b03..b566ee3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/science/openmpi/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/science/openmpi/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,6 +4,7 @@ PortSystem 1.0
</span> PortGroup compiler_blacklist_versions 1.0
PortGroup select 1.0
PortGroup compilers 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup muniversal 1.0
</span>
name openmpi
version 3.0.0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -20,11 +21,6 @@ long_description Open MPI is a project combining technologies and resources \
</span> advantages for system and software vendors, application developers \
and computer science researchers.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Since mpi is just a compiler wrapper, compiling it as universal needs to be
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# supported upstream since it'd be a constantly moving target, for reference
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# see, https://trac.macports.org/ticket/20240
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-universal_variant no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> homepage http://www.open-mpi.org/
set subdir ompi/v${branch}/downloads/
master_sites http://www.open-mpi.org/software/${subdir} \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -254,6 +250,81 @@ you execute 'mpicc' etc.) please run:
</span> configure.args-append --enable-debug --enable-memchecker --with-valgrind=${prefix}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[variant_isset universal]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # use open-mpi's multilib support to build universal
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # see https://github.com/open-mpi/ompi/wiki/MultiLib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Fortran is the only non-trivial case
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ merger-post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Fortran headers do not understand preprocessors commands like __LP64__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Fortran mod files can not be merged for different architectures
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # create a architecture specific folder for the non-build_arch architecture
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach arch ${configure.universal_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${arch} ne ${build_arch}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set mod_dir ${destroot}-${arch}${prefix}/lib/${name}-${cname}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d -m 0755 ${mod_dir}/${arch}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach f [glob -nocomplain -directory ${mod_dir} *.mod] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ move ${f} ${mod_dir}/${arch}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set inc_dir ${destroot}-${arch}${prefix}/include/${name}-${cname}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d -m 0755 ${inc_dir}/${arch}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach f [glob -nocomplain -directory ${inc_dir} mpif-config.h] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ move ${f} ${inc_dir}/${arch}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # include the new directories in the search paths for header and mod files
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set data_dir ${destroot}-${arch}${prefix}/share/${name}-${cname}/openmpi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${data_dir}/mpifort-wrapper-data.txt]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "s|-I\${libdir}|-I\${libdir}/${arch} -I\${libdir}|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${data_dir}/mpifort-wrapper-data.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "s|preprocessor_flags=|preprocessor_flags=-I\${includedir}/i386|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${data_dir}/mpifort-wrapper-data.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach arch ${configure.universal_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set data_dir ${destroot}-${arch}${prefix}/share/${name}-${cname}/openmpi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${data_dir}/mpifort-wrapper-data.txt]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # muniversal PortGroup will not merge this file properly
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # merge file in destroot phase
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ move \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${data_dir}/mpifort-wrapper-data.txt \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${data_dir}/mpifort-wrapper-data-${arch}.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # merge mpifort data file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # see https://github.com/open-mpi/ompi/wiki/compilerwrapper3264
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set data_dir ${destroot}${prefix}/share/${name}-${cname}/openmpi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${data_dir}/mpifort-wrapper-data-${build_arch}.txt]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${data_dir} "cat mpifort-wrapper-data-${build_arch}.txt >> mpifort-wrapper-data.txt"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach arch ${configure.universal_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${data_dir}/mpifort-wrapper-data-${arch}.txt]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${arch} ne ${build_arch}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${arch} eq "ppc" || ${arch} eq "i386"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set bitval 32
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set bitval 64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${data_dir} "echo \"\">> mpifort-wrapper-data.txt"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${data_dir} "echo \"compiler_args=${arch};-m${bitval}\" >> mpifort-wrapper-data.txt"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${data_dir} "cat mpifort-wrapper-data-${arch}.txt >> mpifort-wrapper-data.txt"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach arch ${configure.universal_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ delete ${data_dir}/mpifort-wrapper-data-${arch}.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> } else {
depends_lib-append port:$name-default
distfiles
</pre><pre style='margin:0'>
</pre>