# Will R Work on Apple Silicon? R needs a Fortran 90 compiler

**URL:** https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417
**Category:** Uncategorized
**Created:** [November 11, 2020, 5:40pm UTC](https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417 "2020-11-11T17:40:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)
#### Post date: [November 11, 2020, 5:40pm UTC](https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417/1 "2020-11-11T17:40:09Z")

</div>

Discussed at [Hacker News](https://news.ycombinator.com/item?id=25057985). It would be nice if Apple provided some funding for the gfortran port.

[Will R Work on Apple Silicon?](https://developer.r-project.org/Blog/public/2020/11/02/will-r-work-on-apple-silicon/)  
by Tomas Kalibera and Simon Urbanek  
First published: 2020/11/02

At WWDC 2020 earlier this year, Apple announced a transition from Intel to ARM-based processors in their laptops. This blog is about the prospects of when R will work on that platform, based on experimentation on a developer machine running A12Z, one of the “Apple silicon” processors.

The new platform will include [Rosetta 2](https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment), a dynamic translation framework which runs binaries built for 64-bit Intel Macs using just-in-time, dynamic translation of binary code. The good news is that R seems to be working fine with the dynamic translation, so R users don’t need to worry even if they use current releases. However, the interesting question is whether R will also work natively. Native execution is expected to be faster, and the transition probably has to be done eventually, anyway.

The executive summary is: while there is currently no released Fortran compiler for the platform, a development version of GNU Fortran already seems to be working fine. There are some surprising results with NaN payload propagation leading to unexpected results when computing with numeric NAs, but these can be overcome by changing the mode of the floating-point unit, which has already been done in R-devel. More details follow in this post.

…

---

<div class="post-metadata">

### Author: ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)
#### Post date: [November 11, 2020, 5:46pm UTC](https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417/2 "2020-11-11T17:46:36Z")

</div>

The NAG Fortran compiler also works there.

---

<div class="post-metadata">

### Author: ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)
#### Post date: [November 11, 2020, 7:41pm UTC](https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417/3 "2020-11-11T19:41:50Z")

</div>

Concerning Intel macOS, gfortran can be installed via _homebrew_:

> **[gfortran](https://formulae.brew.sh/cask/gfortran#default)**
>
> Homebrew’s package index

About _homebrew_ transition to Apple Silicon:

> <https://github.com/Homebrew/brew/issues/7857>
>
> A detailed description of the proposed feature
> This is an overview of compatibility issues and work items related to upcoming macOS versions...

---

<div class="post-metadata">

### Author: ![billlong](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@billlong](https://fortran-lang.discourse.group/u/billlong)
#### Post date: [November 12, 2020, 4:53am UTC](https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417/4 "2020-11-12T04:53:31Z")

</div>

Apple went through this “translation” phase when they switched from PowerPC (or was it Motorola?) chips to Intel. The ARM chips are not scheduled for the normal-size laptops or the tower for some time. Still, the vendor of a particular Chip is on the hook to help GCC with the code-gen interface to their hardware, and Apple should definitely do this. I doubt they want performance numbers published based on the translated code. Besides, they have plenty of cash.

I’ve always wanted GCC to provide a .dmg file for gfortran that included the compiler and all the required libraries (including the OpenCoarrays stuff). Things like HomeBrew are fine for the home hobbist, but the corp security would likely not allow software like that to be installed on company laptops. As it stands now, installing gfortran from the GCC distribution is absolute torture. I spent the multiple days to install 6.3 and have never upgraded because of the pain. Apple software is supposed to be installed from a .dmg file. Apple needs to fund this if GCC won’t.

---

<div class="post-metadata">

### Author: ![billlong](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@billlong](https://fortran-lang.discourse.group/u/billlong)
#### Post date: [November 12, 2020, 12:49pm UTC](https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417/6 "2020-11-12T12:49:05Z")

</div>

Well, GCC does not come with the Mac software - they supply CLANG for C and no Fortran. Likewise, there is no gmake, just the standard make. Nor configure, which is a profoundly defective piece of software anyway.

---

<div class="post-metadata">

### Author: ![lkedward](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/lkedward/32/72_2.png) [@lkedward](https://fortran-lang.discourse.group/u/lkedward)
#### Post date: [November 12, 2020, 1:15pm UTC](https://fortran-lang.discourse.group/t/will-r-work-on-apple-silicon-r-needs-a-fortran-90-compiler/417/7 "2020-11-12T13:15:04Z")

</div>

See here for the ‘private development branch’ mentioned in the article linked in the original post:

> **[iains/gcc-darwin-arm64](https://github.com/iains/gcc-darwin-arm64)**
>
> \[August 2020, created\] Branches with work in progress on making an Arm64 Darwin port. - iains/gcc-darwin-arm64

> <https://github.com/iains/gcc-darwin-arm64/issues/23>
>
> With the three patches submitted today (see #9), the status of the gfortran testsuite is:
> === gfortran Summary ===
> \# of expected...

Also, as Ondrej pointed out, see NAG’s announcement from a couple of days ago:

> **[Fortran on your Mac! NAG announce first Fortran Compiler for Apple Silicon Macs](https://www.nag.com/news/first-fortran-compiler-apple-silicon-macs)**

There appears to be a fair amount of interest in supporting Fortran on Apple silicon due to a number of Python libraries that require it. However there is unlikely to be any support from Apple towards this IMO.
