Opened 3 years ago

Closed 22 months ago

#64986 closed defect (fixed)

OpenBLAS fails on 10.6.8 Rosetta: error: unrecognized command-line option '-march=native'

Reported by: barracuda156 Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc, snowleopard, rosetta Cc: cooljeanius (Eric Gallager), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: OpenBLAS

Description

macmini:~ svacchanda$ sudo port -v install openblas configure.compiler=macports-gcc-11
--->  Computing dependencies for OpenBLAS.
--->  Fetching distfiles for OpenBLAS
--->  Verifying checksums for OpenBLAS
--->  Checksumming OpenBLAS-0.3.20.tar.gz
--->  Extracting OpenBLAS
--->  Extracting OpenBLAS-0.3.20.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/OpenBLAS/OpenBLAS-0.3.20.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Applying patches to OpenBLAS
--->  Applying patch-libnoarch.release.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/OpenBLAS-0.3.20" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/math/OpenBLAS/files/patch-libnoarch.release.diff'
patching file Makefile.system
Hunk #1 succeeded at 1581 (offset 3 lines).
--->  Applying patch-OpenBLAS-i386-Apple.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/OpenBLAS-0.3.20" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/math/OpenBLAS/files/patch-OpenBLAS-i386-Apple.diff'
patching file cpuid_x86.c
--->  Configuring OpenBLAS
--->  Building OpenBLAS
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cxx
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cxx/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cxx/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cxx/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objc
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objc/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objc/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objc/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objcxx
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objcxx/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objcxx/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objcxx/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f77
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f77/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f77/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f77/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f90
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f90/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f90/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f90/opt/local/bin
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/OpenBLAS-0.3.20" && /usr/bin/make -j4 -w all AR=/opt/local/bin/ar RANLIB=/opt/local/bin/ranlib CC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc/opt/local/bin/gcc-mp-11" CXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cxx/opt/local/bin/g++-mp-11" OBJC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objc/opt/local/bin/gcc-mp-11" OBJCXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objcxx/opt/local/bin/g++-mp-11" FC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt/local/bin/gfortran-mp-11" F77="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f77/opt/local/bin/gfortran-mp-11" F90="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f90/opt/local/bin/gfortran-mp-11" INSTALL="/usr/bin/install -c" 
gcc-mp-11: error: unrecognized command-line option '-march=native'; did you mean '-mcpu=native'?
make: *** [getarch] Error 1
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-0b678b1'
Makefile.system:283: Makefile.conf: No such file or directory
Makefile.system:1434: Makefile.: No such file or directory
make: *** No rule to make target `Makefile.'.  Stop.
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-0b678b1'

Change History (11)

comment:1 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:2 Changed 2 years ago by barracuda156

This may work, testing now:

		if {${os.major} == 10 && ${build_arch} eq "ppc"} {
		    puts $makeINC "TARGET = PPCG4"
		    puts $makeINC "HOSTARCH = PPCG4"
		}

comment:3 Changed 2 years ago by kencu (Ken)

does this actually work in rosetta, or just 10.6-for-PPC? I thought it would have to be configure.build_arch to work in rosetta.

comment:4 Changed 2 years ago by kencu (Ken)

or maybe you have an installation of macports on 10.6 Intel with ppc set as the build arch in macports.conf I guess….

Last edited 2 years ago by kencu (Ken) (previous) (diff)

comment:5 in reply to:  3 Changed 2 years ago by barracuda156

Replying to kencu:

does this actually work in rosetta, or just 10.6-for-PPC? I thought it would have to be configure.build_arch to work in rosetta.

On 10.6 PPC this is not needed, openblas builds fine there.

At the moment I only have access to 10.6.8 Rosetta, so fixing ports for it. (I am out of Taiwan, and only got Intel MBP with me.)

comment:6 in reply to:  4 Changed 2 years ago by barracuda156

Replying to kencu:

or maybe you have an installation of macports on 10.6 Intel with ppc set as the build arch in macports.conf I guess….

Yes, exactly.

That -march=native flag comes from x86-specific build settings. Apparently because the build system identifies Host with x86. Specifically, Makefile.system has this:

# On x86_64 build getarch with march=native unless the compiler is PGI. This is required to detect AVX512 support in getarch.
ifeq ($(HOSTARCH), x86_64)
ifeq ($(findstring pgcc,$(HOSTCC))$(findstring nvc,$(HOSTCC)),)
GETARCH_FLAGS += -march=native
endif
endif

(And Cmake version has the same, though not used by Macports.)

comment:7 Changed 2 years ago by barracuda156

Build is successful on 10.6.8 Rosetta now:

10:~ svacchanda$ port -v installed openblas
The following ports are currently installed:
  OpenBLAS @0.3.20_1+gcc12+lapack+native (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-08-02T03:40:05+0545'

PR: https://github.com/macports/macports-ports/pull/15564

comment:8 Changed 2 years ago by barracuda156

Resolution: fixed
Status: assignedclosed

In 180446bab2dd9c174c8b5a8966c6cb714b698692/macports-ports (master):

OpenBLAS: change PPCG5 to PPC970
Fixes: #64986

comment:9 Changed 22 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:10 Changed 22 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: closedreopened

https://github.com/macports/macports-ports/commit/018a7046599b062aa6f5af6e6de174c3edcc20b2 caused a regression (see #66903).
There is a pull request that attempts to fix the problem.
However, I have no way of testing it.
@barracuda156, could you please take a look?

comment:11 Changed 22 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: reopenedclosed

In 35e0b7a7858d78dafbc21d14dae35e63c12a7d69/macports-ports (master):

OpenBLAS: fix regression on ppc/i386 Rosetta

Fixes #64986

No revbump since port either builds correctly or not at all.

Note: See TracTickets for help on using tickets.