[MacPorts] #62878: openmpi: fix builds for MacOS 10.8 and earlier, by disabling use of AVX instruction set; mark known_fail, for cases not easily fixable
MacPorts
noreply at macports.org
Sat May 15 03:04:59 UTC 2021
#62878: openmpi: fix builds for MacOS 10.8 and earlier, by disabling use of AVX
instruction set; mark known_fail, for cases not easily fixable
----------------------+----------------------
Reporter: jmroot | Owner: mascguy
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: openmpi |
----------------------+----------------------
Comment (by kencu):
success on 10.7 (with AVX enabled, as well):
{{{
$ port -v installed openmpi-gcc10
The following ports are currently installed:
openmpi-gcc10 @4.1.1_0+fortran (active) platform='darwin 11'
archs='x86_64' date='2021-05-14T19:55:14-0700'
}}}
SO -- how....
all the gcc versions on MacPorts (and all the macports-clang-N compilers)
are built to use cctools assembler {{{${prefix}/bin/as}}}. For all older
systems this is the cctools-supplied version (for newer systems it might
be a symlink to the one provided by Xcode).
{{{${prefix}/bin/as}}} has been set up to use a newer clang as the
assembler if a newer clang is available, and it looks for macports-
clang-9.0 ==> macports-clang-5.0 and then {{{clang}}} on 10.7+.
{{{clang}}} on 10.7 and 10.8 is very old now, and it doesn't understand
the newer assembly instructions. {{{macports-clang-9.0}}} is pretty
recent, and easy to build for all systems all the way back to 10.5 Leopard
Intel. So it's a pretty good choice for an assembler right now.
It understands the failing instruction, and also understands the
previously-failed AVX instructions.
SO you can re-enable openmip-gcc10 on 10.7, and the AVX instructions on
10.7 and 10.8, if you make sure that clang-9.0 is installed when openmpi-
gcc10 (etc) is built.
Something like this:
{{{
# For MacOS 10.8 and earlier, system-provided clang assembler doesn't
support newer instructions
if {${os.major} <= 12} {
ui_debug "installed clang-9.0 to use as assembler"
depends_build-append port:clang-9.0
}
}}}
I'm not at this second 100% sure if it is also needed at runtime as an
assembler. It might be, and for caution, I would suggest perhaps it just
be a {{{depends_lib-append}}} so it's always available.
--
Ticket URL: <https://trac.macports.org/ticket/62878#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list