[MacPorts] #62807: openmpi/mpich: refactor duplicated logic, and simplify ports, via new portgroup

MacPorts noreply at macports.org
Mon May 3 23:07:06 UTC 2021


#62807: openmpi/mpich: refactor duplicated logic, and simplify ports, via new
portgroup
----------------------------+----------------------
  Reporter:  mascguy        |      Owner:  mascguy
      Type:  enhancement    |     Status:  assigned
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:
Resolution:                 |   Keywords:
      Port:  openmpi mpich  |
----------------------------+----------------------

Comment (by mascguy):

 The first two candidates are as follows. I'm not married to the proc
 names, but the point is to eliminate copy-paste logic:

 {{{
 proc mpi_add_compiler_depends_lib {cname} {
     set cport_name ""

     # As we are making wrappers, we depend on the compilers to exist.
     # Add them to depends_lib, not just depends_build.
     if {[regexp {clang[3-9]\d} ${cname}] == 1} {
         # Ports for Clang versions < 10 are named: clang-<major>.<minor>
         set cport_name          [regsub {(\d)(\d)} ${cname} {-\1.\2}]
     } elseif {[regexp {clang\d\d} ${cname}] == 1} {
         # Ports for Clang version >= 10 are named: clang-<major><minor>
         set cport_name          [regsub {(\d)(\d)} ${cname} {-\1\2}]
     } elseif {([regexp {gcc\d} ${cname}] == 1) || ([regexp {gcc\d\d}
 ${cname}] == 1)} {
         # Ports for GCC have names exactly matching our subports, so use
 as-is
         set cport_name          ${cname}
     }

     if {${cport_name} ne ""} {
         ui_debug "mpi_add_compiler_depends_lib: Adding compiler to
 depends_lib: ${cport_name}"
         depends_lib-append      port:${cport_name}
     } else {
         ui_debug "mpi_add_compiler_depends_lib: Not adding compiler to
 depends_lib; cname: ${cname}"
     }

     return 0
 }

 proc mpi_set_binary_eligibility {subport cname} {
     if {[lsearch -exact {mp llvm clang} ${cname}] != -1} {
         # Force local builds with Xcode-provided compilers (avoid issues
 with
         # different Xcode versions on buildbot and user machines)
         ui_debug "mpi_set_binary_eligibility: Disabling binary use for
 subport: ${subport}"
         archive_sites
     } else {
         ui_debug "mpi_set_binary_eligibility: Not disabling binary use for
 subport: ${subport}"
     }

     return 0
 }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/62807#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list