Topic: Compile error with OS 12.6

I'm running the latest Mac OS (12.6 - Monterey) on an Intel MacMini.

I get this error when I Build:
Compiling Base10Solver.f95

clang: error: invalid version number in '-mmacosx-version-min=12.5'
Error: Last command making (build/Base10Solver.o) returned a bad status
Error: Make execution terminated

Seeing "invalid version number" and "12.5" leads me to believe something needs updating that is out of my reach.
More telling is I get the same error when I build the Hello World sample project.

Please help.

Re: Compile error with OS 12.6

Can you open Software Updates from macOS settings and check if there is an update for Command-line Development Tools?

I'll see if I can replicate the issue on my end in the meantime.

Jeff Armstrong
Approximatrix, LLC

Re: Compile error with OS 12.6

The only "tool" I'm aware of is Apple's XCode app - that I don't have on this Mini. Looking at the AppStore/Upgrades, the "recent" - only thing showing - just shows some graphics and ocean tides apps.

Leaving my code to the side, I opened the Hello World project, saved the source, saved the project, ran the build, and got the same error.

Are you able to get a successful "Hello World" build under OS 12.6?

Re: Compile error with OS 12.6

I was specifically talking about Software Updates in System Preferences, which is where Command-line Development Tools updates are normally seen.  Simply Fortran requires that these be installed, and occasionally the releases get out-of-sync after an operating system update. They might be fine, though.  I just wanted you to check.

Jeff Armstrong
Approximatrix, LLC

Re: Compile error with OS 12.6

That just says, when clicked, "Your software is up to date - Monterey - 12.6"

Re: Compile error with OS 12.6

I can't replicate your issue, but can you check Simply Fortran's About box?  From the application menu, select About Simply Fortran.  What is the build number, and does it say "Legacy Host" anywhere?

Jeff Armstrong
Approximatrix, LLC

7 (edited by designer 2022-09-20 19:59:04)

Re: Compile error with OS 12.6

I wondered if I had downloaded the Legacy version so I downloaded it again yesterday. It shows the same:

Version 3.25 Build 3757 (GTK+)

I've restarted the MacMini from ShutDown. I've removed, download, and installed the latest Intel SimplyFortran.

This Link mentions others having the problem:

https://tinyurl.com/2p8mecj9

I'll continue searching about the clang error

Re: Compile error with OS 12.6

In Simply Fortran, if you open a terminal (via "New Terminal" in the View menu), try entering the following:

which gfortran

It should say /Applications/Simply Fortran.app/Contents/MacOS/gfortran.  Is that correct?

Next, try the following:

sudo xcode-select --reset

to try to reset Apple's Command-line Development Tools.  Next, try:

xcrun --show-sdk-version

What does that command report?

Jeff Armstrong
Approximatrix, LLC

9 (edited by designer 2022-09-20 20:27:53)

Re: Compile error with OS 12.6

Which gfortran returns what you said it should.

The --reset asked for a password, I assumed it was a system password.

the xcrun command line returned: 10.15.4

note that this link also discusses the Clang error:

https://tinyurl.com/2p8mecj9

Here is another link about it:
https://groups.google.com/g/hande-user/c/dtGvyFTJFWE

Unfortunately, they are speaking a language (system-level stuff), I'm not familiar with.

This URL brings up XCode into the discussion:
https://groups.google.com/g/hande-user/c/dtGvyFTJFWE

I used to have Xcode on my machine but removed it because I can't download its updates with ONLY have 32GB free. The App store initially said that's not enough room. But I clicked to download a second time and now it is slowly downloading.

I get a little nervous when reading "help" posts on a different forum and they say, "Download xxx from here" and where "here" is a URL link. I don't know what I'm loading into the system.

The link seems to bring me to a screen for logging into Apple's Developer site. But I'm not an Apple Developer.

Once XCode finishes downloading, probably by Sept 22nd, I'll install and try SimplyFortran again. The post clearly mentions a change Apple made that involves "clang" for compilation.

Re: Compile error with OS 12.6

SUCCESS - reinstalling XCode app fixed the problem.

It just seems wrong that I need to install a 23 GB !! app to run SimplyFortran

Again, I had removed XCode - because it's so large and I don't use it, and also because I couldn't update it - Not enough room (though I had 32GB free). But it did download the second time I clicked the icon in the App Store.

Weird math. Before I downloaded, I had 32GB free. the Size of XCode is given as 23 GB. But now I have 23 GB free - which would make its size closer to 9 GB.

My next Mini is going to have at least a 256 GB drive or more likely 512GB.

Re: Compile error with OS 12.6

Simply Fortran only needs Apple's development libraries and linker.  There are two ways to get them in macOS:

1. Install the Command-line Development Tools
2. Install Xcode

In your case, you had a version of Xcode providing the linker, but that version of Xcode provided an old linker that didn't understand what version of macOS it was running.  It thought the highest possible number was 10.15, but our compiler was telling it that it needed to be 12.5 or higher.

All of these steps are bonkers, I agree.  macOS tends to have some real issues after upgrades pretty regularly.  It drives me up the wall.  It is far and away the most difficult platform for us to support.

Jeff Armstrong
Approximatrix, LLC

12 (edited by designer 2022-09-20 22:59:33)

Re: Compile error with OS 12.6

It sounds like I could just install the Command-line Development Tools and do away with the Behemoth, Xcode.

Do I have to be an Apple developer in order to just get the Command-line Tools? I admit, I walked up to the door - the Apple Developers site, but didn't knock - didn't try my AppleID password. I assumed a "developer" would have a developer password.

I'll start looking into that - but if there's an easy "download Command-line Development Tools Here" link, I'd surely appreciate it. I'd love to get rid of that 23GB XCode App that I'll never use.

Please try to keep supporting Mac. As soon as they release an M2 MacMini, I'll move to AppleSilicon (and more than a 128GB SSD).

Re: Compile error with OS 12.6

No, you don't need to be a "developer" in Apple's eyes to use the Command-line Development Tools.  If you uninstall/delete Xcode, you can install the command-line tools from a terminal with the command:

xcode-select --install

The above command should pop up a window asking if you want to proceed.  It occurs automatically when you start Simply Fortran if they're not already present.  But if you have Xcode, you already have them as well.

Jeff Armstrong
Approximatrix, LLC

14 (edited by designer 2022-09-21 20:13:48)

Re: Compile error with OS 12.6

But if Simply Fortran had a problem with the Tools - as per my error message, why didn't the pop-up automatically come up then? Perhaps it was because they were there - so the pop-up didn't occur. but they were out-of-date, so I got the error.

I'm going to delete Xcode and then run

xcode-select --install

and see if I can get some storage back. If not, I can always install Xcode again.

Re: Compile error with OS 12.6

designer wrote:

Perhaps it was because they were there - so the pop-up didn't occur. but they were out-of-date, so I got the error.

Exactly what happened.

Jeff Armstrong
Approximatrix, LLC

Re: Compile error with OS 12.6

Jeff, I apologize for perpetuating this issue but Apple has been far from Clear about XCode issues. For example, unlike other Apps, I can't just drag XCode from the App folder that appears on my taskbar. Nothing happens - it doesn't go in the trash bin/can. Then there's the issue of support files. Am I supposed to delete everything "XCode"  - for example:

For complete removal of Xcode delete the following:

/Applications/Xcode.app
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
/private/var/db/receipts/com.apple.pkg.Xcode.bom

Or do I only drag XCode App to the trash from the App folder from a Finder window? When I do it that way, instead of from the taskbar App icon, I get a popup asking for password/permission to remove the XCode app.

Normally I'd just keep it around and we wouldn't be having this discussion. But it shows up as 23GB - for something I don't use - and my next largest App file is 3.25GB (for something I also don't use - iMovie).

Unfortunately, you were sort of roped into this fiasco because of Simply Fortran's dependency on those XCode development tools.

If I understand what you said above, I could delete everything from the list above, then when I run Simply Fortran, it will give me a popup that I just "Okay" and it will only grab what it needs. That sounds like the cleanest way.

Re: Compile error with OS 12.6

If you want to delete Xcode, you should be able to simply drag the Xcode app in the Applications folder on your Mac into the Trash.  Dragging it from the taskbar only removes it from the taskbar, nothing else.  There may be some additional files left behind in those other directories, but I doubt they take up much space.

After you uninstall Xcode, open a Terminal and run:

xcode-select --install

There is really no point in allowing Simply Fortran to do it in case Apple has changed the wording of their error messages lately, which happens regularly and can break our detection of the error.

Jeff Armstrong
Approximatrix, LLC

Re: Compile error with OS 12.6

Thank you Jeff -  as a correction, I wasn't dragging XCode from the taskbar. I was clicking on the Applications icon in the taskbar, which opened the Application Window, and I was dragging XCode from that Applications window. Amazing but true, unlike other applications, Xcode would not go in the trash bin. But when I opened my main HD/Applications folder by double clicking from the desktop (viewing as List), I could drag XCode from there. Very Strange.

Anyway - time to put this issue to bed. You've shown me how to get the files Simply Fortran needs without the overhead of XCode itself. My job is to follow through on your recommendation.

Re: Compile error with OS 12.6

No Joy yet. I finally got back to this. I put the XCode app in the trash - but didn't empty it. Then I launched the Terminal app and pasted in:
xcode-select --install

A message appeared saying: xcode-select: error: command line tools are already installed, use "Software Update" to install updates

I ran the Hello World example - saving and building and got that 12.5 issue error.
I move XCode from the trash and put it back in the App folder.

Then the Hello World compiled and ran just fine.

When I look for updates in the App Store, it shows nothing pending.

Once Apple releases the M2 Mini, I'll get one with plenty of HD (SSD) space. And I have 22GB free - which is not nothing.

Just a general grrrrrr that I have to give up 23GB to XCode.

Re: Compile error with OS 12.6

The Xcode "app" is always installed on macOS, but that does not mean Xcode is actually present.  Simply Fortran only requires command-line tools, which install inside that Xcode "app," and they take up considerably less space.  However, there is no alternative, functional linker for macOS other than the one Apple provides, unfortunately.

Jeff Armstrong
Approximatrix, LLC