Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64997 closed defect (worksforme)

Cannot build libgcc9 under Monterey

Reported by: keldhelsgaun (Keld Helsgaun) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port:

Description

It seems that I have the same problem as described in ticket #64762: "port upgrade outdated" stops with an error message saying that the build of libgcc9 has failed. My MacOS is Monterey 12.3.1.

If libgcc9 is not compatible with Monterey, how can I uninstall it? I have tried "port uninstall libgcc9" and "port uninstall gcc9". However, "port upgrade outdated" still stops with the same error message.

Change History (12)

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

Figure out which of the ports that you have installed require gcc9:

port installed depends:gcc9

For each one, check if that port might have a variant that lets you use a newer version of gcc. If so, clean that port and then install it using that variant.

comment:2 Changed 2 years ago by keldhelsgaun (Keld Helsgaun)

That didn't solve my problem. Execution of 'port installed depends:gcc9' gave only one result: 'libgcc8 @8.3.0.5'. The page https://ports.macports.org/port/libgcc9/details/ reports that libgcc9 has a problem under Monterey (x86-64).

Since https://ports.macports.org/port/libgcc10/details/ does not report a problem for libgcc10 under Monterey (x86-64), I tried to install gcc10. However, this installation also failed. The log said "build error: configuring for an unreleased macOS version x86_64-apple-darwin21".

I have also tried to install gcc11, but this unfortunately begins with an unsuccessful attempt to install libgcc9.

So what can I do now? Do you need more information from me?

If libgcc9, gcc9, gcc9, gcc10 and gcc11 are currently not compatible with Monterey, how can I safely delete them?

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

For any port, you can safely delete them by uninstalling them, e.g. running sudo port uninstall libgcc9. If MacPorts allows you to uninstall it, then nothing else that you had installed with MacPorts required it.

comment:4 Changed 2 years ago by keldhelsgaun (Keld Helsgaun)

After executing "sudo port uninstall libgcc9", "sudo port upgrade outdated" fails in an attempt to build libgcc9. Also an attempt to install gcc11 fails in an attempt to build libgcc9.

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

can you please show the result of this command?

port -v installed | grep gcc

comment:6 Changed 2 years ago by keldhelsgaun (Keld Helsgaun)

gcc11 @11.2.0_3 (active) requested_variants= platform='darwin 21' archs='x86_64' date='2022-04-07T21:43:10+0200' gcc_select @0.1_9 (active) requested_variants= platform='darwin 21' archs='noarch' date='2022-04-07T21:42:51+0200' libgcc @5.0_0 (active) requested_variants= platform='darwin 21' archs='x86_64' date='2022-04-07T21:42:57+0200' libgcc8 @8.3.0_5 requested_variants= platform='darwin 18' archs='x86_64' date='2019-08-29T16:04:46+0200' libgcc10 @10.3.0_2 (active) requested_variants= platform='darwin 21' archs='x86_64' date='2022-04-18T11:50:37+0200' libgcc11 @11.2.0_1 requested_variants= platform='darwin 18' archs='x86_64' date='2021-09-12T14:06:46+0200' libgcc11 @11.2.0_3 (active) requested_variants= platform='darwin 21' archs='x86_64' date='2022-04-07T21:42:54+0200' OpenBLAS @0.3.7_0+gcc9+lapack requested_variants='+gcc9+lapack' platform='darwin 18' archs='x86_64' date='2019-08-29T16:05:32+0200' OpenBLAS @0.3.17_0+gcc9+lapack requested_variants='+gcc9+lapack' platform='darwin 18' archs='x86_64' date='2021-09-12T14:19:51+0200' OpenBLAS @0.3.18_0+gcc9+lapack requested_variants='+gcc9+lapack' platform='darwin 18' archs='x86_64' date='2021-10-24T02:08:31+0200' OpenBLAS @0.3.20_0+gcc9+lapack (active) requested_variants='+gcc9+lapack' platform='darwin 18' archs='x86_64' date='2022-03-17T13:15:41+0100'

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

so this issue seems to be this:

OpenBLAS @0.3.20_0+gcc9+lapack (active) requested_variants='+gcc9+lapack' platform='darwin 18' archs='x86_64' date='2022-03-17T13:15:41+0100'

when you originally installed OpenBLAS back in 2019, the default gcc version in use at that time apparently was gcc9.

MacPorts has been dutifully holding to that gcc9 variant ever since, updating as per your listed variants. This is not really what you want, though. You want OpenBLAS with whatever the default gcc variant is NOW.

MacPorts I believe has squeezed most of these errors out of the variants by now (they recognized this was a problem), but there may still be some in the ports tree, and there are still some in people's older installs.

So clean out OpenBLAS to start fresh, and install OpenBLAS without any specific variants, and you should get a clean install against the current gcc version.

I would do something like this, myself:

sudo port -f uninstall OpenBLAS
sudo port -f uninstall libgcc8
sudo port -f uninstall libgcc10

and then once your have all that old stuff cleaned out, install OpenBLAS:

sudo port -v install OpenBLAS

and you should be back in the game.

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

Oh, I see one more thing. Your ports are installed as:

darwin 18

but you are not on darwin18 any more. So this won't work right either. When you upgrade your operating system to a new version, you must (sadly) uninstall all the ports for the old operating system and then reinstall all the ports for the new operating system. Otherwise, unexpected things can happen.

this is such a common FAQ there is a Wiki entry to explain both the issue and how to resolve it:

https://trac.macports.org/wiki/Migration

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

If you do follow those Migration instructions, you should look at your requested.txt file of requested ports, and before you start to restore the ports, anywhere you see "gcc9" or "+gcc9" or similar in there, delete that.

You can also delete anything that mentions gcc8 or any other version of gcc older than gcc11.

MacPorts has been on a mission to get the "+gccN" out of the requested variants list to avoid this happening to people in the future as much as it was happening to people in the past.

comment:10 Changed 2 years ago by keldhelsgaun (Keld Helsgaun)

Thank you very much.

I followed the migration instructions. So now I am "back in the game".

Just a suggestion: Section 3e begins with the statement "Download and execute the ​restore_ports script.". I did just that and nothing happened. I had to kill the execution by a 'kill -9' (a simple 'control C' or 'kill' did not work). I figured out that I had to execute the four instructions in this section after the download. I suggest that the statement is changed to "Download the restore_ports script and execute the instructions below."

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

Resolution: worksforme
Status: newclosed

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

glad you are up and running. You should not see this problem again, and MacPorts has already fixed it as much as it can be, so we'll resolve this as a "works for me" as no actionable items.

I could have dumped an "invalid" in there perhaps due to the migration instructions thing, but I think that puts people off.

Note: See TracTickets for help on using tickets.