Help in setup and debugging

86 views
Skip to first unread message

Shekhar Prasad Rajak

unread,
Jan 22, 2017, 1:30:54 AM1/22/17
to SciRuby Development
Hello all, I am trying to setup `daru` in my system. I have read several docs and blogs on `daru`. To setup the development version I did : 

gem install bundler
bundle install
bundle exec rake compile
bundle exec rake spec
 inside the daru cloned repo. But I got some errors. 
Something like : 

ERROR:  Error installing rmagick:

ERROR: Failed to build gem native extension.


Let me know if I am doing something wrong. I haven't seen any installation instruction in the docs (If it is somewhere then please share the link). Also please suggest a good debugger for the Ruby.


Thanks,

Shekhar

Lokesh Sharma

unread,
Jan 22, 2017, 2:38:27 AM1/22/17
to sciru...@googlegroups.com

Try this

sudo apt-get install libmagickwand-dev imagemagick

This should fix it.

Shekhar Prasad Rajak

unread,
Jan 23, 2017, 2:05:29 PM1/23/17
to SciRuby Development
Thanks Lokesh for reply. I tried to install it using `brew` in my mac system. Also tried some different ways , but still I am getting error. I think I am missing something. I will try again and search for the ans.

--
Shekhar

Lokesh Sharma

unread,
Jan 23, 2017, 2:10:56 PM1/23/17
to sciru...@googlegroups.com

Somewhere I read this might help

brew link --overwrite imagemagick

Shekhar Prasad Rajak

unread,
Jan 24, 2017, 10:55:27 AM1/24/17
to SciRuby Development
Thanks Lokesh for reply. There was a different problem in installation. rmagick is compatible with imagemagick 6.x.x version the latest version 7.x.x have some new updation in file names, so it was not working. I installed the 6.x.x version then did `gem install rmagick` it worked.

The problem I am getting, when I run `bundle install ` is :

```


An error occurred while installing gsl (2.1.0.1), and Bundler cannot continue.

Make sure that `gem install gsl -v '2.1.0.1'` succeeds before bundling.


I tried few things but still not able to fix. I hope I will find a solution soon.


--
Shekhar

Sameer Deshmukh

unread,
Jan 25, 2017, 8:15:35 AM1/25/17
to SciRuby Development
Did you try installing rb-gsl individually? Can you post the error it gave you?

Shekhar Prasad Rajak

unread,
Jan 25, 2017, 3:24:07 PM1/25/17
to SciRuby Development
Thanks Sameer for reply. Yes I tried to install it manually. I followed these commands : 

curl -O http://mirror.veriportal.com/gnu/gsl/gsl-1.14.tar.gz
tar xvzf gsl-1.14.tar.gz
cd gsl-1.14
./configure
make
sudo make install
sudo gem install --conservative --no-ri --no-rdoc gsl
or
gem install gsl

and get this error :


Building native extensions.  This could take a while...

ERROR:  Error installing gsl:

ERROR: Failed to build gem native extension.


    current directory: /Users/.rvm/rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/gsl-2.1.0.1/ext/gsl_native

/Users/.rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20170125-34982-gd9cdo.rb extconf.rb

*** ERROR: missing required library to compile this module: Ruby/GSL requires gsl-1.15 or later.

*** extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of necessary

libraries and/or headers.  Check the mkmf.log file for more details.  You may

need configuration options.



When I tried to install it the tar file , I get this : 

#include <architecture/ppc/fp_regs.h> 

         ^

1 error generated.

make[1]: *** [fp.lo] Error 1

make: *** [install-recursive] Error 1


I am searching for the solution.

--
Shekhar

Sameer Deshmukh

unread,
Jan 26, 2017, 8:10:56 PM1/26/17
to SciRuby Development
You're installing GSL v.1.14. You'll need GSL 2.0 for installing the gem.


On Sunday, January 22, 2017 at 12:00:54 PM UTC+5:30, Shekhar Prasad Rajak wrote:

Shekhar Prasad Rajak

unread,
Jan 27, 2017, 2:31:34 PM1/27/17
to SciRuby Development
Yes, I also tried with 2.3 version, that time also I was getting similar problem. After some effort I am not getting that error. But after installing  gsl-2.0 using  tar file and then running `gem install gsl` is giving this error :

checking gsl version... 2.3

checking gsl cflags... -I/usr/local/include

checking gsl libs... -L/usr/local/lib -lgsl -lgslcblas

checking for round()... yes

checking for alf/alf.h... no

checking for qrngextra/qrngextra.h... no

checking for rngextra/rngextra.h... no

checking for tensor/tensor.h... no

checking for gsl/gsl_multimin_fsdf.h... no

checking for gsl/gsl_cqp.h... no

checking for jacobi.h... no

checking for ndlinear/gsl_multifit_ndlinear.h... no

checking for ool/ool_version.h... no

checking for gsl_eigen_francis() in -lgsl... yes

checking for gsl_eigen_francis()... yes

checking for gsl_poly_solve_quartic() in -lgsl... no

checking for graph... no

checking for tamu_anova/tamu_anova.h... no

checking for gsl_multifit_fdfsolver.J in gsl/gsl_multifit_nlin.h... no

checking for gsl_sf_mathieu_a_e() in gsl/gsl_sf_mathieu.h... yes

checking for gsl_sf_mathieu_b_e() in gsl/gsl_sf_mathieu.h... yes

checking for gsl_sf_mathieu_ce_e() in gsl/gsl_sf_mathieu.h... yes

checking for gsl_sf_mathieu_se_e() in gsl/gsl_sf_mathieu.h... yes

checking for gsl_sf_mathieu_Mc_e() in gsl/gsl_sf_mathieu.h... yes

checking for gsl_sf_mathieu_Ms_e() in gsl/gsl_sf_mathieu.h... yes

creating gsl_config.h

creating Makefile


To see why this extension failed to compile, please check the mkmf.log which can be found here:


  /Users/.rvm/gems/ruby-2.4.0/extensions/x86_64-darwin-16/2.4.0/gsl-2.1.0.1/mkmf.log


current directory: /Users/.rvm/gems/ruby-2.4.0/gems/gsl-2.1.0.1/ext/gsl_native

make "DESTDIR=" clean


current directory: /Users/.rvm/gems/ruby-2.4.0/gems/gsl-2.1.0.1/ext/gsl_native

make "DESTDIR="

compiling alf.c

compiling array.c

compiling array_complex.c

compiling blas.c

compiling blas1.c

compiling blas2.c

compiling blas3.c

compiling block.c

compiling bspline.c

compiling bundle.c

compiling cdf.c

compiling cheb.c

compiling combination.c

compiling common.c

common.c:78:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]

  len0 = strlen(s0);

       ~ ^~~~~~~~~~

common.c:79:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]

  len1 = strlen(s1);

       ~ ^~~~~~~~~~

common.c:89:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]

  len0 = strlen(s0);

       ~ ^~~~~~~~~~

common.c:90:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]

  len1 = strlen(s1);

       ~ ^~~~~~~~~~

4 warnings generated.

compiling complex.c

compiling const.c

compiling const_additional.c

compiling cqp.c

compiling deriv.c

compiling dht.c

dht.c:225:45: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]

        val = t->j[n+1]*gsl_dht_x_sample(t, m)/t->xmax;

                        ~~~~~~~~~~~~~~~~    ^

dht.c:234:41: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]

    val = t->j[n+1]*gsl_dht_x_sample(t, m)/t->xmax;

                    ~~~~~~~~~~~~~~~~    ^

dht.c:256:70: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]

        val = gsl_sf_bessel_Jnu(t->nu, t->j[n+1]*gsl_dht_x_sample(t, m)/t->xmax);

                                                 ~~~~~~~~~~~~~~~~    ^

dht.c:265:66: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]

    val = gsl_sf_bessel_Jnu(t->nu, t->j[n+1]*gsl_dht_x_sample(t, m)/t->xmax);

                                             ~~~~~~~~~~~~~~~~    ^

dht.c:333:70: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]

        val = gsl_sf_bessel_Jnu(t->nu, t->j[n+1]*gsl_dht_x_sample(t, m)/t->xmax);

                                                 ~~~~~~~~~~~~~~~~    ^

dht.c:343:66: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]

    val = gsl_sf_bessel_Jnu(t->nu, t->j[n+1]*gsl_dht_x_sample(t, m)/t->xmax);

                                             ~~~~~~~~~~~~~~~~    ^

6 warnings generated.

compiling diff.c

compiling dirac.c

compiling eigen.c

compiling error.c

error.c:83:66: error: use of undeclared identifier 'rb_cFixnum'

  pgsl_error[-2] = rb_define_class_under(mgsl_error, "CONTINUE", rb_cFixnum);

                                                                 ^

error.c:85:64: error: use of undeclared identifier 'rb_cFixnum'

  pgsl_error[0] = rb_define_class_under(mgsl_error, "SUCCESS", rb_cFixnum);

                                                               ^

2 errors generated.

make: *** [error.o] Error 1


make failed, exit code 2


I am trying check the error. Thanks for reply.

--
Shekhar

Shekhar Prasad Rajak

unread,
Jan 27, 2017, 11:20:41 PM1/27/17
to SciRuby Development
Anyone knows why I am getting this error during installation of nmatrix :


make "DESTDIR="

compiling nmatrix.cpp

g++-4.8: error: unrecognized command line option '-Wdivision-by-zero'

g++-4.8: error: unrecognized command line option '-Wextra-tokens'

make: *** [nmatrix.o] Error 1



--
Shekhar

Sameer Deshmukh

unread,
Jan 28, 2017, 7:43:21 AM1/28/17
to SciRuby Development
Ah. The problem is that you're using Ruby 2.4 and the gem that's currently on rubygems is not compatible with that. I will release a new gem soon and let you know. Meanwhile you can pull the gem directly from the github repo.

Shekhar Prasad Rajak

unread,
Jan 28, 2017, 12:25:05 PM1/28/17
to SciRuby Development
In first problem (rmagick issue during bundle install), solution :  we need to use imagemagick 6.x.x version then run `gem install rmagick` .

2nd problem (gsl issue) , solution: daru uses gsl 1.16 so the gsl tar file version must be 1.16 and ruby version must be 2.3.x . 

After fixing these issue when I do `bundle install` (in ruby version 2.3.1, fixed above problem) I get nmatrix error (previous post issue) :  

```


make "DESTDIR="

compiling nmatrix.cpp

g++-4.8: error: unrecognized command line option '-Wdivision-by-zero'

g++-4.8: error: unrecognized command line option '-Wextra-tokens'

make: *** [nmatrix.o] Error 1


```


I have added a comment in the issue also : https://github.com/SciRuby/nmatrix/issues/426#issuecomment-275828218

To install it manually I followed this : https://github.com/SciRuby/nmatrix/wiki/Installation#mac-os-x and tried `bundle install` but I get the same error. 

Also same error in this : https://github.com/SciRuby/nmatrix/wiki/Installation#standard-installation-procedure  


Need to check some dependencies. I am searching for the solution.


--

Shekhar

Pjotr Prins

unread,
Jan 28, 2017, 1:25:01 PM1/28/17
to sciru...@googlegroups.com
Sigh.

On Sat, Jan 28, 2017 at 09:25:04AM -0800, Shekhar Prasad Rajak wrote:
> In first problem (rmagick issue during bundle install), solution :  we
> need to use imagemagick 6.x.x version then run `gem install rmagick` .
> 2nd problem (gsl issue) , solution: daru uses gsl 1.16 so the gsl tar file
> version must be 1.16 and ruby version must be 2.3.x . 
> After fixing these issue when I do `bundle install` (in ruby version
> 2.3.1, fixed above problem) I get nmatrix error (previous post issue) :  
> ```
>
> make "DESTDIR="
>
> compiling nmatrix.cpp
>
> g++-4.8: error: unrecognized command line option '-Wdivision-by-zero'
>
> g++-4.8: error: unrecognized command line option '-Wextra-tokens'
>
> make: *** [nmatrix.o] Error 1
>
> ```
>
> I have added a comment in the issue also
> : [1]https://github.com/SciRuby/nmatrix/issues/426#issuecomment-275828218
>
> To install it manually I followed this
> : [2]https://github.com/SciRuby/nmatrix/wiki/Installation#mac-os-x and
> tried `bundle install` but I get the same error. 
>
> Also same error in this :
> [3]https://github.com/SciRuby/nmatrix/wiki/Installation#standard-installation-procedure  
> --
> You received this message because you are subscribed to the Google Groups
> "SciRuby Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [4]sciruby-dev...@googlegroups.com.
> For more options, visit [5]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. https://github.com/SciRuby/nmatrix/issues/426#issuecomment-275828218
> 2. https://github.com/SciRuby/nmatrix/wiki/Installation#mac-os-x
> 3. https://github.com/SciRuby/nmatrix/wiki/Installation#standard-installation-procedure
> 4. mailto:sciruby-dev...@googlegroups.com
> 5. https://groups.google.com/d/optout


--

Pjotr Prins

unread,
Jan 29, 2017, 1:40:46 AM1/29/17
to sciru...@googlegroups.com
The solution to deployment dependencies is by using GNU Guix which can
nowadays be installed without admin privileges. We'll need to package
a number of gems to make Sciruby deployment as simple as running an
install script.

Is anyone interested in helping me package these gems? It should not
be too hard, but I don't want to do it on my own. You'll learn about
deployment and get some LISP thrown in.

Pj.
> To unsubscribe from this group and stop receiving emails from it, send an email to sciruby-dev...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--

Sameer Deshmukh

unread,
Jan 29, 2017, 4:28:39 AM1/29/17
to SciRuby Development
Pjotr,

Can that be a GSOC project? Packaging SciRuby tools with Guix? Maybe get Guix contributors on board as mentors?

I recently asked the package management question to a panel at Ruby Conf India and nobody seemed to know what exactly should be done :\

Pjotr Prins

unread,
Jan 29, 2017, 10:41:55 AM1/29/17
to sciru...@googlegroups.com
On Sun, Jan 29, 2017 at 01:28:38AM -0800, Sameer Deshmukh wrote:
> Pjotr,
>
> Can that be a GSOC project? Packaging SciRuby tools with Guix? Maybe get
> Guix contributors on board as mentors?
>
> I recently asked the package management question to a panel at Ruby Conf
> India and nobody seemed to know what exactly should be done :\

I put in a proposal 2 years ago. Maybe now the time is ripe :)

Pj.

Sameer Deshmukh

unread,
Jan 29, 2017, 12:16:28 PM1/29/17
to SciRuby Development
Shekhar,

Until I take care of rb-gsl, you can simply clone the daru source code, comment out the GSL dependency in the gemspec and begin contributing. GSL is not a hard dependency on daru and none of our current objectives depend on it in any way.

Shekhar Prasad Rajak

unread,
Jan 30, 2017, 4:17:38 AM1/30/17
to SciRuby Development
Thanks Sameer for reply. Now `bundle install` is going smooth. But when I try to do `bundle exec rake compile`
it returns with these error :

```

rake aborted!

Don't know how to build task 'compile' (see --tasks)

/Users/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'

/Users/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'

(See full trace by running task with --trace)


```

It seems there is some problem in Rakefile. I am searching for the solution.

--
Shekhar

Lokesh Sharma

unread,
Jan 30, 2017, 11:00:57 AM1/30/17
to sciru...@googlegroups.com
You don't need to run `bundle exec rake compile`. Read here https://github.com/SciRuby/daru/blob/master/CONTRIBUTING.md

--
You received this message because you are subscribed to the Google Groups "SciRuby Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sciruby-dev+unsubscribe@googlegroups.com.

Shekhar Prasad Rajak

unread,
Jan 31, 2017, 11:43:46 AM1/31/17
to SciRuby Development
Thanks for reply. It seems there is some problem in my installation of rvm . I will try in rbenv. 

--
Shekhar
To unsubscribe from this group and stop receiving emails from it, send an email to sciruby-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages