sonots/cumo

Can't compile cumo

Watson1978 opened this issue ยท 12 comments

I tried to compile cumo on MacBook Pro 15-inch Late 2013 model with latest CUDA Toolkit.

I got following build error.

$ bundle exec rake compile
cd ext/cumo && ruby extconf.rb && make && make build-ctest
checking for numo/narray.h... yes
checking for dlfcn.h... yes
checking for -ldl... yes
checking for dlopen()... yes
checking for stdbool.h... yes
checking for stdint.h... yes
checking for bool in stdbool.h... yes
checking for u_int8_t in stdint.h... yes
checking for u_int16_t in stdint.h... yes
checking for int32_t in stdint.h... yes
checking for u_int32_t in stdint.h... yes
checking for int64_t in stdint.h... yes
checking for u_int64_t in stdint.h... yes
checking for exp10()... no
checking for rb_cComplex... yes
checking for rb_thread_call_without_gvl()... yes
creating include/cumo/extconf.h
creating depend
checking for -lcuda... yes
checking for -lcudart... yes
checking for -lnvrtc... yes
checking for -lcublas... yes
creating Makefile
compiling cumo.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o cumo.o -c cumo.c
compiling narray/narray.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o narray/narray.o -c narray/narray.c
narray/narray.c:360:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    ndim = RARRAY_LEN(v);
         ~ ^~~~~~~~~~~~~
/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/ruby.h:1021:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
                      ^~~~~~~~~~~~~~~
narray/narray.c:1188:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            nd = RARRAY_LEN(vshape);
               ~ ^~~~~~~~~~~~~~~~~~
/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/ruby.h:1021:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
                      ^~~~~~~~~~~~~~~
narray/narray.c:1515:21: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
            r = beg + step*j;
              ~ ~~~~^~~~~~~~
3 warnings generated.
compiling narray/array.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o narray/array.o -c narray/array.c
narray/array.c:118:9: warning: implicit conversion loses integer precision: 'VALUE' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        MDAI_ATTR_TYPE(type,v,begin);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:113:11: note: expanded from macro 'MDAI_ATTR_TYPE'
    {tp = cumo_na_object_type(tp,rb_funcall(v,cumo_id_##attr,0));}
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:119:9: warning: implicit conversion loses integer precision: 'VALUE' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        MDAI_ATTR_TYPE(type,v,end);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:113:11: note: expanded from macro 'MDAI_ATTR_TYPE'
    {tp = cumo_na_object_type(tp,rb_funcall(v,cumo_id_##attr,0));}
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:121:9: warning: implicit conversion loses integer precision: 'VALUE' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        MDAI_ATTR_TYPE(type,v,begin);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:113:11: note: expanded from macro 'MDAI_ATTR_TYPE'
    {tp = cumo_na_object_type(tp,rb_funcall(v,cumo_id_##attr,0));}
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:122:9: warning: implicit conversion loses integer precision: 'VALUE' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        MDAI_ATTR_TYPE(type,v,end);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:113:11: note: expanded from macro 'MDAI_ATTR_TYPE'
    {tp = cumo_na_object_type(tp,rb_funcall(v,cumo_id_##attr,0));}
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:123:9: warning: implicit conversion loses integer precision: 'VALUE' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        MDAI_ATTR_TYPE(type,v,step);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:113:11: note: expanded from macro 'MDAI_ATTR_TYPE'
    {tp = cumo_na_object_type(tp,rb_funcall(v,cumo_id_##attr,0));}
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
narray/array.c:125:16: warning: implicit conversion loses integer precision: 'VALUE' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        type = cumo_na_object_type(type,v);
             ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.
compiling narray/step.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o narray/step.o -c narray/step.c
compiling narray/index.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o narray/index.o -c narray/index.c
narray/index.c:127:13: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    int n = RARRAY_LEN(ary);
        ~   ^~~~~~~~~~~~~~~
/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/ruby.h:1021:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
                      ^~~~~~~~~~~~~~~
narray/index.c:200:23: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    n = (end-beg)/step+1;
      ~ ~~~~~~~~~~~~~~^~
narray/index.c:226:19: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            len = RARRAY_LEN(e->args);
                ~ ^~~~~~~~~~~~~~~~~~~
/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/ruby.h:1021:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
                      ^~~~~~~~~~~~~~~
narray/index.c:324:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    nidx = RARRAY_LEN(args);
         ~ ^~~~~~~~~~~~~~~~
/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/ruby.h:1021:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
                      ^~~~~~~~~~~~~~~
4 warnings generated.
compiling narray/ndloop.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o narray/ndloop.o -c narray/ndloop.c
compiling narray/data.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o narray/data.o -c narray/data.c
mkdir -p narray/types types
ruby narray/gen/cogen.rb -l -o narray/types/bit.c narray/gen/def/bit.rb
compiling narray/types/bit.c
clang -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe -o narray/types/bit.o -c narray/types/bit.c
narray/gen/tmpl/lib.c:22:1: error: unknown type name 'narray'
narray/types/bit.c
^
narray/gen/tmpl/lib.c:22:7: error: expected identifier or '('
narray/types/bit.c
      ^
narray/gen/tmpl/lib.c:23:34: error: expected "FILENAME" or <FILENAME>
#include <static ID cumo_id_cast;
                                 ^
narray/gen/tmpl/lib.c:29:1: error: expected identifier or '('
>
^
narray/gen/tmpl/lib.c:34:1: error: unknown type name 'cumo'
cumo/types/bit.h
^
narray/gen/tmpl/lib.c:34:5: error: expected identifier or '('
cumo/types/bit.h
    ^
narray/gen/tmpl/class.c:9:1: error: unknown type name 'bit_store'
bit_store
^
narray/gen/tmpl/alloc_func.c:1:1: error: expected identifier or '('
static size_t
^
narray/gen/tmpl/alloc_func.c:53:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    {0, Cumo::Bit_free, _memsize,},
        ^~~~~
        .Cumo =
narray/gen/tmpl/alloc_func.c:53:14: error: expected expression
    {0, Cumo::Bit_free, _memsize,},
             ^
narray/gen/tmpl/alloc_func.c:55:6: error: use of undeclared identifier 'bitbit_info'; did you mean 'bit_info'?
    &bitbit_info,
     ^~~~~~~~~~~
     bit_info
narray/gen/tmpl/alloc_func.c:42:32: note: 'bit_info' declared here
static cumo_narray_type_info_t bit_info = {
                               ^
narray/gen/tmpl/alloc_func.c:73:42: error: use of undeclared identifier 'bit_s_alloc_func_data_type'
    return TypedData_Wrap_Struct(klass, &bit_s_alloc_func_data_type, (void*)na);
                                         ^
narray/gen/tmpl/alloc_func.c:75:1: error: unknown type name 'bit'
bit
^
narray/gen/tmpl_bit/allocate.c:1:1: error: expected identifier or '('
static VALUE
^
narray/gen/tmpl_bit/allocate.c:25:1: error: unknown type name 'bit_allocate'
bit_allocate
^
narray/gen/tmpl_bit/extract.c:10:1: error: expected identifier or '('
static VALUE
^
narray/gen/tmpl_bit/extract.c:31:1: error: unknown type name 'extractbit'
extractbit
^
narray/gen/tmpl_bit/extract_cpu.c:9:1: error: expected identifier or '('
static VALUE
^
narray/gen/tmpl_bit/extract_cpu.c:30:1: error: unknown type name 'extract_cpubit'
extract_cpubit
^
narray/gen/tmpl/new_dim0.c:1:1: error: expected identifier or '('
void (dtype *ptr, dtype x);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [narray/types/bit.o] Error 1
rake aborted!
Command failed with status (2): [cd ext/cumo && ruby extconf.rb && make && ...]
/Users/watson/src/cumo/Rakefile:11:in `block in <top (required)>'
/Users/watson/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/Users/watson/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => compile
(See full trace by running task with --trace)

In my environment, the invalid C-lang code is generated in cumo/ext/cumo/narray/types/bit.c from template file.

https://gist.github.com/Watson1978/530c89620a7cc551416d8890b01f4dd0

require "erbpp/line_number"

Seems that the above line trigger to generate invalid code.
If removed above line, I can get the valid C-lang source code.

However, I can't still compile cumo with following error :(

....

/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/ruby.h:1021:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
                      ^~~~~~~~~~~~~~~
1 warning generated.
mkdir -p narray/types types
ruby narray/gen/cogen_kernel.rb -l -o narray/types/bit_kernel.cu narray/gen/def/bit.rb
compiling narray/types/bit_kernel.cu
[given options]: --mkmf-cu-ext=cxx -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -std=c++14 -o narray/types/bit_kernel.o -c narray/types/bit_kernel.cu
nvcc  -std c++14 -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -I/usr/local/cuda/include -I/Users/watson/.rbenv/versions/2.5.1/include -DHAVE_NUMO_NARRAY_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_STDBOOL_H -DHAVE_STDINT_H -DHAVE_TYPE_BOOL -DHAVE_TYPE_U_INT8_T -DHAVE_TYPE_U_INT16_T -DHAVE_TYPE_INT32_T -DHAVE_TYPE_U_INT32_T -DHAVE_TYPE_INT64_T -DHAVE_TYPE_U_INT64_T -DHAVE_RB_CCOMPLEX -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -o narray/types/bit_kernel.o -c narray/types/bit_kernel.cu -O3 --compiler-options -fno-common --compiler-options -Wall --compiler-options -Wextra --compiler-options -Wno-unused-parameter --compiler-options -Wno-parentheses --compiler-options -Wno-long-long --compiler-options -Wno-missing-field-initializers --compiler-options -Wno-tautological-compare --compiler-options -Wno-parentheses-equality --compiler-options -Wno-constant-logical-operand --compiler-options -Wno-self-assign --compiler-options -Wunused-variable --compiler-options -Wimplicit-int --compiler-options -Wpointer-arith --compiler-options -Wwrite-strings --compiler-options -Wdeclaration-after-statement --compiler-options -Wshorten-64-to-32 --compiler-options -Wimplicit-function-declaration --compiler-options -Wdivision-by-zero --compiler-options -Wdeprecated-declarations --compiler-options -Wextra-tokens --compiler-options -std=c++14 --compiler-bindir clang++ -arch=sm_35
nvcc fatal   : The version ('9.1') of the host compiler ('Apple clang') is not supported
make: *** [narray/types/bit_kernel.o] Error 1
rake aborted!
Command failed with status (2): [cd ext/cumo && ruby extconf.rb && make && ...]
/Users/watson/src/cumo/Rakefile:11:in `block in <top (required)>'
/Users/watson/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/Users/watson/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => compile
(See full trace by running task with --trace)
nvcc fatal   : The version ('9.1') of the host compiler ('Apple clang') is not supported

Maybe I need to change another compiler or Xcode 8.x (pytorch/pytorch#3047 (comment))

I need to remove

require "erbpp/line_number"

to generate valid *.cu file

Now, I'm using clang/clang++ in Xcode 8.3.
However, I got another compile error....

$ bundle exec rake compile
cd ext/cumo && ruby extconf.rb && make && make build-ctest
checking for numo/narray.h... yes
checking for dlfcn.h... yes
checking for -ldl... yes
checking for dlopen()... yes
checking for stdbool.h... yes
checking for stdint.h... yes
checking for bool in stdbool.h... yes
checking for u_int8_t in stdint.h... yes
checking for u_int16_t in stdint.h... yes
checking for int32_t in stdint.h... yes
checking for u_int32_t in stdint.h... yes
checking for int64_t in stdint.h... yes
checking for u_int64_t in stdint.h... yes
checking for exp10()... no
checking for rb_cComplex... yes
checking for rb_thread_call_without_gvl()... yes
creating include/cumo/extconf.h
creating depend
checking for -lcuda... yes
checking for -lcudart... yes
checking for -lnvrtc... yes
checking for -lcublas... yes
creating Makefile
linking shared-object cumo.bundle
clang -dynamic -bundle -o cumo.bundle cumo.o narray/narray.o narray/array.o narray/step.o narray/index.o narray/ndloop.o narray/data.o narray/types/bit.o narray/types/int8.o narray/types/int16.o narray/types/int32.o narray/types/int64.o narray/types/uint8.o narray/types/uint16.o narray/types/uint32.o narray/types/uint64.o narray/types/sfloat.o narray/types/dfloat.o narray/types/scomplex.o narray/types/dcomplex.o narray/types/robject.o narray/types/bit_kernel.o narray/types/int8_kernel.o narray/types/int16_kernel.o narray/types/int32_kernel.o narray/types/int64_kernel.o narray/types/uint8_kernel.o narray/types/uint16_kernel.o narray/types/uint32_kernel.o narray/types/uint64_kernel.o narray/types/sfloat_kernel.o narray/types/dfloat_kernel.o narray/types/scomplex_kernel.o narray/types/dcomplex_kernel.o narray/types/robject_kernel.o narray/math.o narray/SFMT.o narray/struct.o narray/rand.o cuda/cublas.o cuda/driver.o cuda/memory_pool.o cuda/memory_pool_impl.o cuda/runtime.o cuda/nvrtc.o -L. -L/Users/watson/.rbenv/versions/2.5.1/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -L. -L/Users/watson/.rbenv/versions/2.5.1/lib -fstack-protector -L/usr/local/lib -L/Users/watson/.rbenv/versions/2.5.1/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -lcublas -lnvrtc -lcudart -lcuda -ldl -lpthread -ljemalloc -lgmp -ldl -lobjc
ld: warning: directory not found for option '-L/usr/local/cuda/lib64'
ld: warning: directory not found for option '-L/usr/local/cuda/lib64'
nvcc -DNO_RUBY -std=c++14  -L. -L/Users/watson/.rbenv/versions/2.5.1/lib -I. -I. -Iinclude -Inarray -Icuda -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17 -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0/ruby/backward -I/Users/watson/.rbenv/versions/2.5.1/include/ruby-2.5.0 -I. -I/Users/watson/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/numo-narray-0.9.1.2/ext/numo/narray -o cuda/memory_pool_impl_test.exe cuda/memory_pool_impl_test.cpp cuda/memory_pool_impl.cpp
In file included from cuda/memory_pool_impl_test.cpp:1:
cuda/memory_pool_impl.hpp:37:59: error: no member named 'to_string' in namespace 'std'
        runtime_error("out of memory to allocate " + std::to_string(size) + " bytes (total " + std::to_string(total) + " bytes)") {}
                                                     ~~~~~^
cuda/memory_pool_impl.hpp:37:101: error: no member named 'to_string' in namespace 'std'
        runtime_error("out of memory to allocate " + std::to_string(size) + " bytes (total " + std::to_string(total) + " bytes)") {}
                                                                                               ~~~~~^
2 errors generated.
make: *** [cuda/memory_pool_impl_test.exe] Error 1
rake aborted!
Command failed with status (2): [cd ext/cumo && ruby extconf.rb && make && ...]
/Users/watson/src/cumo/Rakefile:11:in `block in <top (required)>'
/Users/watson/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/Users/watson/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => compile
(See full trace by running task with --trace)

Watson1978/cumo@df1c27a...36870b9

OK, I've got something with above my changing.

$ xcodebuild -version
Xcode 8.3.3
Build version 8E3004b

$ bundle exec rake install:local
cumo 0.1.0 built to pkg/cumo-0.1.0.gem.
cumo (0.1.0) installed.

$ irb
irb(main):001:0> require "cumo/narray"
=> true
irb(main):002:0> a = Cumo::DFloat.new(3,5).seq
Traceback (most recent call last):
        4: from /Users/watson/.rbenv/versions/2.5.1/bin/irb:11:in `<main>'
        3: from (irb):2
        2: from (irb):2:in `seq'
        1: from (irb):2:in `allocate'
Cumo::CUDA::RuntimeError (CUDA driver version is insufficient for CUDA runtime version (error=35))
irb(main):003:0>

Compute Capability of GeForce GT 750M is 3.0, and cumo supports >= 6.0.

Added #include <string> at ext/cumo/cuda/memory_pool_impl.hpp via db408bd

CUDA driver version is insufficient for CUDA runtime version

This looks a installation problem of CUDA rather then cumo.

I've installed graphic driver made by NVIDIA via https://www.insanelymac.com/forum/topic/324195-nvidia-web-driver-updates-for-macos-high-sierra-update-07092018/

Finally, I got

$ irb
irb(main):001:0> require "cumo/narray"
=> true
irb(main):002:0> a = Cumo::DFloat.new(3,5).seq
=> Cumo::DFloat#shape=[3,5]
[[0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0]]
irb(main):003:0> exit


$ /usr/bin/sw_vers -productVersion
10.13.6

๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

Good to hear that :-)

#92 is fixed.

Let me close.