ankane / prophet-ruby

Time series forecasting for Ruby
MIT License
396 stars 11 forks source link

Unable to install prophet from Gemfile #8

Closed lepepe closed 2 years ago

lepepe commented 2 years ago

Recently I upgrade my rails app to version 6.0 and prophet to 0.2.5; everything is running fine on development but when deploying my app to multiples droplets on Digital Ocean and to different stages I'm getting the error below.

I installed the gem manually without any issue; what I don't understand is that on some stages is deployed successfully, after the second one I started getting the error. Any idea what I could be doing wrong?

from /home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/cmdstan-0.1.7/lib/cmdstan/model.rb:16:in `initialize' from extconf.rb:13:in `new' from extconf.rb:13:in `<main>' extconf failed, exit code 1

Gem files will remain installed in /home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/prophet-rb-0.2.5 for inspection.

Results logged to /home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/prophet-rb-0.2.5/gem_make.out

An error occurred while installing prophet-rb (0.2.5), and Bundler cannot continue.
Make sure that `gem install prophet-rb -v '0.2.5'` succeeds before bundling.
In Gemfile:
  prophet-rb
ankane commented 2 years ago

Hey @lepepe, it looks like it's failing to compile the model, but don't see the reason. Can you paste the full output?

lepepe commented 2 years ago

Hi @ankane here is the full output. Could be related with memory issue?

current directory:
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/prophet-rb-0.2.5/ext/prophet
/home/deploy/.rbenv/versions/2.5.0/bin/ruby -r
./siteconf20210928-11506-1nhvrhc.rb extconf.rb

--- Translating Stan model to C++ code ---
bin/stanc  --o=/tmp/prophet.hpp /tmp/prophet.stan

--- Compiling, linking C++ code ---
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes  
-I stan/lib/stan_math/lib/tbb_2020.3/include   -O3 -I src -I stan/src -I
lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I
stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I
stan/lib/stan_math/lib/sundials_5.7.0/include    -DBOOST_DISABLE_ASSERTS        
-c -Wno-ignored-attributes   -x c++ -o /tmp/prophet.o /tmp/prophet.hpp

g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
make/program:53: recipe for target '/tmp/prophet' failed
make: *** [/tmp/prophet] Error 4
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/cmdstan-0.1.7/lib/cmdstan/utils.rb:24:in
`run_command': Command failed (CmdStan::Error)
from
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/cmdstan-0.1.7/lib/cmdstan/model.rb:22:in
`block in compile'
from
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/cmdstan-0.1.7/lib/cmdstan/model.rb:21:in
`chdir'
from
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/cmdstan-0.1.7/lib/cmdstan/model.rb:21:in
`compile'
from
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/cmdstan-0.1.7/lib/cmdstan/model.rb:16:in
`initialize'
    from extconf.rb:13:in `new'
    from extconf.rb:13:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/gems/prophet-rb-0.2.5 for
inspection.
Results logged to
/home/deploy/erp-bzidat/shared/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/prophet-rb-0.2.5/gem_make.out

An error occurred while installing prophet-rb (0.2.5), and Bundler cannot
continue.
Make sure that `gem install prophet-rb -v '0.2.5'` succeeds before bundling.

In Gemfile:
  prophet-rb
ankane commented 2 years ago

Yeah, it looks like the error is g++: internal compiler error: Segmentation fault (program cc1plus), but my guess is it's a memory issue if it works some of the time but not others.