Initial error reporting environment
Oracle VM VirtualBox 6.1.22
kunbuntu-21.04
memory 2048MB
storage space 20g
Error reporting and Solutions
If I directly install. Packages (‘prophet ‘) in R according to the above environment, three environment dependent errors will be reported, namely libcurl, libdev and rstan
first solve the problem that libcurl and libdev are not installed. First q() exit the R environment and install the two development tools:
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libv8-dev
Then enter the R environment and reinstall rstan. The key errors are as follows:
g++: internal compiler error: Killed (program cc1plus)
ERROR: compilation failed for package 'rstan'
In install.packages("rstan") :
installation of package 'rstan' had non-zero exit status
There are many similar error reports and strange solutions on the Internet. In fact, most cases are caused by insufficient memory allocation. You can adjust the allocated memory to 4096mb in the virtual machine. After installing the above dependencies, reinstall. Packages (‘prophet ‘) and the installation will succeed.