gcc<10 on M1 Mac

Maxim Abalenkov maxim.abalenkov at gmail.com
Fri Jun 18 15:16:36 UTC 2021


Hello Franco et al.,

How are you? I’m not an expert on MacPorts dependencies, but you may/should be able to compile your Fortran code with the GNU11 toolchain. Potentially, you only need to specify the Fortran standard that your code supports. This is possible via the -std flag to gfortran, e.g. 

  gfortran -std=f95 …

-std=std
Specify the standard to which the program is expected to conform, which may be one of ‘f95’, ‘f2003’, ‘f2008’, ‘f2018’, ‘gnu’, or ‘legacy’. The default value for std is ‘gnu’, which specifies a superset of the latest Fortran standard that includes all of the extensions supported by GNU Fortran, although warnings will be given for obsolete extensions not recommended for use in new code. The ‘legacy’ value is equivalent but without the warnings for obsolete extensions, and may be useful for old non-standard programs. The ‘f95’, ‘f2003’, ‘f2008’, and ‘f2018’ values specify strict conformance to the Fortran 95, Fortran 2003, Fortran 2008 and Fortran 2018 standards, respectively; errors are given for all extensions beyond the relevant language standard, and warnings are given for the Fortran 77 features that are permitted but obsolescent in later standards. The deprecated option ‘-std=f2008ts’ acts as an alias for ‘-std=f2018’. It is only present for backwards compatibility with earlier gfortran versions and should not be used any more.

For more information please see:

  https://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html

—
Best wishes,
Maxim

Maxim Abalenkov \\ maxim.abalenkov at gmail.com
+44 7 486 486 505 \\ http://mabalenk.gitlab.io

> On 18 Jun 2021, at 18:06, VACCARI FRANCO <vaccari at units.it> wrote:
> 
> I’ve a temporary access to a new MacBook Air with M1 processor, to test on that Mac all our home made programs, mainly fortran. All external packages needed by our workflow were successfully installed (gnuplot, ImageMagick, gmt4 and many others), and I installed gcc11. 
> 
> Such modern compiler complains about some features in our code that are no longer supported, and fails to produce the executable. Of course one day we should update that code, but for the time being, and having to give back that Mac, I wanted to try with an older compiler. I installed gcc10 but that didn’t help.
> 
> I know that gcc8 works with our codes, so I tried to install that but failed.
> 
> The problem is that gcc8 requires libcc9, and that is marked as incompatible.
> 
> % sudo port install gcc8
> --->  Computing dependencies for gcc8
> The following dependencies will be installed: 
> libgcc8
> libgcc9
> Continue? [Y/n]: 
> --->  Fetching archive for libgcc9
> --->  Attempting to fetch libgcc9-9.4.0_0.darwin_20.arm64.tbz2 from https://fra.de.packages.macports.org/libgcc9
> --->  Attempting to fetch libgcc9-9.4.0_0.darwin_20.arm64.tbz2 from http://fco.it.packages.macports.org/libgcc9
> --->  Attempting to fetch libgcc9-9.4.0_0.darwin_20.arm64.tbz2 from https://packages.macports.org/libgcc9
> --->  Fetching distfiles for libgcc9
> Error: gcc9 9.4.0 is not supported on Darwin 20 arm
> Error: Failed to fetch libgcc9: incompatible OS X version
> Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/main.log for details.
> Error: Follow https://guide.macports.org/#project.tickets if you believe there
> is a bug.
> Error: Processing of port gcc8 failed
> locadmin at eAir ~ %
> 
> Actually any version from 5 to 9 requires libcc9
> 
> sudo port install gcc5
> --->  Computing dependencies for gcc5
> The following dependencies will be installed: 
> isl18
> libgcc6
> libgcc7
> libgcc8
> libgcc9
> Continue? [Y/n]:
> 
> and therefore fails to install. 
> 
> gcc49 is a different story, as it’s clearly declared unsupported for Xcode 9 or greater:
> 
> sudo port install gcc49
> Password:
> --->  Fetching distfiles for gcc49
> Error: building gcc49 is not supported with Xcode 9 or greater
> Error: Failed to fetch gcc49: unsupported platform
> Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc49/gcc49/main.log for details.
> Error: Follow https://guide.macports.org/#project.tickets if you believe there
> is a bug.
> Error: Processing of port gcc49 failed
> 
> Is it really so that gcc9 and earlier will never be compatible with M1 Macs? And why libgcc9 is needed by gcc5?
> 
> Thanks
> 
> Franco
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20210618/3d2116cc/attachment.htm>


More information about the macports-users mailing list