Actually I want to install the CausalImpact
package which depends on bsts
. On both, Ubuntu 22.4LTS and CentOS 7. There are two old answers around - 1, 2 - recommending to update g++
and gfortran
. However, my versions appear to be much newer:
## Ubuntu 22.04LTS
g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0
GNU Fortran (Ubuntu 11.2.0-19ubuntu1) 11.2.0
## CentOS 7
g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
GNU Fortran (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
These are the outputs:
Under Ubuntu 22.04LTS:
> install.packages('bsts')
Installing package into ‘/home/jay/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/bsts_0.9.7.tar.gz'
Content type 'application/x-gzip' length 298345 bytes (291 KB)
==================================================
downloaded 291 KB
* installing *source* package ‘bsts’ ...
** package ‘bsts’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I`/usr/local/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.2/Boom/include' -I/usr/local/include -fpic -g -O2 -c aggregate_time_series.cc -o aggregate_time_series.o
g++ -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I`/usr/local/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.2/Boom/include' -I/usr/local/include -fpic -g -O2 -c bsts.cc -o bsts.o
In file included from bsts.cc:20:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
23 | #include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/usr/local/lib/R/etc/Makeconf:175: bsts.o] Error 1
ERROR: compilation failed for package ‘bsts’
* removing ‘/home/jay/R/x86_64-pc-linux-gnu-library/4.2/bsts’
Warning in install.packages :
installation of package ‘bsts’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpvFsHr1/downloaded_packages’
Under CentOS 7:
> install.packages('bsts')
Installing package into ‘/home/jay/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://stat.ethz.ch/CRAN/src/contrib/bsts_0.9.7.tar.gz'
Content type 'application/x-gzip' length 298345 bytes (291 KB)
==================================================
downloaded 291 KB
* installing *source* package ‘bsts’ ...
** package ‘bsts’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c aggregate_time_series.cc -o aggregate_time_series.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c bsts.cc -o bsts.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c bsts_init.cc -o bsts_init.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c create_dynamic_intercept_state_model.cpp -o create_dynamic_intercept_state_model.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c create_shared_state_model.cpp -o create_shared_state_model.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c create_state_model.cpp -o create_state_model.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c dirm.cc -o dirm.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c dynamic_intercept_model_manager.cc -o dynamic_intercept_model_manager.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c get_date_ranges.cc -o get_date_ranges.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c mbsts.cc -o mbsts.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c mixed_frequency.cc -o mixed_frequency.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c model_manager.cc -o model_manager.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c multivariate_gaussian_model_manager.cc -o multivariate_gaussian_model_manager.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c state_space_gaussian_model_manager.cc -o state_space_gaussian_model_manager.o
g++ -std=gnu++11 -I"/opt/R/4.1.0/lib/R/include" -DNDEBUG -I`/opt/R/4.1.0/lib/R/bin/Rscript -e "cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE -I'/home/jay/R/x86_64-pc-linux-gnu-library/4.1/Boom/include' -I/usr/local/include -fpic -g -O2 -c state_space_logit_model_manager.cc -o state_space_logit_model_manager.o
In file included from dynamic_intercept_model_manager.h:20,
from dynamic_intercept_model_manager.cc:17:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: dynamic_intercept_model_manager.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from model_manager.cc:19:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: model_manager.o] Error 1
In file included from state_space_gaussian_model_manager.h:20,
from state_space_gaussian_model_manager.cc:17:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: state_space_gaussian_model_manager.o] Error 1
In file included from create_shared_state_model.cpp:19:
create_shared_state_model.h:24:10: fatal error: Models/StateSpace/MultivariateStateSpaceRegressionModel.hpp: No such file or directory
#include <Models/StateSpace/MultivariateStateSpaceRegressionModel.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:175: create_shared_state_model.o] Error 1
In file included from bsts.cc:20:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: bsts.o] Error 1
In file included from multivariate_gaussian_model_manager.cc:19:
utils.h:25:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from mbsts.cc:20:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: multivariate_gaussian_model_manager.o] Error 1
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: mbsts.o] Error 1
In file included from dirm.cc:20:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: dirm.o] Error 1
In file included from state_space_logit_model_manager.h:20,
from state_space_logit_model_manager.cc:17:
model_manager.h:23:10: fatal error: Models/StateSpace/MultivariateStateSpaceModelBase.hpp: No such file or directory
#include "Models/StateSpace/MultivariateStateSpaceModelBase.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:173: state_space_logit_model_manager.o] Error 1
create_state_model.cpp: In function ‘int BOOM::bsts::{anonymous}::StateModelPosition(BOOM::StateSpaceModelBase*, BOOM::StateModel*)’:
create_state_model.cpp:773:39: error: request for member ‘get’ in ‘model->BOOM::StateSpaceModelBase::state_model(i)’, which is of pointer type ‘BOOM::StateModelBase*’ (maybe you meant to use ‘->’ ?)
if (model->state_model(i).get() == state_model) {
^~~
make: *** [/opt/R/4.1.0/lib/R/etc/Makeconf:175: create_state_model.o] Error 1
ERROR: compilation failed for package ‘bsts’
* removing ‘/home/jay/R/x86_64-pc-linux-gnu-library/4.1/bsts’
Warning in install.packages :
installation of package ‘bsts’ had non-zero exit status
The downloaded source packages are in
‘/data/rtmp/Rtmp9tCMQo/downloaded_packages’
Note: Installations of Boom
appear to be successful.
> library(Boom)
Loading required package: MASS
Attaching package: ‘Boom’
The following object is masked from ‘package:stats’:
rWishart
Any clues to get bsts
installed?