Since a recent reinstall of my compiler toolchain I encounter a strange error that prevents me from compiling any models with rstan as well as compiling rstan itself.
For example
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
(or any attempt to compile an rstan model with any precompiled version of rstan) gives me
error: unknown target CPU 'vortex'
note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, geode
make: *** [Module.o] Error 1
So CPU target “vortex” does not seem to be recognized as valid CPU target by clang 13.0.0. I couldn’t find much about this “vortex” target but what I found pointed to some (outdated?) aliases of arm64
type processors, which are the ones used in my mac.
This is my setup:
- MacOS Monterey 12.1
- M1 Max Chip
- R 4.1.2 binary for Mac M1 (arm64) from https://cran.r-project.org/
- The current version of CommanLineTools, with clang 13.0.0:
clang --version
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: arm64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I can compile and run cmdstanr models normally, with cmdstan build with the compiler above, so Stan itself does not seem to be broken.
Any suggestions would be highly appreciated!