Using OSX? Compiling an R package from source? Issues with ‘-fopenmp’? Try this.

You can file this one under “I may have the very specific solution if you’re having exactly the same problem.�

So: if you’re running some R code and you see a warning like this:

And installation of TMB from source fails like this:

And you use Homebrew – first, do this:

Then create the file ~/.R/Makevars, if it does not exist and edit its contents to look like this:

Your R package should now compile without error. If it works as it did for me 🙂

Related