Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Installing gfortran in mac osx Big Sur

2,892 views
Skip to first unread message

Ganesh Sundaram

unread,
May 29, 2021, 1:50:42 AM5/29/21
to
Hello.

I'm new to Mac.
How does one reliably install gfortran in mac osx?
Xcode Tools and command line tools have already installed.
If there a way install gfortran from xcode itself?
Or should I download from GitHub
https://github.com/fxcoudert/gfortran-for-macOS/releases
and install the package?
Apple says it cannot verify the package.

Any input on this will be appreciated.
Thanks and regards,
Ganesh

Ron Shepard

unread,
May 29, 2021, 2:59:18 AM5/29/21
to
There are several options. One is the fink package manager.

https://www.finkproject.org

After fink is installed, you install gfortran with the command

fink install gcc10

Other options are Homebrew

https://brew.sh

and also there have been some recent discussions here of Simply Fortran,
which requires a license.

$.02 -Ron Shepard

JRR

unread,
May 29, 2021, 10:47:46 AM5/29/21
to
Am 29.05.21 um 07:50 schrieb Ganesh Sundaram:
Hi Ganesh,
I always install gcc by hand, downloading the three
dependency packages, libgmp, libmpfr and libmpc and then
just do configure, make, make install as usual.


--
Juergen Reuter
Theoretical Particle Physics
Deutsches Elektronen-Synchrotron (DESY)
Hamburg, Germany

Ron Shepard

unread,
May 29, 2021, 11:40:49 AM5/29/21
to
On 5/29/21 9:47 AM, JRR wrote:
> Am 29.05.21 um 07:50 schrieb Ganesh Sundaram:
>> Hello.
>>
>> I'm new to Mac.
>> How does one reliably install gfortran in mac osx?
>> Xcode Tools and command line tools have already installed.
>> If there a way install gfortran from xcode itself?
>> Or should I download from GitHub
>> https://github.com/fxcoudert/gfortran-for-macOS/releases
>> and install the package?
>> Apple says it cannot verify the package.
>>
>> Any input on this will be appreciated.
>> Thanks and regards,
>> Ganesh
>>
>
> Hi Ganesh,
> I always install gcc by hand, downloading the three
> dependency packages, libgmp, libmpfr and libmpc and then
> just do configure, make, make install as usual.

If you want the latest version, then this is the best way to install it.
The package managers, including fink, are usually a few months behind in
the release schedule. For example, you can install gcc11 straight this
way, but with fink right now, gcc10 is the most recent version available.

One difference is where the software gets installed. With the straight
installs, it goes into /usr/local, /usr/local/bin, and so on in the
system directories. With fink it goes into its own subdirectory, either
/sw or /opt/sw depending on which version of MacOS you are running. This
makes it easy to uninstall, or update later, when necessary without
leaving remnants behind.

Also, the package managers have hundreds of software packages available,
from gnuplot to various versions of python, that one might also want. So
if you are going to install the package manager anyway for these other
utilities, then gcc fits in. But if you only want gcc/gfortran and
nothing else, then the package managers are just a redundant step.

$.02 -Ron Shepard

gah4

unread,
Jun 6, 2021, 3:12:15 PM6/6/21
to
On Friday, May 28, 2021 at 10:50:42 PM UTC-7, Ganesh Sundaram wrote:
> Hello.
>
> I'm new to Mac.
> How does one reliably install gfortran in mac osx?
> Xcode Tools and command line tools have already installed.

I just installed Gfortran 6.3 on OSX 10.12 Sierra from that site.

That seems to be the version it suggests for 10.12, and is plenty new enough for me.

It doesn't say what happens if you try newer ones on older OS X versions, but since the program
I was compiling is about 50 years old, I wasn't so worried. More of a problem is deleted features,
but they seem to be pretty good about keeping those.

The one I did find is that it uses the feature of EQUIVALENCE from Fortran 66, deleted in
Fortran 77, of using one subscript in EQUIVALENCE for a 2D (or more) array. It wasn't so
hard to change, but was an interesting feature.

Does anyone know if the newer ones are supposed to work on older OS X?


Steve Lionel

unread,
Jun 6, 2021, 5:26:21 PM6/6/21
to
On 6/6/2021 3:12 PM, gah4 wrote:
> The one I did find is that it uses the feature of EQUIVALENCE from Fortran 66, deleted in
> Fortran 77, of using one subscript in EQUIVALENCE for a 2D (or more) array. It wasn't so
> hard to change, but was an interesting feature.

EQUIVALENCE was not deleted in FORTRAN 77. It still exists in Fortran
2018 (though, as of that version, it is deemed "obsolescent".) It's good
that you replaced it, but I am sure that gfortran 6 did not complain
about EQUIVALENCE being deleted or obsolescent.

--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org

gah4

unread,
Jun 6, 2021, 6:57:00 PM6/6/21
to
On Sunday, June 6, 2021 at 2:26:21 PM UTC-7, Steve Lionel wrote:
> On 6/6/2021 3:12 PM, gah4 wrote:
> > The one I did find is that it uses the feature of EQUIVALENCE from Fortran 66, deleted in
> > Fortran 77, of using one subscript in EQUIVALENCE for a 2D (or more) array. It wasn't so
> > hard to change, but was an interesting feature.

> EQUIVALENCE was not deleted in FORTRAN 77. It still exists in Fortran
> 2018 (though, as of that version, it is deemed "obsolescent".) It's good
> that you replaced it, but I am sure that gfortran 6 did not complain
> about EQUIVALENCE being deleted or obsolescent.

No, not EQUIVALENCE.

Just the feature of using one subscript for a 2D array in an
EQUIVALENCE statement. Why one would want to do that,
I don't know, but IBM seems to like to do it.

Fortunately, they did it the same way in all subroutines.

The date on one of the input files is July 7th, 1967, so barely Fortran 66.

Ev. Drikos

unread,
Jun 7, 2021, 9:34:36 AM6/7/21
to
On 06/06/2021 22:12, gah4 wrote:
>
> Does anyone know if the newer ones are supposed to work on older OS X?
>
>

I've installed 7.4 on 10.9 and the following commit message gives me the
large picture of my mac-mini:
https://github.com/drikosev/pc/commits/master?after=b453f10230af798223006151a53baed956ee365c+34&branch=master&path%5B%5D=README


GNU Fortran Version Tests
7.4.0 on OS X 10.10
7.5.0 on OS X 10.11
8.2.0 on OS X 10.12
8.4.0 on OS X 10.11 & CentOS 7.6
4.8.5 on OS X 10.10-10.11 & CentOS 7.6


Hope this was the question,
Ev. Drikos

gah4

unread,
Jun 7, 2021, 10:24:03 AM6/7/21
to
On Monday, June 7, 2021 at 6:34:36 AM UTC-7, Ev. Drikos wrote:

(snip, I wrote)
> > Does anyone know if the newer ones are supposed to work on older OS X?

(snip)
> GNU Fortran Version Tests
> 7.4.0 on OS X 10.10
> 7.5.0 on OS X 10.11
> 8.2.0 on OS X 10.12
> 8.4.0 on OS X 10.11 & CentOS 7.6
> 4.8.5 on OS X 10.10-10.11 & CentOS 7.6

OK, the install page seems to suggest 6.3.0 for OS X 10.12, and it does work.

I ran in to an ICE with an older version on Linux, so decided to try this as a way
to get around that. Too old to send a bug report.

I have another OS X machine, I might try a newer version on that one.

Otherwise, I have more problems with deleted features, than with not yet
added features.

But I might also try Spice 2g6 which is from 1983.



Ron Shepard

unread,
Jun 7, 2021, 1:14:39 PM6/7/21
to
On 6/6/21 2:12 PM, gah4 wrote:
> Does anyone know if the newer ones are supposed to work on older OS X?

I'm running gcc/gfortran 10.3.0 on MacOS 10.13.6 on this machine I'm
posting from. That is not as old as you are asking about, but I cannot
upgrade the OS any further on that particular hardware combination, so
it is getting more outdated as time goes by. In the last few
gcc/gfortran updates, I remember the tricky part was getting the right
version of Xcode installed, which is 10.1 for this combination of
software and hardware. I'm only doing command line development on this
machine, so I don't care if the Xcode GUI works or not, but it was still
basically a binary search to find the most recent Xcode that worked. I
still have one PowerPC Mac running. That one dates back to 2004, I
think, and it has IBM xlf and gfortran running on it. It once ran for
about 1100 days without needing to be rebooted, and that was only
because of a power outage. Apple builds really good hardware. I only
wish they would support fortran directly in order to make all this
version number coordination easier on all of us.

$.02 -Ron Shepard

Ev. Drikos

unread,
Jun 8, 2021, 8:59:15 AM6/8/21
to
On 07/06/2021 17:24, gah4 wrote:
> On Monday, June 7, 2021 at 6:34:36 AM UTC-7, Ev. Drikos wrote:
>
> (snip, I wrote)
>>> Does anyone know if the newer ones are supposed to work on older OS X?
>
> (snip)
>> GNU Fortran Version Tests
>> 7.4.0 on OS X 10.10
> ...
>
> But I might also try Spice 2g6 which is from 1983.
>
>
>

For what it's worth, the gfortran-4.8.5 testsuite ie on a certain
machine lasts one hour in 10.10 or 10.11, two in 10.13, and on a
slightly newer MBPR running 10.14 lasts four hours. So, older
OS X versions remain useful for certain tasks.

Ev. Drikos

Pfesesani van Zyl

unread,
Jul 30, 2021, 9:46:17 AM7/30/21
to
Good day all,

I'm a newbie also trying to install gfortran on MacOS BigSur with M1 chip. However, I'm
coming across a lot of "This release does not yet support macOS 11 (Big Sur)"
comments on various post e.g. Fink (suggested here). Is there anyone who
has successfully managed to load and run gfortran on an M1 chip Macbook pro?

Best,
Pfesi

bht

unread,
Jul 31, 2021, 12:34:07 PM7/31/21
to
I was able to install a native gfortran version with homebrew and as part of a conda-forge (miniforge) installation of M1 Python. FWIW, I saw runtimes of ~60% on a 2021 M1 laptop compared to a 2020 Intel laptop from our hybrid Python/Fortran code.

Brian
0 new messages