SciRuby/nmatrix

Trouble installing on Amazon EC2

Coolnesss opened this issue · 5 comments

I'm trying to install nmatrix as part of my Rails build, using Elastic Beanstalk. When i run eb deploy, which deploys the code and runs bundle install, I get

(...)
  Installing nmatrix 0.2.3 with native extensions
  
  Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  
      current directory: /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/nmatrix-0.2.3/ext/nmatrix
  /opt/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20170121-15040-1utdg3g.rb extconf.rb
  Cannot allocate memory - /opt/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20170121-15040-1utdg3g.rb extconf.rb 2>&1
(...)

Also when i SSH to the server and run gem install nmatrix -v 0.2.3 it hangs forever. Is it possible that my EC2 instance doesn't have enough memory to... compile nmatrix libraries? Any ideas? My instance should have 512MB of RAM.

Hey @lokeshh, thanks for your reply. Indeed, I left it for quite some time now and I managed to get the following error

virtual memory exhausted: Cannot allocate memory
make: *** [storage/yale/yale.o] Error 1

make failed, exit code 2

Does this mean i need to up the memory on my instance?

df -h has the following output

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        488M   56K  488M   1% /dev
tmpfs           498M     0  498M   0% /dev/shm
/dev/xvda1      7,8G  2,9G  4,8G  38% /

Should this suffice for the installation? I think virtual memory refers to swap and RAM combined, so maybe i need to add more swap?

Thanks, solved by adding more swap to my instance.