ankane / torch.rb

Deep learning for Ruby, powered by LibTorch
Other
704 stars 30 forks source link

Version 0.13 build failure #39

Closed orlando-labs closed 1 year ago

orlando-labs commented 1 year ago

Hi, @ankane.

Can't figure out the origin of the following problem. I can't build the gem, neither on my servers (against libtorch 2.0.0) nor in the pipeline in my GitHub fork.

../../../../ext/torch/backends.cpp: In function ‘void init_backends(Rice::Module&)’:
../../../../ext/torch/backends.cpp:11:6: error: ‘class Rice::Module’ has no member named ‘add_handler’
   11 |     .add_handler<torch::Error>(handle_error)
      |      ^~~~~~~~~~~
../../../../ext/torch/backends.cpp:11:30: error: expected primary-expression before ‘>’ token
   11 |     .add_handler<torch::Error>(handle_error)
      |                              ^
../../../../ext/torch/backends.cpp:12:6: error: request for member ‘define_singleton_function’ in ‘handle_error’, which is of non-class type ‘void(const c10::Error&)’
   12 |     .define_singleton_function("available?", &torch::hasOpenMP);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../ext/torch/backends.cpp:15:6: error: ‘class Rice::Module’ has no member named ‘add_handler’
   15 |     .add_handler<torch::Error>(handle_error)
      |      ^~~~~~~~~~~
../../../../ext/torch/backends.cpp:15:30: error: expected primary-expression before ‘>’ token
   15 |     .add_handler<torch::Error>(handle_error)
      |                              ^
../../../../ext/torch/backends.cpp:16:6: error: request for member ‘define_singleton_function’ in ‘handle_error’, which is of non-class type ‘void(const c10::Error&)’
   16 |     .define_singleton_function("available?", &torch::hasMKL);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../ext/torch/backends.cpp:19:6: error: ‘class Rice::Module’ has no member named ‘add_handler’
   19 |     .add_handler<torch::Error>(handle_error)
      |      ^~~~~~~~~~~
../../../../ext/torch/backends.cpp:19:30: error: expected primary-expression before ‘>’ token
   19 |     .add_handler<torch::Error>(handle_error)
      |                              ^
../../../../ext/torch/backends.cpp:20:6: error: request for member ‘define_singleton_function’ in ‘handle_error’, which is of non-class type ‘void(const c10::Error&)’
   20 |     .define_singleton_function("available?", &torch::hasMPS);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../ext/torch/cuda.cpp: In function ‘void init_cuda(Rice::Module&)’:
../../../../ext/torch/cuda.cpp:9:6: error: ‘class Rice::Module’ has no member named ‘add_handler’
    9 |     .add_handler<torch::Error>(handle_error)
      |      ^~~~~~~~~~~
../../../../ext/torch/cuda.cpp:9:30: error: expected primary-expression before ‘>’ token
    9 |     .add_handler<torch::Error>(handle_error)
      |                              ^
../../../../ext/torch/cuda.cpp:10:6: error: request for member ‘define_singleton_function’ in ‘handle_error’, which is of non-class type ‘void(const c10::Error&)’
   10 |     .define_singleton_function("available?", &torch::cuda::is_available)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~

What I am missing here?

Eric-Guo commented 1 year ago

You need #40. ❤️

orlando-labs commented 1 year ago

Many thanks, @Eric-Guo!

ankane commented 1 year ago

Thanks for reporting. 0.13.1 is out with @Eric-Guo's fix.