I am trying to set up the Template Model Builder (TMB) package in R on my new M1 Mac. I have installed the silicon version of R and followed and installed TMB from CRAN. However, after I have compiled A C++ template function with compile("file.cpp")
, I get the following error when I run dyn.load(dynlib("file"))
: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
.
I have tried to follow the tips from here, in the hopes that this would change the compilation architecture. Does anyone know how to resolve this error, or has anyone been able to set up and use TMB on an M1 Mac?