Blog post on compiling R for new Apple ARM-based computers

For those not familiar with the internals of R, much of the discussion is about ensuring that the missing data value, NA, for floating point arrays is propagated in some computations. The NA value is one of the NaN patterns and it is important in R that the same pattern be returned from a calculation like 1.0 * NA.

That part of the discussion is not relevant to Julia compilation but other parts will be of interest.


Fascinating read. I would have thought that all platforms under the sun would have a Fortran 90 compiler (otherwise, the engineers would be ashamed to release the chip), but apparently it is now too much of a niche application for Apple to prioritize.

1 Like

One of the first people I saw chastising Apple about the lack of a Fortran compiler was @StefanKarpinski in, I believe, a tweet. I went to his twitter feed to see if I could find the tweet but got too distracted in reading his other tweets and retweets.


It was this tweet:

Which did lead to a productive discussion with some folks at Apple and progress on this issue, ultimately leading to gfortran being ported enough to build Julia, R and NumPy.


All the help they’ve provided to this effort is answering some questions:

GCC is not a project they want to support (part of GNU, GPL-licensed…). Interestingly enough there is now a Fortran front-end for LLVM called Flang, but currently it can only parse the source code, it still can’t translate it to LLVM IR. It took less to port GCC to the new architecture than to make Flang actually work.