使用R安裝外源包時(shí)發(fā)現(xiàn)報(bào)錯(cuò):‘for’ loop initial declarations are only allowed in C99 mode:
這是因?yàn)間cc基于c89標(biāo)準(zhǔn)趋艘,換成C99標(biāo)準(zhǔn)就可以了急鳄,使用withr包可以指定使用的gcc標(biāo)準(zhǔn):
library(withr)
with_makevars(c(PKG_CFLAGS = "-std=c11"),
install.packages('seriation'),? ? ????# my installation code
assignment = "+=")
參考
https://stackoverflow.com/questions/35198301/how-use-the-option-std-c99-for-installing-r-packages