Opened 2 years ago

Closed 4 months ago

Last modified 4 months ago

#64954 closed defect (fixed)

boost177 @1.77.0+universal: fails on arm64 Macs with -- "error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or later"

Reported by: kithrup (Sean Eric Fagan) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: mascguy (Christopher Nielsen), water137780117, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), stefanoaz (Steve R)
Port: boost177

Description (last modified by ryandesign (Ryan Carsten Schmidt))

This seems to be the same as #63045, but I actually *do* need universal.

sudo port install boost177 -no_single -no_static        --->  Computing dependencies for boost177
--->  Fetching archive for boost177
--->  Attempting to fetch boost177-1.77.0_1+python310+universal.darwin_20.arm64-x86_64.tbz2 from https://packages.macports.org/boost177
--->  Attempting to fetch boost177-1.77.0_1+python310+universal.darwin_20.arm64-x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/boost177
--->  Attempting to fetch boost177-1.77.0_1+python310+universal.darwin_20.arm64-x86_64.tbz2 from https://kmq.jp.packages.macports.org/boost177
--->  Fetching distfiles for boost177
--->  Verifying checksums for boost177
--->  Extracting boost177
--->  Applying patches to boost177
--->  Configuring boost177
--->  Building boost177                                  
Error: Failed to build boost177: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_releas_ports_devel_boost177/boost177/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port boost177 failed

(I also tried it with no options; the only one that did anything was -universal.)

As far as I can tell, it... seems to be trying to compile PPC, although I have no idea why -- I changed macports.conf to have universal_archs arm64 x86_64.

I tried running the build command manually; the output of that is attached as "output.txt".

(I also tried uninstalling all of the ports and starting again. Same behaviour.)

Attachments (4)

main.log (74.3 KB) - added by kithrup (Sean Eric Fagan) 2 years ago.
output.txt (2.3 KB) - added by kithrup (Sean Eric Fagan) 2 years ago.
Output of attempting to manually build
boost.log (117.0 KB) - added by kencu (Ken) 15 months ago.
boost 176 universal fail log
boost180.log (108.5 KB) - added by kencu (Ken) 15 months ago.
boost180 universal fails M1 Mac

Download all attachments as: .zip

Change History (56)

Changed 2 years ago by kithrup (Sean Eric Fagan)

Attachment: main.log added

Changed 2 years ago by kithrup (Sean Eric Fagan)

Attachment: output.txt added

Output of attempting to manually build

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: mascguy added
Description: modified (diff)
Keywords: universal removed
Owner: set to michaelld
Port: boost177 added; bost177 removed
Status: newassigned
Summary: boot does not build +universalboost177 @1.77.0+universal: error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or later

This seems to be the same as #63045, but I actually *do* need universal.

I see no similarity with #63045. The error in that ticket's log was:

error: No best alternative for libs/context/build/asm_sources

while the error in this ticket's log is:

error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or later

comment:2 Changed 2 years ago by kithrup (Sean Eric Fagan)

Hm, I wonder if I just misread it, or if I had the wrong one in the window. Sorry either way :(.

comment:3 Changed 2 years ago by jurgen-lentz (Jurgen Lentz)

Any updates on this?

comment:4 Changed 2 years ago by kithrup (Sean Eric Fagan)

Still not working. I plead for help. :)

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

look at this file:

libs/thread/build/Jamfile.v2:273

and see why it is falling through to powerpc

comment:6 in reply to:  5 ; Changed 2 years ago by kithrup (Sean Eric Fagan)

Replying to kencu:

libs/thread/build/Jamfile.v2:273

I'm not sure why you're saying that file. l have two files with that name and subpath, and around line 273 is

        result += <define>BOOST_THREAD_DONT_USE_CHRONO ;
        if ! [ configure.builds has_atomic_flag_lockfree 
            : $(properties) : "lockfree boost::atomic_flag" ]  {
           result += <library>/boost/atomic//boost_atomic ;                     
        }   

comment:7 Changed 2 years ago by kithrup (Sean Eric Fagan)

Also, wow, I attached the wrong output.txt attachment. I'm just doing stupid for this.

comment:8 Changed 2 years ago by kithrup (Sean Eric Fagan)

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost177/boost177/work/boost_1_77_0/tools/build/src/tools/darwin.jam however, has arch "combined" complaining if PPC is not supported:

        case combined :
        {
            if $(address-model) = 32_64 {
                if $(support-ppc64) {
                    options = -arch i386 -arch ppc -arch x86_64 -arch ppc64 ;
                } else {
                    # Build 3-way binary
                    options = -arch i386 -arch ppc -arch x86_64 ;
                }
            } else if $(address-model) = 64 {
                if $(support-ppc64) {
                    options = -arch x86_64 -arch ppc64 ;
                } else {
                    errors.user-error "64-bit PPC compilation is not supported w
hen targeting OSX 10.6 or later" ;
                }
            } else {
                options = -arch i386 -arch ppc ;
            }
        }

32-bits isn't supported any longer, so if ppc isn't supported, it should be x86_64 and arm64, no?

comment:9 Changed 2 years ago by kithrup (Sean Eric Fagan)

I locally changed it to

            } else if $(address-model) = 64 {
                if $(support-ppc64) {
                    options = -arch x86_64 -arch ppc64 ;
                } else {
                    options = -arch x86_64 -arch arm64 ;
                }
            } else {

and it seems to have built & installed.

comment:10 Changed 2 years ago by kithrup (Sean Eric Fagan)

Although it has installed itself into /opt/local/libexec/boost/1.77/lib when I would think it should have installed itself into /opt/local/lib, so did that patch do something weird?

comment:11 Changed 2 years ago by michaelld (Michael Dickens)

That's the correct location for Boost installs ... each version installs into a different versioned subdirectory like that one, so that we can have multiple versions of Boost installed at the same time & then pick / choose from them which one gets used.

comment:12 Changed 2 years ago by kithrup (Sean Eric Fagan)

Ok, whew. Not my introducing a bug then. :)

comment:13 in reply to:  6 Changed 2 years ago by kencu (Ken)

Replying to kithrup:

Replying to kencu:

libs/thread/build/Jamfile.v2:273

I'm not sure why you're saying that file.

because the log said this:

808	:info:build Building the Boost C++ Libraries.
809	:info:build error: at libs/thread/build/Jamfile.v2:273
810	:info:build error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or later

but it looks like you might have sorted something else out in the meantime :>

comment:14 Changed 2 years ago by kithrup (Sean Eric Fagan)

Yeah, looks it complained there but the real problem was a few layers down from there.

comment:15 Changed 2 years ago by kithrup (Sean Eric Fagan)

Do I need to do anything more for this? I don't know where that file is coming from, so I'm not sure how I could offer to fix it ;)>

comment:16 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Port: boost176 added

Has duplicate #65120 (for boost176).

comment:17 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: water137780117 added

comment:18 Changed 2 years ago by water137780117

Cc: water137780117 removed

comment:19 Changed 2 years ago by water137780117

Cc: water137780117 added

comment:20 Changed 2 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

It sounds like this has been resolved.

If you're still seeing an issue, let us know!

comment:21 Changed 2 years ago by kithrup (Sean Eric Fagan)

Resolution: fixed
Status: closedreopened

Uh, how has this been resolved? I managed to fix a particular issue with it, locally, but there hasn't been any other change (that I'm aware of), and I have no idea how to fix it permanently.

comment:22 Changed 23 months ago by MrB74

Same problem here. Building on M1 Mac Mini trying to get universal x64/arm64. Fails at the same location: :info:build error: at libs/thread/build/Jamfile.v2:273 :info:build error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or later

comment:23 Changed 21 months ago by ASmoliak (Alex Smoliak)

I can confirm that this problem occurs to me as well. It does look like a bug, the solution here is quite simple like you've done, however it does look like something that may not have anything to do with MacPorts, but rather than the boost developers themselves. I suggest opening an issue in Boost.Build. If you can't do that I'll do it for you.

comment:24 Changed 21 months ago by kithrup (Sean Eric Fagan)

Thanks, I would greatly appreciate if you could do that!

comment:25 Changed 21 months ago by potterpg

@kithrup I had the same issue, and was glad to find your answer.. @ASmoliak, will be good to get it fixed properly at the source of the problem.

comment:26 in reply to:  8 Changed 18 months ago by barracuda156

Replying to kithrup:

32-bits isn't supported any longer, so if ppc isn't supported

PPC is supported (on darwin10 and earlier).

comment:27 Changed 18 months ago by kithrup (Sean Eric Fagan)

And System 9 could support 68k. That's about as relevant.

comment:28 Changed 18 months ago by kencu (Ken)

ppc is still actively supported by macports, also i386.

this old boost never considered an arch arm64 would come along and be a universal arch needing support. but now it has come anong.

someone needs to sit down with the code in darwin.jam and add support for arm64 as a universal arch, ideally without breaking everything else in the process.

comment:29 Changed 18 months ago by kencu (Ken)

things have changed a bit it looks like in how this is being done, exactly…

https://github.com/boostorg/build/blob/405d34a04d29519625c5edfe1f3bac3bc3dc3534/src/tools/darwin.jam#L514

comment:30 Changed 18 months ago by kencu (Ken)

it’s more complicated, of course… macports is also altering darwin.jam in the Portfile.

https://github.com/macports/macports-ports/blob/b81c2d73d57087e9aa01b61867ce1a3407e92759/devel/boost177/Portfile#L474

comment:31 Changed 18 months ago by mouse07410 (Mouse)

I've a naive question: I understand perfectly why one wants to build for arm64, or for x86_64... I fail to understand why one would want "fat" aka "universal", rather than building a specific architecture-targeting binaries.

If it were up to me, I'd deprecate "universal" altogether.

comment:32 Changed 15 months ago by kencu (Ken)

Cc: MarcusCalhoun-Lopez added

Changed 15 months ago by kencu (Ken)

Attachment: boost.log added

boost 176 universal fail log

comment:33 Changed 15 months ago by kencu (Ken)

boost 176 (the default boost you get when you use sudo port -v install boost +universal does not build universal on an arm Mac:

displayed error is the same as above:

error: at libs/thread/build/Jamfile.v2:273
error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or later

log attached.

I'll try building some newer boost and see if any of them can build universal.

Last edited 15 months ago by kencu (Ken) (previous) (diff)

comment:34 Changed 15 months ago by kencu (Ken)

no, boost180 won't build universal either on this system:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/build/feature.jam:491: in feature.validate-value-string from module feature
error: "combined" is not a known value of feature <architecture>
error: legal values: "x86" "ia64" "sparc" "power" "loongarch" "mips" "mips1" "mips2" "mips3" "mips4" "mips32" "mips32r2" "mips64" "parisc" "arm" "riscv" "s390x" "arm+x86"
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/build/property.jam:337: in validate1 from module property
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/build/property.jam:363: in property.validate from module property
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/build/build-request.jam:286: in convert-command-line-element from module build-request
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/build/build-request.jam:222: in build-request.convert-command-line-elements from module build-request
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/build-system.jam:774: in load from module build-system
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/kernel/modules.jam:294: in import from module modules
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/tools/build/src/kernel/bootstrap.jam:135: in module scope from module

Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0" && /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost180/boost180/work/boost_1_80_0/b2 -d2 --layout=tagged --debug-configuration --user-config=user-config.jam -sBZIP2_INCLUDE=/opt/local/include -sBZIP2_LIBPATH=/opt/local/lib -sEXPAT_INCLUDE=/opt/local/include -sEXPAT_LIBPATH=/opt/local/lib -sZLIB_INCLUDE=/opt/local/include -sZLIB_LIBPATH=/opt/local/lib -sICU_PATH=/opt/local variant=release runtime-link=shared -j10 --no-cmake-config link=shared threading=multi pch=off address-model=64 architecture=combined 

Changed 15 months ago by kencu (Ken)

Attachment: boost180.log added

boost180 universal fails M1 Mac

comment:35 Changed 15 months ago by kencu (Ken)

Summary: boost177 @1.77.0+universal: error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or laterboost177 @1.77.0+universal: fails on arm64 Macs with -- "error: 64-bit PPC compilation is not supported when targeting OSX 10.6 or later"

comment:36 Changed 15 months ago by kaamui

It seems that a workaround has been implemented in 1.81.0 => https://github.com/boostorg/build/commit/d312a161524213b7966eec440158f38fbaa497c2

Please note that poppler +universal fails to install too, because of boost176 dependency.

Still the same issue as with boost 180 though

Version 2, edited 15 months ago by kaamui (previous) (next) (diff)

comment:37 Changed 10 months ago by kencu (Ken)

has duplicate #67717

Last edited 10 months ago by kencu (Ken) (previous) (diff)

comment:38 in reply to:  9 ; Changed 10 months ago by mallman (Michael Allman)

Replying to kithrup:

I locally changed it to

            } else if $(address-model) = 64 {
                if $(support-ppc64) {
                    options = -arch x86_64 -arch ppc64 ;
                } else {
                    options = -arch x86_64 -arch arm64 ;
                }
            } else {

and it seems to have built & installed.

Supposing this is the correct fix, would a maintainer add a patch to the port? As is, boost176+universal is broken.

Last edited 10 months ago by mallman (Michael Allman) (previous) (diff)

comment:39 Changed 10 months ago by mallman (Michael Allman)

I just tried boost181+universal. It's broken, too, with a different build error:

:info:build error: "combined" is not a known value of feature <architecture>
:info:build error: legal values: "x86" "ia64" "sparc" "power" "loongarch" "mips" "mips1" "mips2" "mips3" "mips4" "mips32" "mips32r2" "mips64" "parisc" "arm" "riscv" "s390x" "arm+x86"

comment:40 in reply to:  38 ; Changed 10 months ago by kencu (Ken)

Replying to mallman:

Replying to kithrup:

I locally changed it to

            } else if $(address-model) = 64 {
                if $(support-ppc64) {
                    options = -arch x86_64 -arch ppc64 ;
                } else {
                    options = -arch x86_64 -arch arm64 ;
                }
            } else {

and it seems to have built & installed.

Supposing this is the correct fix, would a maintainer add a patch to the port? As is, boost176+universal is broken.

Doing this all the time breaks the ppc64 universal build, which macports still supports.

So someone needs to spend a few hours and fix it properly….

edit: oh, i could be wrong…. perhaps it would be the fix… have to try all the combinations.

Last edited 10 months ago by kencu (Ken) (previous) (diff)

comment:41 in reply to:  40 Changed 10 months ago by mallman (Michael Allman)

Replying to kencu:

Replying to mallman:

Replying to kithrup:

I locally changed it to

            } else if $(address-model) = 64 {
                if $(support-ppc64) {
                    options = -arch x86_64 -arch ppc64 ;
                } else {
                    options = -arch x86_64 -arch arm64 ;
                }
            } else {

and it seems to have built & installed.

Supposing this is the correct fix, would a maintainer add a patch to the port? As is, boost176+universal is broken.

Doing this all the time breaks the ppc64 universal build, which macports still supports.

So someone needs to spend a few hours and fix it properly….

edit: oh, i could be wrong…. perhaps it would be the fix… have to try all the combinations.

I greatly appreciate your assistance Ken. I'm sure everyone else who's been hit with this problem does, too.

Let me know if there's anything I can do to help. I have an M1 Mac. I'm willing to test some patches, if you want me to.

Cheers.

comment:42 Changed 8 months ago by stefanoaz (Steve R)

Cc: stefanoaz added

comment:43 Changed 8 months ago by stefanoaz (Steve R)

Cc: stefanoaz removed

comment:44 Changed 8 months ago by stefanoaz (Steve R)

Cc: stefanoaz added

comment:45 Changed 4 months ago by kencu (Ken)

Resolution: fixed
Status: reopenedclosed

In ecb1dc8dabb800a0fa569b84d32516d81a387180/macports-ports (master):

boost176: allow univeral building on arm/Intel

boost176 predates the arm Macs by some years

We use a fallback pathway to force the "combined" architecture
and jam the proper archflags into the build via that method.

Then there is an issue properly selecting a set of asm sources
to use. The hiccup is on the abi, which is different between
arm64 and Intel, so we remove the abi from the specifications
for asm files.

With these two changes, boost176 builds through as universal
on arm and has the required architectures in libraries.

This is not elegant, but it works until our default boost is advanced
to some newer version that better supports arm/Intel universal builds.

closes: #64954

comment:46 Changed 4 months ago by kencu (Ken)

My apologies for just pushing this fix, but the universal build of boost176 has been broken on arm for 21 months, so -- seemed about time to get it fixed.

If my patch to fix this issue causes any difficulty or trouble, I will fix it.

comment:47 Changed 4 months ago by kencu (Ken)

Resolution: fixed
Status: closedreopened

Oh, looks like this ticket is for boost 177 too, so I'll reopen it until that one is fixed as well as 176.

comment:48 Changed 4 months ago by kencu (Ken)

Port: boost176 removed

comment:49 Changed 4 months ago by kencu (Ken)

Resolution: fixed
Status: reopenedclosed

aaannnd it turns out boost177 doesn't really exist any longer. replaced by boost181

comment:50 Changed 4 months ago by kencu (Ken)

In ba2a2f644955d8e6d09b8511c262b1f8c53bb48d/macports-ports (master):

boost181: fix universal build arm/Intel

add an entry to context asm_sources to match
the arm/Intel universal build

see: #64954

comment:51 Changed 4 months ago by kencu (Ken)

In e27ccf9e4ddc55e1f7c59b569eee95de12cc7c16/macports-ports (master):

boost178: enable universal build arm/Intel

see: #64954

comment:52 Changed 4 months ago by kencu (Ken)

In 141a4421d8a492f98b038feaafc928a21ae5d65d/macports-ports (master):

boost171: fix universal arm/Intel build

backport fixes from boost176 port

closes: #66686
see: #64954

Note: See TracTickets for help on using tickets.