steve-the-bayesian / BOOM

A C++ library for Bayesian modeling, mainly through Markov chain Monte Carlo, but with a few other methods supported. BOOM = "Bayesian Object Oriented Modeling". It is also the sound your computer makes when it crashes.
GNU Lesser General Public License v2.1
35 stars 14 forks source link

Compile Errors since Alpine 3.17 #71

Closed marc-mabe closed 1 year ago

marc-mabe commented 1 year ago

Since Alpine 3.17 I'm getting a compile error on building my docker image

install.packages(
    "CausalImpact",
    verbose=TRUE,
    clean=TRUE,
    repos="https://cloud.r-project.org/",
    INSTALL_opts=c("--no-help", "--no-html")
)
g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/LocalLinearTrend.cpp -o Models/StateSpace/StateModels/LocalLinearTrend.o
make: *** [/usr/lib/R/etc/Makeconf:178: Models/StateSpace/StateModels/Holiday.o] Error 1
make: *** Waiting for unfinished jobs....
ERROR: compilation failed for package ‘Boom’

Log:

18:14:48  * installing *source* package ‘Boom’ ...
18:14:48  ** package ‘Boom’ successfully unpacked and MD5 sums checked
18:14:48  ** using staged installation
18:14:48  ** libs
18:14:48  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c boom_r_tools.cpp -o boom_r_tools.o

<snip>

18:18:38  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c LinAlg/MatrixPartition.cpp -o LinAlg/MatrixPartition.o
18:18:39  In file included from ../inst/include/Eigen/Core:205,
18:18:39                   from ../inst/include/Eigen/Cholesky:11,
18:18:39                   from LinAlg/Cholesky.cpp:22:
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:46:40: warning: ignoring attributes on template argument '__m128i' [-Wignored-attributes]
18:18:39     46 | typedef eigen_packet_wrapper<__m128i, 0> Packet4i;
18:18:39        |                                        ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:47:40: warning: ignoring attributes on template argument '__m128i' [-Wignored-attributes]
18:18:39     47 | typedef eigen_packet_wrapper<__m128i, 1> Packet16b;
18:18:39        |                                        ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:49:39: warning: ignoring attributes on template argument '__m128' [-Wignored-attributes]
18:18:39     49 | template<> struct is_arithmetic<__m128>  { enum { value = true }; };
18:18:39        |                                       ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:50:40: warning: ignoring attributes on template argument '__m128i' [-Wignored-attributes]
18:18:39     50 | template<> struct is_arithmetic<__m128i> { enum { value = true }; };
18:18:39        |                                        ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:51:40: warning: ignoring attributes on template argument '__m128d' [-Wignored-attributes]
18:18:39     51 | template<> struct is_arithmetic<__m128d> { enum { value = true }; };
18:18:39        |                                        ^
18:18:39  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c LinAlg/QR.cpp -o LinAlg/QR.o
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:222:43: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes]
18:18:39    222 | template<> struct unpacket_traits<Packet4f> {
18:18:39        |                                           ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:228:43: warning: ignoring attributes on template argument 'Eigen::internal::Packet2d' {aka '__m128d'} [-Wignored-attributes]
18:18:39    228 | template<> struct unpacket_traits<Packet2d> {
18:18:39        |                                           ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:1124:34: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes]
18:18:39   1124 | ptranspose(PacketBlock<Packet4f,4>& kernel) {
18:18:39        |                                  ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:1129:34: warning: ignoring attributes on template argument 'Eigen::internal::Packet2d' {aka '__m128d'} [-Wignored-attributes]
18:18:39   1129 | ptranspose(PacketBlock<Packet2d,2>& kernel) {
18:18:39        |                                  ^
18:18:39  In file included from ../inst/include/Eigen/Core:174:
18:18:39  ../inst/include/Eigen/src/Core/arch/Default/ConjHelper.h:16:60: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes]
18:18:39     16 |   struct conj_helper<PACKET_REAL, PACKET_CPLX, false, false> {          \
18:18:39        |                                                            ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/Complex.h:173:1: note: in expansion of macro 'EIGEN_MAKE_CONJ_HELPER_CPLX_REAL'
18:18:39    173 | EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet2cf,Packet4f)
18:18:39        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18:18:39  ../inst/include/Eigen/src/Core/arch/Default/ConjHelper.h:29:60: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes]
18:18:39     29 |   struct conj_helper<PACKET_CPLX, PACKET_REAL, false, false> {          \
18:18:39        |                                                            ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/Complex.h:173:1: note: in expansion of macro 'EIGEN_MAKE_CONJ_HELPER_CPLX_REAL'
18:18:39    173 | EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet2cf,Packet4f)
18:18:39        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18:18:39  ../inst/include/Eigen/src/Core/arch/Default/ConjHelper.h:16:60: warning: ignoring attributes on template argument 'Eigen::internal::Packet2d' {aka '__m128d'} [-Wignored-attributes]
18:18:39     16 |   struct conj_helper<PACKET_REAL, PACKET_CPLX, false, false> {          \
18:18:39        |                                                            ^
18:18:39  ../inst/include/Eigen/src/Core/arch/SSE/Complex.h:298:1: note: in expansion of macro 'EIGEN_MAKE_CONJ_HELPER_CPLX_REAL'
18:18:39    298 | EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet1cd,Packet2d)
18:18:39        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<much much more warnings>

18:24:44  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/GeneralSeasonalStateModel.cpp -o Models/StateSpace/StateModels/GeneralSeasonalStateModel.o
18:24:47  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/HierarchicalRegressionHolidayStateModel.cpp -o Models/StateSpace/StateModels/HierarchicalRegressionHolidayStateModel.o
18:24:48  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/Holiday.cpp -o Models/StateSpace/StateModels/Holiday.o
18:24:53  In file included from ../inst/include/Models/StateSpace/StateModels/Holiday.hpp:25,
18:24:53                   from Models/StateSpace/StateModels/Holiday.cpp:20:
18:24:53  ../inst/include/cpputil/Date.hpp:133:5: error: 'time_t' does not name a type
18:24:53    133 |     time_t to_time_t() const;
18:24:53        |     ^~~~~~
18:24:53  ../inst/include/cpputil/Date.hpp:25:1: note: 'time_t' is defined in header '<ctime>'; did you forget to '#include <ctime>'?
18:24:53     24 | #include "uint.hpp"
18:24:53    +++ |+#include <ctime>
18:24:53     25 | 
18:24:56  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/LocalLevelStateModel.cpp -o Models/StateSpace/StateModels/LocalLevelStateModel.o
18:24:57  g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED  -O2 -fomit-frame-pointer   -fpic  -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/LocalLinearTrend.cpp -o Models/StateSpace/StateModels/LocalLinearTrend.o
18:24:57  make: *** [/usr/lib/R/etc/Makeconf:178: Models/StateSpace/StateModels/Holiday.o] Error 1
18:24:57  make: *** Waiting for unfinished jobs....
18:25:11  ERROR: compilation failed for package ‘Boom’
steve-the-bayesian commented 1 year ago

If you have the source of the package available, Find the file .../inst/include/cpputil/Date.hpp. Open the file and add the line

include

near the other #include statements.

Then try installing the package from source. I'll make the corresponding change to the repo.

On Wed, Dec 14, 2022 at 6:17 AM Marc Bennewitz @.***> wrote:

Since Alpine 3.17 I'm getting a compile error on building my docker image

install.packages(

"CausalImpact",

verbose=TRUE,

clean=TRUE,

repos="https://cloud.r-project.org/",

INSTALL_opts=c("--no-help", "--no-html")

)

g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -DMUSL -flto -c Models/StateSpace/StateModels/LocalLinearTrend.cpp -o Models/StateSpace/StateModels/LocalLinearTrend.o

make: *** [/usr/lib/R/etc/Makeconf:178: Models/StateSpace/StateModels/Holiday.o] Error 1

make: *** Waiting for unfinished jobs....

ERROR: compilation failed for package ‘Boom’

Log:

18:14:48 installing source* package ‘Boom’ ...

18:14:48 ** package ‘Boom’ successfully unpacked and MD5 sums checked

18:14:48 ** using staged installation

18:14:48 ** libs

18:14:48 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -DMUSL -flto -c boom_r_tools.cpp -o boom_r_tools.o

18:18:38 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -D__MUSL__ -flto -c LinAlg/MatrixPartition.cpp -o LinAlg/MatrixPartition.o 18:18:39 In file included from ../inst/include/Eigen/Core:205, 18:18:39 from ../inst/include/Eigen/Cholesky:11, 18:18:39 from LinAlg/Cholesky.cpp:22: 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:46:40: warning: ignoring attributes on template argument '__m128i' [-Wignored-attributes] 18:18:39 46 | typedef eigen_packet_wrapper<__m128i, 0> Packet4i; 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:47:40: warning: ignoring attributes on template argument '__m128i' [-Wignored-attributes] 18:18:39 47 | typedef eigen_packet_wrapper<__m128i, 1> Packet16b; 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:49:39: warning: ignoring attributes on template argument '__m128' [-Wignored-attributes] 18:18:39 49 | template<> struct is_arithmetic<__m128> { enum { value = true }; }; 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:50:40: warning: ignoring attributes on template argument '__m128i' [-Wignored-attributes] 18:18:39 50 | template<> struct is_arithmetic<__m128i> { enum { value = true }; }; 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:51:40: warning: ignoring attributes on template argument '__m128d' [-Wignored-attributes] 18:18:39 51 | template<> struct is_arithmetic<__m128d> { enum { value = true }; }; 18:18:39 | ^ 18:18:39 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -D__MUSL__ -flto -c LinAlg/QR.cpp -o LinAlg/QR.o 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:222:43: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes] 18:18:39 222 | template<> struct unpacket_traits { 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:228:43: warning: ignoring attributes on template argument 'Eigen::internal::Packet2d' {aka '__m128d'} [-Wignored-attributes] 18:18:39 228 | template<> struct unpacket_traits { 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:1124:34: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes] 18:18:39 1124 | ptranspose(PacketBlock& kernel) { 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:1129:34: warning: ignoring attributes on template argument 'Eigen::internal::Packet2d' {aka '__m128d'} [-Wignored-attributes] 18:18:39 1129 | ptranspose(PacketBlock& kernel) { 18:18:39 | ^ 18:18:39 In file included from ../inst/include/Eigen/Core:174: 18:18:39 ../inst/include/Eigen/src/Core/arch/Default/ConjHelper.h:16:60: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes] 18:18:39 16 | struct conj_helper { \ 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/Complex.h:173:1: note: in expansion of macro 'EIGEN_MAKE_CONJ_HELPER_CPLX_REAL' 18:18:39 173 | EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet2cf,Packet4f) 18:18:39 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18:18:39 ../inst/include/Eigen/src/Core/arch/Default/ConjHelper.h:29:60: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f' {aka '__m128'} [-Wignored-attributes] 18:18:39 29 | struct conj_helper { \ 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/Complex.h:173:1: note: in expansion of macro 'EIGEN_MAKE_CONJ_HELPER_CPLX_REAL' 18:18:39 173 | EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet2cf,Packet4f) 18:18:39 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18:18:39 ../inst/include/Eigen/src/Core/arch/Default/ConjHelper.h:16:60: warning: ignoring attributes on template argument 'Eigen::internal::Packet2d' {aka '__m128d'} [-Wignored-attributes] 18:18:39 16 | struct conj_helper { \ 18:18:39 | ^ 18:18:39 ../inst/include/Eigen/src/Core/arch/SSE/Complex.h:298:1: note: in expansion of macro 'EIGEN_MAKE_CONJ_HELPER_CPLX_REAL' 18:18:39 298 | EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet1cd,Packet2d) 18:18:39 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18:24:44 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/GeneralSeasonalStateModel.cpp -o Models/StateSpace/StateModels/GeneralSeasonalStateModel.o 18:24:47 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/HierarchicalRegressionHolidayStateModel.cpp -o Models/StateSpace/StateModels/HierarchicalRegressionHolidayStateModel.o 18:24:48 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/Holiday.cpp -o Models/StateSpace/StateModels/Holiday.o 18:24:53 In file included from ../inst/include/Models/StateSpace/StateModels/Holiday.hpp:25, 18:24:53 from Models/StateSpace/StateModels/Holiday.cpp:20: 18:24:53 ../inst/include/cpputil/Date.hpp:133:5: error: 'time_t' does not name a type 18:24:53 133 | time_t to_time_t() const; 18:24:53 | ^~~~~~ 18:24:53 ../inst/include/cpputil/Date.hpp:25:1: note: 'time_t' is defined in header ''; did you forget to '#include '? 18:24:53 24 | #include "uint.hpp" 18:24:53 +++ |+#include 18:24:53 25 | 18:24:56 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/LocalLevelStateModel.cpp -o Models/StateSpace/StateModels/LocalLevelStateModel.o 18:24:57 g++ -std=gnu++17 -I"/usr/include/R" -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DADD_ -DR_NO_REMAP -DEIGEN_WARNINGS_DISABLED -O2 -fomit-frame-pointer -fpic -O2 -fomit-frame-pointer -D__MUSL__ -flto -c Models/StateSpace/StateModels/LocalLinearTrend.cpp -o Models/StateSpace/StateModels/LocalLinearTrend.o 18:24:57 make: *** [/usr/lib/R/etc/Makeconf:178: Models/StateSpace/StateModels/Holiday.o] Error 1 18:24:57 make: *** Waiting for unfinished jobs.... 18:25:11 ERROR: compilation failed for package ‘Boom’ — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
marc-mabe commented 1 year ago

If you have the source of the package available, Find the file .../inst/include/cpputil/Date.hpp. Open the file and add the line

include

near the other #include statements.

yes, this fixes the issue :+1: Opened a PR #72

steve-the-bayesian commented 1 year ago

Thanks for the PR!

On Thu, Dec 15, 2022 at 4:09 AM Marc Bennewitz @.***> wrote:

If you have the source of the package available, Find the file .../inst/include/cpputil/Date.hpp. Open the file and add the line

include

near the other #include statements.

yes, this fixes the issue 👍 Opened a PR #72 https://github.com/steve-the-bayesian/BOOM/pull/72

— Reply to this email directly, view it on GitHub https://github.com/steve-the-bayesian/BOOM/issues/71#issuecomment-1352968833, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVDVLFEC33ERRD54YO7DTWNMC7PANCNFSM6AAAAAAS6RGYQA . You are receiving this because you commented.Message ID: @.***>