abscondment / statistics2

Shin-ichiro Hara's library, updated for Ruby 1.9 & packaged as a gem.
http://github.com/abscondment/statistics2
59 stars 13 forks source link

crash on m1 mac #8

Open stajilov opened 5 months ago

stajilov commented 5 months ago
gem install statistics2
Building native extensions. This could take a while...
ERROR:  Error installing statistics2:
        ERROR: Failed to build gem native extension.

    current directory: /Users/vladimir/.rvm/gems/ruby-3.0.0/gems/statistics2-0.54/ext
/Users/vladimir/.rvm/rubies/ruby-3.0.0/bin/ruby -I /Users/vladimir/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0 -r ./siteconf20240627-19205-hi9itb.rb extconf.rb
creating Makefile

current directory: /Users/vladimir/.rvm/gems/ruby-3.0.0/gems/statistics2-0.54/ext
make "DESTDIR=" clean

current directory: /Users/vladimir/.rvm/gems/ruby-3.0.0/gems/statistics2-0.54/ext
make "DESTDIR="
compiling statistics2.c
statistics2.c:87:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double normaldist(z)
              ^
statistics2.c:93:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double pnormaldist(qn)
              ^
statistics2.c:154:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double pchi2(y, n)
              ^
statistics2.c:186:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double chi2dist(df, chi2)
              ^
statistics2.c:193:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double pchi2dist(n, y)
              ^
statistics2.c:284:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double tdist(n, t)
              ^
statistics2.c:291:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double ptdist(n, y)
              ^
statistics2.c:394:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double fdist(n1, n2, f)
              ^
statistics2.c:401:15: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static double pfdist(n1, n2, y)
              ^
statistics2.c:410:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static int perm(n, x)
           ^
statistics2.c:423:12: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static int combi(n, x)
           ^
statistics2.c:431:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static float bindens(n, p, x)
             ^
statistics2.c:439:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static float bindist(n, p, x)
             ^
statistics2.c:451:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static float poissondens(m, x)
             ^
statistics2.c:459:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static float poissondist(m, x)
             ^
statistics2.c:472:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_normaldist(mod, x)
             ^
statistics2.c:479:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_normalxXX_(mod, x)
             ^
statistics2.c:486:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_normal__X_(mod, x)
             ^
statistics2.c:493:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_normal___x(mod, x)
             ^
statistics2.c:500:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_normalx__x(mod, x)
             ^
statistics2.c:508:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pnormaldist(mod, x)
             ^
statistics2.c:515:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pnormalxXX_(mod, x)
             ^
statistics2.c:522:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pnormal__X_(mod, x)
             ^
statistics2.c:529:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pnormal___x(mod, x)
             ^
statistics2.c:536:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pnormalx__x(mod, x)
             ^
statistics2.c:545:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_chi2_x(mod, n, x)
             ^
statistics2.c:552:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pchi2_x(mod, n, x)
             ^
statistics2.c:559:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_chi2X_(mod, n, x)
             ^
statistics2.c:566:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pchi2X_(mod, n, x)
             ^
statistics2.c:575:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_chi2dist(mod, n, x)
             ^
statistics2.c:582:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pchi2dist(mod, n, x)
             ^
statistics2.c:591:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_tdist(mod, n, x)
             ^
statistics2.c:598:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_tx__x(mod, n, x)
             ^
statistics2.c:605:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_txXX_(mod, n, x)
             ^
statistics2.c:612:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_t__X_(mod, n, x)
             ^
statistics2.c:619:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_t___x(mod, n, x)
             ^
statistics2.c:627:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_ptdist(mod, n, x)
             ^
statistics2.c:634:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_ptx__x(mod, n, x)
             ^
statistics2.c:641:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_ptxXX_(mod, n, x)
             ^
statistics2.c:648:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pt__X_(mod, n, x)
             ^
statistics2.c:655:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pt___x(mod, n, x)
             ^
statistics2.c:663:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_fdist(mod, n1, n2, x)
             ^
statistics2.c:671:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_f_x(mod, n1, n2, x)
             ^
statistics2.c:678:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_fX_(mod, n1, n2, x)
             ^
statistics2.c:686:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pfdist(mod, n1, n2, x)
             ^
statistics2.c:693:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pf_x(mod, n1, n2, x)
             ^
statistics2.c:700:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_pfX_(mod, n1, n2, x)
             ^
statistics2.c:709:25: error: parameter 'mod' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static VALUE rb_bindens(mod, n, p, x)
                        ^
statistics2.c:709:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_bindens(mod, n, p, x)
             ^
statistics2.c:716:25: error: parameter 'mod' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static VALUE rb_bindist(mod, n, p, x)
                        ^
statistics2.c:716:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_bindist(mod, n, p, x)
             ^
statistics2.c:723:23: error: parameter 'mod' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static VALUE rb_binX_(mod, n, p, x)
                      ^
statistics2.c:723:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_binX_(mod, n, p, x)
             ^
statistics2.c:730:23: error: parameter 'mod' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static VALUE rb_bin_x(mod, n, p, x)
                      ^
statistics2.c:730:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_bin_x(mod, n, p, x)
             ^
statistics2.c:737:29: error: parameter 'mod' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static VALUE rb_poissondens(mod, m, x)
                            ^
statistics2.c:737:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_poissondens(mod, m, x)
             ^
statistics2.c:744:29: error: parameter 'mod' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static VALUE rb_poissondist(mod, m, x)
                            ^
statistics2.c:744:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_poissondist(mod, m, x)
             ^
statistics2.c:751:27: error: parameter 'mod' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static VALUE rb_poissonX_(mod, m, x)
                          ^
statistics2.c:751:14: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static VALUE rb_poissonX_(mod, m, x)
             ^
54 warnings and 7 errors generated.
make: *** [statistics2.o] Error 1
michael-gratton commented 3 months ago

Looks like more of a C language compatibility error that has been finally picked up by a strict compiler rather than an incompatible ISA:

ISO C99 and later do not support implicit int [-Wimplicit-int]

@stajilov did you find a workaround? I wonder if that strictness can get turned down a bit?

michael-gratton commented 3 months ago

This seems to work for me: gem install statistics2 -- '--with-cflags=-Wno-error=implicit-int'

siannopollo commented 2 months ago

I had the same issue on an intel mac and @michael-gratton's solution worked. Thanks!