ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:50520] [Ruby trunk Bug#14668] Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
       [not found] <redmine.issue-14668.20180406035834@ruby-lang.org>
@ 2018-04-06  3:58 ` okkez000
  2018-04-08 13:46 ` [ruby-dev:50523] " s.wanabe
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: okkez000 @ 2018-04-06  3:58 UTC (permalink / raw)
  To: ruby-dev

Issue #14668 has been reported by okkez (okkez _).

----------------------------------------
Bug #14668: Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
https://bugs.ruby-lang.org/issues/14668

* Author: okkez (okkez _)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
https://github.com/SciRuby/nmatrix

Ruby2.5.1 まではコンパイルできたのですが、Ruby2.6.0-preview1 および trunk(r63103) でコンパイルできませんでした。

trunk を使ってビルドしたときのログです。

```
$ cd nmatrix
$ bundle exec rake compile:nmatrix
cd tmp/x86_64-linux/nmatrix/2.6.0
/tmp/local/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
using C++ standard... c++11
g++ reports version... 7.3.0-14)
checking for rb_array_const_ptr() in ruby.h... yes
creating nmatrix_config.h
creating Makefile
cd -
cd tmp/x86_64-linux/nmatrix/2.6.0
/usr/bin/make
compiling ../../../../ext/nmatrix/nmatrix.cpp
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
In file included from ../../../../ext/nmatrix/nmatrix.cpp:46:0:
../../../../ext/nmatrix/math/math.h: In function ‘I nm::math::smmp_sort::median(I, I, I)’:
../../../../ext/nmatrix/math/math.h:341:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (a < c) return c; // a c b
       ^~
../../../../ext/nmatrix/math/math.h:342:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return a; // c a b
                  ^~~~~~
../../../../ext/nmatrix/math/math.h:346:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (b < c) return c; // b c a
       ^~
../../../../ext/nmatrix/math/math.h:347:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return b; // c b a
                  ^~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_init_new_version(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1255:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1256:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_cast(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:1511:32: error: expected primary-expression before ‘char’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                                ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_mset(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2015:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_shape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_offset(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_supershape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_xslice(int, VALUE*, void* (*)(const STORAGE*, SLICE*), void (*)(NMATRIX*), VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2259:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_inverse_exact(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:2965:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_det_exact(VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:3009:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-self-assign’
cc1plus: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1plus: warning: unrecognized command line option ‘-Wno-parentheses-equality’
make: *** [Makefile:250: nmatrix.o] エラー 1
rake aborted!
Command failed with status (2): [/usr/bin/make...]
/tmp/local/bin/bundle:23:in `load'
/tmp/local/bin/bundle:23:in `<main>'
Tasks: TOP => compile:nmatrix => compile:nmatrix:x86_64-linux => copy:nmatrix:x86_64-linux:2.6.0 => tmp/x86_64-linux/nmatrix/2.6.0/nmatrix.so
(See full trace by running task with --trace)
```

これは nmatrix 側で何か対応が必要でしょうか?対応が必要であれば、どのような変更をすればよいのか教えてもらえないでしょうか?




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-dev:50523] [Ruby trunk Bug#14668] Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
       [not found] <redmine.issue-14668.20180406035834@ruby-lang.org>
  2018-04-06  3:58 ` [ruby-dev:50520] [Ruby trunk Bug#14668] Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない okkez000
@ 2018-04-08 13:46 ` s.wanabe
  2018-04-09  2:44 ` [ruby-dev:50524] " shyouhei
  2018-04-09  5:51 ` [ruby-dev:50525] " okkez000
  3 siblings, 0 replies; 4+ messages in thread
From: s.wanabe @ 2018-04-08 13:46 UTC (permalink / raw)
  To: ruby-dev

Issue #14668 has been updated by wanabe (_ wanabe).


r61843 以降、ALLOCA_N マクロの中で(利用可能なときには) RUBY_ALIGNOF マクロを利用するようになったことがきっかけのようです。

ただこれはきっかけというだけで、どちらかというと RUBY_ALIGNOF マクロが config.h の中に `_Alignof` の形で定義されていて、nmatrix のように C++ のプログラム中で用いる場合にも `alignof` にはなってくれないことの方がより根本的な原因のように見えます。

----------------------------------------
Bug #14668: Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
https://bugs.ruby-lang.org/issues/14668#change-71418

* Author: okkez (okkez _)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
https://github.com/SciRuby/nmatrix

Ruby2.5.1 まではコンパイルできたのですが、Ruby2.6.0-preview1 および trunk(r63103) でコンパイルできませんでした。

trunk を使ってビルドしたときのログです。

```
$ cd nmatrix
$ bundle exec rake compile:nmatrix
cd tmp/x86_64-linux/nmatrix/2.6.0
/tmp/local/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
using C++ standard... c++11
g++ reports version... 7.3.0-14)
checking for rb_array_const_ptr() in ruby.h... yes
creating nmatrix_config.h
creating Makefile
cd -
cd tmp/x86_64-linux/nmatrix/2.6.0
/usr/bin/make
compiling ../../../../ext/nmatrix/nmatrix.cpp
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
In file included from ../../../../ext/nmatrix/nmatrix.cpp:46:0:
../../../../ext/nmatrix/math/math.h: In function ‘I nm::math::smmp_sort::median(I, I, I)’:
../../../../ext/nmatrix/math/math.h:341:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (a < c) return c; // a c b
       ^~
../../../../ext/nmatrix/math/math.h:342:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return a; // c a b
                  ^~~~~~
../../../../ext/nmatrix/math/math.h:346:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (b < c) return c; // b c a
       ^~
../../../../ext/nmatrix/math/math.h:347:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return b; // c b a
                  ^~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_init_new_version(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1255:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1256:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_cast(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:1511:32: error: expected primary-expression before ‘char’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                                ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_mset(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2015:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_shape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_offset(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_supershape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_xslice(int, VALUE*, void* (*)(const STORAGE*, SLICE*), void (*)(NMATRIX*), VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2259:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_inverse_exact(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:2965:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_det_exact(VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:3009:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-self-assign’
cc1plus: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1plus: warning: unrecognized command line option ‘-Wno-parentheses-equality’
make: *** [Makefile:250: nmatrix.o] エラー 1
rake aborted!
Command failed with status (2): [/usr/bin/make...]
/tmp/local/bin/bundle:23:in `load'
/tmp/local/bin/bundle:23:in `<main>'
Tasks: TOP => compile:nmatrix => compile:nmatrix:x86_64-linux => copy:nmatrix:x86_64-linux:2.6.0 => tmp/x86_64-linux/nmatrix/2.6.0/nmatrix.so
(See full trace by running task with --trace)
```

これは nmatrix 側で何か対応が必要でしょうか?対応が必要であれば、どのような変更をすればよいのか教えてもらえないでしょうか?




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-dev:50524] [Ruby trunk Bug#14668] Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
       [not found] <redmine.issue-14668.20180406035834@ruby-lang.org>
  2018-04-06  3:58 ` [ruby-dev:50520] [Ruby trunk Bug#14668] Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない okkez000
  2018-04-08 13:46 ` [ruby-dev:50523] " s.wanabe
@ 2018-04-09  2:44 ` shyouhei
  2018-04-09  5:51 ` [ruby-dev:50525] " okkez000
  3 siblings, 0 replies; 4+ messages in thread
From: shyouhei @ 2018-04-09  2:44 UTC (permalink / raw)
  To: ruby-dev

Issue #14668 has been updated by shyouhei (Shyouhei Urabe).


とりあえずstdalign.hをincludeするようにしてalignofを優先したのでtrunkご確認ください。

余談ですがC++の場合、allocaを使う必然性は皆無のはずです。普通に `VALUE slice_argv[dim];` とかでいいはず。CもC99以降はそうです。Rubyがいまだにalloca使ってるのは古いCに固執してるから、という認識でいます。

----------------------------------------
Bug #14668: Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
https://bugs.ruby-lang.org/issues/14668#change-71424

* Author: okkez (okkez _)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
https://github.com/SciRuby/nmatrix

Ruby2.5.1 まではコンパイルできたのですが、Ruby2.6.0-preview1 および trunk(r63103) でコンパイルできませんでした。

trunk を使ってビルドしたときのログです。

```
$ cd nmatrix
$ bundle exec rake compile:nmatrix
cd tmp/x86_64-linux/nmatrix/2.6.0
/tmp/local/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
using C++ standard... c++11
g++ reports version... 7.3.0-14)
checking for rb_array_const_ptr() in ruby.h... yes
creating nmatrix_config.h
creating Makefile
cd -
cd tmp/x86_64-linux/nmatrix/2.6.0
/usr/bin/make
compiling ../../../../ext/nmatrix/nmatrix.cpp
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
In file included from ../../../../ext/nmatrix/nmatrix.cpp:46:0:
../../../../ext/nmatrix/math/math.h: In function ‘I nm::math::smmp_sort::median(I, I, I)’:
../../../../ext/nmatrix/math/math.h:341:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (a < c) return c; // a c b
       ^~
../../../../ext/nmatrix/math/math.h:342:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return a; // c a b
                  ^~~~~~
../../../../ext/nmatrix/math/math.h:346:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (b < c) return c; // b c a
       ^~
../../../../ext/nmatrix/math/math.h:347:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return b; // c b a
                  ^~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_init_new_version(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1255:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1256:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_cast(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:1511:32: error: expected primary-expression before ‘char’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                                ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_mset(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2015:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_shape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_offset(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_supershape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_xslice(int, VALUE*, void* (*)(const STORAGE*, SLICE*), void (*)(NMATRIX*), VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2259:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_inverse_exact(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:2965:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_det_exact(VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:3009:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-self-assign’
cc1plus: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1plus: warning: unrecognized command line option ‘-Wno-parentheses-equality’
make: *** [Makefile:250: nmatrix.o] エラー 1
rake aborted!
Command failed with status (2): [/usr/bin/make...]
/tmp/local/bin/bundle:23:in `load'
/tmp/local/bin/bundle:23:in `<main>'
Tasks: TOP => compile:nmatrix => compile:nmatrix:x86_64-linux => copy:nmatrix:x86_64-linux:2.6.0 => tmp/x86_64-linux/nmatrix/2.6.0/nmatrix.so
(See full trace by running task with --trace)
```

これは nmatrix 側で何か対応が必要でしょうか?対応が必要であれば、どのような変更をすればよいのか教えてもらえないでしょうか?




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-dev:50525] [Ruby trunk Bug#14668] Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
       [not found] <redmine.issue-14668.20180406035834@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2018-04-09  2:44 ` [ruby-dev:50524] " shyouhei
@ 2018-04-09  5:51 ` okkez000
  3 siblings, 0 replies; 4+ messages in thread
From: okkez000 @ 2018-04-09  5:51 UTC (permalink / raw)
  To: ruby-dev

Issue #14668 has been updated by okkez (okkez _).


trunk で試したところコンパイルが通るようになりました。
ありがとうございます!

余談も https://github.com/SciRuby/nmatrix に共有しておきます。

----------------------------------------
Bug #14668: Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない
https://bugs.ruby-lang.org/issues/14668#change-71425

* Author: okkez (okkez _)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
https://github.com/SciRuby/nmatrix

Ruby2.5.1 まではコンパイルできたのですが、Ruby2.6.0-preview1 および trunk(r63103) でコンパイルできませんでした。

trunk を使ってビルドしたときのログです。

```
$ cd nmatrix
$ bundle exec rake compile:nmatrix
cd tmp/x86_64-linux/nmatrix/2.6.0
/tmp/local/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
using C++ standard... c++11
g++ reports version... 7.3.0-14)
checking for rb_array_const_ptr() in ruby.h... yes
creating nmatrix_config.h
creating Makefile
cd -
cd tmp/x86_64-linux/nmatrix/2.6.0
/usr/bin/make
compiling ../../../../ext/nmatrix/nmatrix.cpp
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
In file included from ../../../../ext/nmatrix/nmatrix.cpp:46:0:
../../../../ext/nmatrix/math/math.h: In function ‘I nm::math::smmp_sort::median(I, I, I)’:
../../../../ext/nmatrix/math/math.h:341:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (a < c) return c; // a c b
       ^~
../../../../ext/nmatrix/math/math.h:342:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return a; // c a b
                  ^~~~~~
../../../../ext/nmatrix/math/math.h:346:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if (b < c) return c; // b c a
       ^~
../../../../ext/nmatrix/math/math.h:347:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
                  return b; // c b a
                  ^~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_init_new_version(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1245:25: note: in expansion of macro ‘NM_ALLOCA_N’
     VALUE* slice_argv = NM_ALLOCA_N(VALUE, dim);
                         ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1255:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1256:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_cast(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:1511:32: error: expected primary-expression before ‘char’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                                ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:1511:20: note: in expansion of macro ‘NM_ALLOCA_N’
   void* init_ptr = NM_ALLOCA_N(char, DTYPE_SIZES[new_dtype]);
                    ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_mset(int, VALUE*, VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2014:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2015:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_shape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2132:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_offset(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2154:19: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* offset = NM_ALLOCA_N(VALUE, s->dim);
                   ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_supershape(VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2181:18: note: in expansion of macro ‘NM_ALLOCA_N’
   VALUE* shape = NM_ALLOCA_N(VALUE, s->dim);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_xslice(int, VALUE*, void* (*)(const STORAGE*, SLICE*), void (*)(NMATRIX*), VALUE)’:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2258:21: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->coords = NM_ALLOCA_N(size_t, dim);
                     ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:26: error: expected primary-expression before ‘)’ token
         RUBY_ALIGNOF(type) * CHAR_BIT)
                          ^
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2259:22: note: in expansion of macro ‘NM_ALLOCA_N’
     slice->lengths = NM_ALLOCA_N(size_t, dim);
                      ^~~~~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_inverse_exact(VALUE, VALUE, VALUE, VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:2965:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:2965:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
../../../../ext/nmatrix/ruby_nmatrix.c: In function ‘VALUE nm_det_exact(VALUE)’:
../../../../ext/nmatrix/ruby_nmatrix.c:3009:30: error: expected primary-expression before ‘char’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                              ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:22: note: in definition of macro ‘ALLOCA_N’
         RUBY_ALIGNOF(type) * CHAR_BIT)
                      ^~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
In file included from /tmp/local/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /tmp/local/include/ruby-2.6.0/ruby.h:33,
                 from ../../../../ext/nmatrix/nmatrix.cpp:35:
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: error: ‘_Alignof’ was not declared in this scope
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
/tmp/local/include/ruby-2.6.0/x86_64-linux/ruby/config.h:134:22: note: suggested alternative: ‘__lrintf’
 #define RUBY_ALIGNOF _Alignof
                      ^
/tmp/local/include/ruby-2.6.0/ruby/ruby.h:1613:9: note: in expansion of macro ‘RUBY_ALIGNOF’
         RUBY_ALIGNOF(type) * CHAR_BIT)
         ^~~~~~~~~~~~
../../../../ext/nmatrix/nm_memory.h:44:31: note: in expansion of macro ‘ALLOCA_N’
 #define NM_ALLOCA_N(type, n) (ALLOCA_N(type, n))
                               ^~~~~~~~
../../../../ext/nmatrix/ruby_nmatrix.c:3009:18: note: in expansion of macro ‘NM_ALLOCA_N’
   void* result = NM_ALLOCA_N(char, DTYPE_SIZES[dtype]);
                  ^~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-self-assign’
cc1plus: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1plus: warning: unrecognized command line option ‘-Wno-parentheses-equality’
make: *** [Makefile:250: nmatrix.o] エラー 1
rake aborted!
Command failed with status (2): [/usr/bin/make...]
/tmp/local/bin/bundle:23:in `load'
/tmp/local/bin/bundle:23:in `<main>'
Tasks: TOP => compile:nmatrix => compile:nmatrix:x86_64-linux => copy:nmatrix:x86_64-linux:2.6.0 => tmp/x86_64-linux/nmatrix/2.6.0/nmatrix.so
(See full trace by running task with --trace)
```

これは nmatrix 側で何か対応が必要でしょうか?対応が必要であれば、どのような変更をすればよいのか教えてもらえないでしょうか?




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-09  5:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-14668.20180406035834@ruby-lang.org>
2018-04-06  3:58 ` [ruby-dev:50520] [Ruby trunk Bug#14668] Ruby2.6.0-preview1とtrunkでnmatrixがコンパイルできない okkez000
2018-04-08 13:46 ` [ruby-dev:50523] " s.wanabe
2018-04-09  2:44 ` [ruby-dev:50524] " shyouhei
2018-04-09  5:51 ` [ruby-dev:50525] " okkez000

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).