Skip to content
Prev 7935 / 12125 Next

[R-pkg-devel] Build Environment for Mac OS Catalina

Russel,

this is Mac-specific hence more appropriate for R-SIG-Mac, so moving there.

If you are running Catalina then you have Intel Mac so for CRAN R you simply need XCode and that's it (on a clean Mac you can simply run sudo xcode-select --install). There is nothing special - the only exception is if your package contains Fortran code in which case you just install a Fortran compilers from https://mac.r-project.org/tools/gfortran-8.2-Mojave.dmg

However, since you are using Homebrew then things are a lot more complicated. Homebrew toolchains are not compatible with native Mac binaries and they create its own ecosystem which seems to be broken according to your post.

I would recommend deleting /opt/local then check if you have other incompatible libraries in /usr/local. For severe case of misconfiguration best way to remove (or move aside) everything from /usr/local and start from scratch.

Typically the easiest is to install CRAN R as that does not conflict with anything native and it does not require special tools. You can still use Homebrew to install 3rd party libraries that you may need, but make sure you do NOT install any compilers as they tend to wreak havoc on the system with the conflicting libraries. If your dependencies are supported by CRAN then you can fetch them from https://mac.r-project.org/bin/ or you can re-build them yourself using https://github.com/R-macos/recipes

Cheers,
Simon