jebyrnes
jebyrnes

Reputation: 9332

R M1 builds will not compile packages

I have recently installed the arm64 version of R from the Mac nightly builds page. It's working great! Except - for packages that require compilation. For example, if I try and install xfun which is required for blogdown, I get the following error

ld: warning: ignoring file /usr/local/opt/llvm/lib/libc++.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: in '/usr/local/opt/llvm/lib/libunwind.dylib', building for macOS-arm64 but attempting to link with file built for macOS-x86_64

So..... how to fix this in order to keep things trucking?

For reference, here is my sessionInfo()


> sessionInfo()
R version 4.1.0 alpha (2021-04-26 r80229)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.2.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

loaded via a namespace (and not attached):
[1] compiler_4.1.0 tools_4.1.0    parallel_4.1.0

Upvotes: 4

Views: 501

Answers (2)

dpritch
dpritch

Reputation: 1269

For me I think the issue was that I had somehow installed the Intel R build. When I looked in /Library/Frameworks/R.framework/Versions the directory corresponding to the latest version didn't have a -arm64 suffix. That is to say that I had the following situation.

/Library/Frameworks/R.framework/Versions$ ls
4.1-arm64  4.2  Current

After installing the ARM R build and deleting the 4.2 directory things started working and /Library/Frameworks/R.framework/Versions looks like the following.

/Library/Frameworks/R.framework/Versions$ ls
4.1-arm64  4.2-arm64  Current

Upvotes: 0

jebyrnes
jebyrnes

Reputation: 9332

OK. This was due to setting some MAKEVARS from an older R installation.

I feel ashamed.

But, if anyone else is having this problem, look at ~/.R/Makevars

Now to solve gfortran issues.

Upvotes: 3

Related Questions