Never seen before cmdstanr compliation error message

I run R on Ubuntu 11.3.0-1ubuntu1~22.04 with g++ version 11.3. I am pretty sure this error is related to some of the system upgrades. Is there an easy fix or check? Thank you.

Compiling Stan program...
lto1: fatal error: bytecode stream in file ‘src/cmdstan/main.o’ generated with LTO version 11.2 instead of the expected 11.3
compilation terminated.

lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed

collect2: error: ld returned 1 exit status

make: *** [make/program:59: /tmp/RtmpkfeAUi/model-b2134452d1d] Error 1

Error: An error occured during compilation! See the message above for more information.

I would guess that your g++ compiler has been updated since you first installed cmdstanr, so you just need to rebuild cmdstan under the new compiler:

cmdstanr::rebuild_cmdstan()
1 Like