Opened 2 years ago
Last modified 23 months ago
#66477 assigned defect
mpich-default +native: clang: error: the clang compiler does not support '-march=native'
Reported by: | chaochinyang (Chao-Chin Yang) | Owned by: | eborisch (Eric A. Borisch) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.8.0 |
Keywords: | arm64 | Cc: | mascguy (Christopher Nielsen) |
Port: | mpich-default |
Description (last modified by chaochinyang (Chao-Chin Yang))
I am trying to install mpich
with +native
variant on my MacBook Pro (16-inch, 2021, Apple M1 Max) with macOS Monterey 12.6.2 and Xcode 14.1.
The error shows that
:info:configure checking for gcc... /usr/bin/clang :info:configure checking whether the C compiler works... no :info:configure configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_mpich/mpich-default/work/mpich-4.0.3': :info:configure configure: error: C compiler cannot create executables :info:configure See `config.log' for more details :info:configure Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_mpich/mpich-default/work/mpich-4.0.3" && ./configure --prefix=/opt/local --disable-dependency-tracking --enable-fortran --disable-silent-rules --enable-base-cache --enable-cache --enable-cxx --enable-fast=all --enable-shared --enable-versioning --enable-timer-type=mach_absolute_time --with-pm=hydra --with-thread-package=posix --with-hwloc-prefix=/opt/local --disable-collalgo-tests --disable-f08 F90FLAGS='' F90='' --libdir=/opt/local/lib/mpich-mp --sysconfdir=/opt/local/etc/mpich-mp --program-suffix=-mpich-mp --includedir=/opt/local/include/mpich-mp MPICHLIB_CFLAGS="$CFLAGS" CFLAGS="" MPICHLIB_CPPFLAGS="$CPPFLAGS" CPPFLAGS="" MPICHLIB_CXXFLAGS="$CXXFLAGS" CXXFLAGS="" MPICHLIB_FFLAGS="$FFLAGS" FFLAGS="" MPICHLIB_FCFLAGS="$FCFLAGS" FCFLAGS="" :info:configure Exit code: 77
but I can compile a simple hello world with either Apple Clang or MacPorts gcc12.
I attach both config.log
and main.log
here.
BTW, I can install mpich
without +native
variant.
Thanks in advance for taking a look into this issue.
/CC
Attachments (2)
Change History (11)
Changed 2 years ago by chaochinyang (Chao-Chin Yang)
Changed 2 years ago by chaochinyang (Chao-Chin Yang)
Attachment: | config.log added |
---|
comment:1 Changed 2 years ago by chaochinyang (Chao-Chin Yang)
Description: | modified (diff) |
---|
comment:3 Changed 2 years ago by chaochinyang (Chao-Chin Yang)
Thanks, Ken, for such a quick response.
Indeed I missed that -march=native
is not supported by Clang. According to this article, this option will be supported by version 15, so until then.
/CC
comment:4 Changed 2 years ago by kencu (Ken)
Oh, that is interesting. My spankin' new MacBookPro M1 is sitting in a box, to come under the tree in a few days, so I can't try this out myself just yet, but clang-15 is available in macports now, so it is possible that this might work if that compiler is forced.
You would do it like this:
sudo port -v -N install clang-15 sudo port -v install mpich +native configure.compiler=macports-clang-15
comment:5 Changed 2 years ago by jmroot (Joshua Root)
Cc: | mascguy added |
---|---|
Owner: | set to eborisch |
Status: | new → assigned |
comment:6 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | arm64 added |
---|---|
Summary: | port install mpich +native: Failed to configure (on M1) → mpich-default +native: clang: error: the clang compiler does not support '-march=native' |
comment:7 Changed 2 years ago by eborisch (Eric A. Borisch)
Since it works without +native, just install that? Adding -march=native is almost all +native does.
comment:8 Changed 2 years ago by chaochinyang (Chao-Chin Yang)
@eborisch: I feel if a variant is not intended for certain use, a stoppage and info message should be in place for the benefits of regular users (with the expiration when Apple upgrades their clang to 15). Of course I will not use the variant because it doesn't work, but I would want to know why it didn't.
@kencu: After testing your suggestion, I can confirm that clang-15
accepts -march=native
option, and mpich
with mpich-default
can be installed with variant +native
.
comment:9 Changed 23 months ago by kencu (Ken)
I tried adding some simple compiler blacklisting into the native variant for arm builds, but it doesn't seem to work as expected for me. These mpich ports are quite detailed in their construction and they may not obey standard blacklisting statements, perhaps.